Re: Bluetooth Foundation Tool
Re: Bluetooth Foundation Tool
- Subject: Re: Bluetooth Foundation Tool
- From: Joseph Kelly <email@hidden>
- Date: Mon, 8 Oct 2007 08:52:41 -0700
On Oct 8, 2007, at 1:13 AM, Hugo Veiga wrote: I'm more acquainted with what i must do now, i thought at one time, i read somewhere that NSRunLoop was specific for Cocoa Apps and that CFRunLoop was specific for Foundation Tools.
From my understanding, NSRunLoop is an objective-C/Cocoa wrapper around CFRunLoop. I've used the two apis interchangeably in the past (e.g. the NS wrapper has a method to fetch the CF run loop). Now, the one thing i don't understand is, how do i connect bluetooth as source or observer of the RunLoop? Is this nonsense? Or i just need to set a delegate for the inquiry and other stuff that automatically intercepts it?
Yes, usually setting a delegate for async data IO or notifications in the bluetooth classes will add runloop sources automatically. IIRC, a downside to not being able to specify the runloop is that the api will put the various sources on the main thread's run loop, which renders the bluetooth frameworks thread unsafe [?].
I'm used to C#, Java and C++, where there's nothing as NSRunLoop so i'm not familiar with what it does, and how.
Runloops are good. They are simply an abstraction of what all modern app frameworks do, which is, instead of polling for events, just sets a bunch of sources for a particular thread's run loop, and then blocks until one of those sources triggers at which point your callback is invoked by the OS.
Thank you once again, Hugo
|
_______________________________________________
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