Handling loss of baseband correctly
site_archiver@lists.apple.com Delivered-To: bluetooth-dev@lists.apple.com Hi. Thanks, Nigel Spon _______________________________________________ Do not post admin requests to the list. They will be ignored. Bluetooth-dev mailing list (Bluetooth-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/bluetooth-dev/site_archiver%40lists.a... I'm trying to correctly handle what happens when my device, which has an RFCOMM channel open, goes out of range. All my Bluetooth I/O is being done in a seperate thread with a CFRunLoop, and I duly get a kIOBluetoothRFCOMMChannelEventTypeClosed event. I release the channel with IOBluetoothObjectRelease, and on later callbacks triggered from my main thread, I try calling IOBluetoothDeviceOpenConnection, on the grounds that the baseband connection has gone away. If the device is still out of range, the IOReturn from this is 4, which doesn't correspond to any error code I can find. When the device comes back into range, IOBluetoothDeviceOpenConnection does return 0, which is fine, but then things go pear-shaped when I try calling IOBluetoothDeviceOpenRFCOMMChannelSync to get my channel back. The BT stack hangs inside that call and I have to restart the machine to kill it. This is under 10.4.10 on a 2GHz aluminium iMac. Does anyone know what I have missed doing here? --- "Quick! Burn the books. Tear up those revolting postcards. Chase those women out of my room. Take all those "For Sale" signs off the furniture and help me get the floor back under this carpet." This email sent to site_archiver@lists.apple.com
participants (1)
-
Nigel Spon