How to discover RFCOMM channel number for one bluetooth device?

821 views
Skip to first unread message

dw

unread,
Jul 7, 2011, 10:49:14 AM7/7/11
to btstack-dev
If i know the bt mac address of one bluetooth device, and I know it
support RFCOMM with one serial profile, how could I discover the
device RFCOMM channel? I have to try from 1 - 31.
Any suggestion?

Matthias Ringwald

unread,
Jul 12, 2011, 5:15:41 PM7/12/11
to btstack-dev
Hi dw,

the easiest one for a particular device would be to run the sdp browse tool in linux, or just pair it to the Mac and check Bluetooth Explorer or record the pairing process with the PacketLogger tool. It (mostly) good job of deciphering the Bluetooth data packets (like show you the RFCOMM channel in the response to the SDP request)

If you need to do it programmatically, here's a binary blob to ask for SPP profile and retrieve attributes 1-4. 

uint8_t sdpQuerySPP[] =

{

    0x06, 0x00, 0x06, 0x00, 0x0F, 0x35, 0x03, 0x19,

    0x11, 0x05, 0xFF, 0xFF, 0x35, 0x05, 0x0A, 0x00, 0x01, 0x00, 0x04, 0x00

};


Matthias Ringwald

Sent with Replies
http://repliesapp.com


--
You received this message because you are subscribed to the Google Groups "btstack-dev" group.
To post to this group, send email to btsta...@googlegroups.com.
To unsubscribe from this group, send email to btstack-dev...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/btstack-dev?hl=en.

Reply all
Reply to author
Forward
0 new messages