Re: IOBluetoothRFCOMMChannel and NSThread
Re: IOBluetoothRFCOMMChannel and NSThread
- Subject: Re: IOBluetoothRFCOMMChannel and NSThread
- From: Eric Brown <email@hidden>
- Date: Mon, 3 May 2004 14:08:27 -0700
On May 3, 2004, at 1:42 PM, Yann Bizeul wrote:
>
Thanks for the answer.
>
>
In fact I started to establish a thread responsible of all bluetooth=20
>
stuffs. Worked not so bad but it seem some bluetooth operations
>
stick=20
>
other ones.
>
For example, while I'm trying to connect every 10s to a device, If I=20
>
try to get pairedDevices to display preferences, this method returns=20
>
nothing.
>
>
Is there a rule for those stuffs ? I'm doing all bluetooth calls in
>
the=20=
>
>
same thread.
>
>
Right now I'm trying to use IOBluetoothUI to get a device in the
>
prefs,=20=
>
>
but the windowController stays white, hangs the app, and display=20
>
nothing.
>
>
Is there a difference between using AppKit thread or a custom one ?
>
>
Any idea ?
>
>
Thank you !
>
>
There are really two issues with threads and the Bluetooth frameworks:
1 - The Bluetooth libraries are not thread safe, so all calls must
come from the same thread. Because of the asynchronous nature of some
of the APIs and internal mechanisms, the first thread to call into the
frameworks must run a run loop and will be the one that all
asynchronous callbacks are delivered on. As a consequence, it is the
only one that should be making calls into the Bluetooth APIs.
2 - The UI functions are based on AppKit. All UI calls must be done
on the main thread. As a result, all other Bluetooth calls in a
Bluetooth UI application must be made on the main thread.
- Eric
[demime 0.98b removed an attachment of type application/pkcs7-signature which had a name of smime.p7s]
_______________________________________________
bluetooth-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/bluetooth-dev
Do not post admin requests to the list. They will be ignored.