site_archiver@lists.apple.com Delivered-To: bluetooth-dev@lists.apple.com + (void) disconnectBtGPSDevices { if (!IOBluetoothLocalDeviceAvailable()) return; On 4 May 2005, at 2:42p, bluetooth-dev-request@lists.apple.com wrote: Hi, My BT-Program crashes after I have closed a RFComm channel and even closed the deviceConnection. This is new in 10.4 and worked without any problems in 10.3 Here is the dump of the crashing BT-Thread. _______________________________________________ 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 had similar problems with a bluetooth serial device, it happens to be a GPS. The following code will close the base-band connection to the device which I found was necessary before attempting to open it again: /* look for an unclassified IOBluetoothDevice with 'GPS' or 'gps' in the name and disconnect it's baseband connection so we can re-connect right away. */ NSEnumerator* devices = [[IOBluetoothDevice pairedDevices] objectEnumerator]; id device = nil; while ( device = [devices nextObject]) { if (([device getDeviceClassMajor] == kBluetoothDeviceClassMajorUnclassified) && [device isConnected] && ([[device getName] rangeOfString:@"GPS" options:NSCaseInsensitiveSearch] .location > 0)) { NSLog(@"resetting bluetooth GPS connection: %@", [device getName]); [device closeConnection]; } } } This email sent to site_archiver@lists.apple.com
participants (1)
-
Alf Watt