Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Highlighted
New Developer
Posts: 9
Registered: ‎01-25-2010
My Device: 8300
My Carrier: Telus

Can you connect to all L2CAP HID ports (PSMs) with jsr-82 or are some restricted?

I trolled around and found this: http://supportforums.blackberry.com/t5/Java-Development/Bluetooth-L2CAP-connection-request-to-Connec...

 

It does not answer my question so have started a new post.

 

I am experimenting with bluetooth and HID and want to connect to the control and interrupt channel: 0x0011 and 0x0013.

 

Code like that below gives: illegalArgumentException: Invalid PSM.

 

Is this a complete non-starter or is there something obvious I am missing? i.e. certain PSM's are off-limits.

 

conn = (L2CAPConnection)Connector.open( "btl2cap://" + btAddress + ":" + PSM );

 

btAddress is a valid bluetooth address (discovered) and PSM is one of "0011" or "0013" (as above)

 

Thanks.

New Developer
Posts: 9
Registered: ‎01-25-2010
My Device: 8300
My Carrier: Telus

Re: Can you connect to all L2CAP HID ports (PSMs) with jsr-82 or are some restricted?

On further digging it looks like I am hooped since this seems to be a "feature" of jsr-82.

 

e.g. http://discussion.forum.nokia.com/forum/showthread.php?t=98361 has this comment:

 

From the JSR-82 spec:

The psm in the preceding connection string description represents the Protocol Service Multiplexor (PSM) value for the service. L2CAP server applications on a device can identify themselves with a PSM value, which is assigned by the implementation. Legal PSM values are in the range (0x1001..0xFFFF), and the least significant byte must be odd and all other bytes must be even.

If I am reading this correctly, the PSM in a client connection URL must be in the dynamic range (0x1001..0xFFFF). How can an application connect to a service with a static PSM value (like an HID device with PSM 0x11 and 0x13)??

 

It would be good to get official RIM confirmation of this limitation in the the jsr-82 in the phones. Any RIMite care to comment?!

 

If so, then does this exclude making phones function as part of the HID universe?

New Contributor
Posts: 7
Registered: ‎08-13-2009
My Device: Not Specified

Re: Can you connect to all L2CAP HID ports (PSMs) with jsr-82 or are some restricted?

I'm stuck with the same problem. Have you found a solution to the HID PSM range problem?

 

RIM, any official answer? Is there a way to override the JSR-82 implementation and accept the HID PSMs?

 

Thanks

New Developer
Posts: 9
Registered: ‎01-25-2010
My Device: 8300
My Carrier: Telus

Re: Can you connect to all L2CAP HID ports (PSMs) with jsr-82 or are some restricted?

No. I was hoping for RIM to give us some official answer!! I think the sad news is that it's just the way jsr-82 is. In some of my 'research' it appears that other implementations do have a way of using the 'restricted port' range.

 

Good to know we are partners in confusion/frustration/brick wall - sigh.

 

I'm wondering if we should file it as a bug and then it might get some official response ;-)

New Member
Posts: 1
Registered: ‎11-20-2011
My Device: Bold 9700
My Carrier: 19024016593

Re: Can you connect to all L2CAP HID ports (PSMs) with jsr-82 or are some restricted?

I would like to play around with HID or see if this has been updated as of recent API updates. Any plans of sharing that sample code?