Handling loss of baseband correctly
Handling loss of baseband correctly
- Subject: Handling loss of baseband correctly
- From: Nigel Spon <email@hidden>
- Date: Wed, 24 Oct 2007 11:46:45 +1300
Hi.
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?
Thanks,
---
"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."
Nigel Spon
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Bluetooth-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden