site_archiver(a)lists.apple.com
Delivered-To: bluetooth-dev(a)lists.apple.com
+ (void) disconnectBtGPSDevices
{
if (!IOBluetoothLocalDeviceAvailable())
return;
On 4 May 2005, at 2:42p, bluetooth-dev-request(a)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(a)lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/bluetooth-dev/site_archiver%40lists.…
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(a)lists.apple.com
site_archiver(a)lists.apple.com
Delivered-To: bluetooth-dev(a)lists.apple.com
Hi List members,
Another question:
Thanks for any help
Moritz
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Bluetooth-dev mailing list (Bluetooth-dev(a)lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/bluetooth-dev/site_archiver%40lists.…
(I was able to fix my last problem by removing the delegate before
closing the channel)
My Bluetooth-Library supports multiple threads. All bluetooth stuff
is handled in one thread just as Apple requires me to do.
The Bluetooth-Thread consists of a while() loop that looks for
commands that the other threads post on that thread (opening
connections, closing connections, doing inquiries......). When all
commands are handled I call [[NSRunLoop currentRunLoop]
runUntilDate:dat2]; where dat2 is 0.1 seconds after now. Then it
looks for new commands and so on.
Is there a way to interrupt this [NSRunLoop runUntilDate:xxx] call so
my other threads don't have to wait ?
Interrupt the RunLoop somehow from another thread ?
This email sent to site_archiver(a)lists.apple.com