Help with IOBluetoothDeviceInquiry callbacks
site_archiver@lists.apple.com Delivered-To: bluetooth-dev@lists.apple.com Hello, Any help or suggestions would very much be appreciated. Thank you very much, Steven Loeppky _______________________________________________ Do not post admin requests to the list. They will be ignored. Bluetooth-dev mailing list (Bluetooth-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/bluetooth-dev/site_archiver%40lists.a... I am a computer engineering student at the University of Washington developing an application to communicate with a custom bluetooth device. I am also brand new to Carbon but am familiar with C. Right now I'm just trying to use the IOBluetoothUserLib.h to inquire which Bluetooth devices are out there. I'm attempting this using the IOBluetoothDeviceInquiry functions. The part I'm getting tripped up on is the call back functions. For example, I use the IOBluetoothDeviceInquirySetStartedCallback to register a callback function for when the device inquiry actually starts. From my understanding, this tells the OS which function to call when the device inquiry starts. I'm confused because this doesn't appear to be the usual way of registering an event handler with the Carbon Event Manager. Is this even registering an event handler with the Carbon Event Manger? I'm confused about what is going on. Here is some sample code that all compiles, but the callback function never gets called. I don't know if I should be calling RunApplicationEventLoop or not. If I shouldn't, what should I do? void callback (void *userRefCon, IOBluetoothDeviceInquiryRef inquiryRef) { printf("IOBluetoothDeviceInquirySetStartedCallback Worked!\n"); return; } int main (int argc, const char * argv[]) { IOBluetoothDeviceInquiryRef inInquiryRef; inInquiryRef = IOBluetoothDeviceInquiryCreateWithCallbackRefCon (NULL); IOBluetoothDeviceInquirySetStartedCallback(inInquiryRef, callback); RunApplicationEventLoop(); return 0; } This email sent to site_archiver@lists.apple.com
participants (1)
-
Steven Loeppky