Callback for IOBluetoothRFCOMMChannelCloseChannel
Callback for IOBluetoothRFCOMMChannelCloseChannel
- Subject: Callback for IOBluetoothRFCOMMChannelCloseChannel
- From: Geoffrey Schmit <email@hidden>
- Date: Wed, 8 Mar 2006 15:50:07 -0600
On Mac OS X 10.3.9, when I invoke the IOBluetoothRFCOMMChannelCloseChannel function, my event listener function is not called with the kIOBluetoothRFCOMMChannelEventTypeClosed event. The basic flow of my program is (pseudo code):
_deviceRef = IOBluetoothDeviceCreateWithAddress( &deviceAddress );
IOBluetoothDeviceOpenConnection( _deviceRef, NULL, NULL );
IOBluetoothDeviceOpenRFCOMMChannelAsync( _deviceRef, &_rfcommChannelRef, rfcommChannelID, rfcommEventListener, (void*)this )
CFRunLoopRunInMode( kCFRunLoopDefaultMode, 10 /* seconds */, false );
// returns after kIOBluetoothRFCOMMChannelEventTypeOpenComplete event is received
[ write and read here ]
IOBluetoothRFCOMMChannelCloseChannel( _rfcommChannelRef );
CFRunLoopRunInMode( kCFRunLoopDefaultMode, 10 /* seconds */, false );
// times out on 10.3.9;
// returns after kIOBluetoothRFCOMMChannelEventTypeClosed event is received on 10.4.5
IOBluetoothObjectRelease( _rfcommChannelRef );
IOBluetoothDeviceCloseConnection( _deviceRef );
IOBluetoothObjectRelease( _deviceRef );
My rfcommEventListener function is called with the kIOBluetoothRFCOMMChannelEventTypeOpenComplete message after I invoke the IOBluetoothDeviceOpenRFCOMMChannelAsync function. It is also called with the kIOBluetoothRFCOMMChannelEventTypeData event. However, it is not called with the kIOBluetoothRFCOMMChannelEventTypeClosed event after I invoke the IOBluetoothRFCOMMChannelCloseChannel function. Should it be?
The same code, when run on Mac OS X 10.4.5, does result in the rfcommEventListener function being called with the kIOBluetoothRFCOMMChannelEventTypeClosed event after I invoke the IOBluetoothRFCOMMChannelCloseChannel function.
Which is the proper behavior? Which messages should I expect when?
Thanks for any help!
geoff
--
Geoffrey Schmit
Principal Engineer
National Instruments
email@hidden
www.ni.com
_______________________________________________
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