Re: Bluetooth-dev Digest, Vol 2, Issue 31
Re: Bluetooth-dev Digest, Vol 2, Issue 31
- Subject: Re: Bluetooth-dev Digest, Vol 2, Issue 31
- From: Alf Watt <email@hidden>
- Date: Fri, 6 May 2005 07:31:34 -0700
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:
+ (void) disconnectBtGPSDevices
{
if (!IOBluetoothLocalDeviceAvailable())
return;
/* 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];
}
}
}
On 4 May 2005, at 2:42p, email@hidden 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 (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden