l2cap server/client using IOBluetooth (osx bluetooth stack)
Asked Answered
F

1

8

I'm having trouble understanding the API to set up a l2cap (or RFCOMM) client/server running on OSX like I can with BlueZ on Linux.

On Linux, I simply open a socket, bind, listen & then accept for the server, & socket, bind, connect for the client (w/ the bind taking in the BT address of the device I want to use). Also, there's no pairing done.

I can't figure out how to configure my application to start listening for connections on a particular device (or if OSX only supports 1 BT adapater at a time, then how to listen for any incoming connections).

I also can't figure out how to configure my application to send to one BT device using a particular device (this is irrelevant if OSX only supports 1 at a time).

Also, does the OSX stack require pairing to have occured between 2 devices before it'll pass through l2cap?

Any language examples would be appreciated, although C/C++ would be preferred.

Thanks

Falconet answered 17/10, 2009 at 6:25 Comment(0)
S
1

In Mac OS X 10.5 there's an example (in /Developer/Examples/Bluetooth, titled RFCOMM_Open_SPP_Example) that shows connecting to and reading data from a bluetooth device (i've used it to read NMEA lines from a BT GPS receiver). See also: Leopard & Bluetooth RFCOMM channels

Unfortunately I can't find a copy of the example project anywhere.

It looks like the code samples have been replaced with: Developing Bluetooth Applications

Selfpossession answered 20/10, 2009 at 10:9 Comment(1)
Thanks - I found it on my own and forgot to answer. There's a PDF for JSR-82 (Bluetooth for Java) describing what the values should be for the L2CAP server plist. Also, OSX's bluetooth stack only supports 1 bluetooth adapter at a time.Falconet

© 2022 - 2024 — McMap. All rights reserved.