• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Help with IOBluetoothDeviceInquiry callbacks
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Prev by Date: Re: Tiger & Bluetooth Serial Utility
  • Next by Date: Re: Tiger & Bluetooth Serial Utility
  • Previous by thread: Re: Tiger & Bluetooth Serial Utility
  • Next by thread: OBEX question
  • Index(es):
    • Date
    • Thread