Re: how to map run loop input sources to specific hardware?
The Bluetooth run loop event sources are automatically added to the run loop for your app (in reality, the one that belongs to the thread that you made the first Bluetooth call on). Once you are done with your initialization code, just call either [[NSRunLoop currentRunLoop] run] or CFRunLoopRun() from your main() function. Either will allow the event sources for the Bluetooth stack to run and receive the incoming data you are interested in. On May 11, 2004, at 7:44 AM, luc bergevin wrote:
hi everybody,
I'm quite new to mac programming, and I don't understand how run loops
work.
After a Bluetooth client established a connection to a server, it
sends data. Then the client has to wait for an answer from the server
to the callback
( - (void)rfcommChannelData:(IOBluetoothRFCOMMChannel*)rfcommChannel
data:(void *)dataPointer length:(size_t)dataLength ).
I tried to wait with a NSConditionLock, but it seems to block
completely the thread. I saw in the archives that I should use a "run
loop"??? But I see in the ADC documentation that the NSRunLoop has to
have input sources. How can I define an input source that specifically
map on the Bluetooth hardware, so the loop knows what to wait for?
Do I need to manually add the input source, or do the delegate methods
already did that automatically?
Can anybody tell me how to make the run loop works?
Thanks.
luc.
_______________________________________________
bluetooth-dev mailing list | bluetooth-dev@lists.apple.com
Help/Unsubscribe/Archives:
Do not post admin requests to the list. They will be ignored.
[demime 0.98b removed an attachment of type application/pkcs7-signature which had a name of smime.p7s] _______________________________________________ bluetooth-dev mailing list | bluetooth-dev@lists.apple.com Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/bluetooth-dev Do not post admin requests to the list. They will be ignored.
participants (1)
-
Eric Brown