Help with IOBluetoothDeviceInquiry callbacks
Help with IOBluetoothDeviceInquiry callbacks
- Subject: Help with IOBluetoothDeviceInquiry callbacks
- From: Steven Loeppky <email@hidden>
- Date: Wed, 25 May 2005 15:24:26 -0700
Hello,
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;
}
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 (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden