Re: IOBluetoothRFCOMMChannel and NSThread
Re: IOBluetoothRFCOMMChannel and NSThread
- Subject: Re: IOBluetoothRFCOMMChannel and NSThread
- From: Marco Pontil <email@hidden>
- Date: Mon, 3 May 2004 10:05:55 -0700
Hello Yann,
The problem is that the Bluetooth Stack is not designed to run on
multiple threads. The first thread that makes a call in the stack is
also the only thread that will receive events (and new data is an
event) from the stack.
Since your problem seems to be the connection blocking I would suggest
to use the asyncronous API to open the connection. In this way the
caller will not block and once the open connection is completed will be
notified of the results (success or failure).
... Marco
On May 2, 2004, at 2:04 AM, Yann Bizeul wrote:
Hello List,
I used to open a RFCOMM channel without using threads with no
problems. But this is blocking sometimes when the device is not
reachable.
So I wanted to open the connection in a Thread. The problem is that I
do no longer receive any data from the device, I set the delete of
IOBluetoothRFCOMMChannel to self, but my
- (void)rfcommChannelData:(IOBluetoothRFCOMMChannel*)rfcommChannel
data:(void *)dataPointer length:(size_t)dataLength;
Is never called.
Can somebody explain why using thread could change something ?
Thanks
--
Yann Bizeul - yann at tynsoe.org
http://projects.tynsoe.org/
[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.
_______________________________________________
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.