Using IOBluetoothDeviceInquiry Functions, waiting for result
site_archiver@lists.apple.com Delivered-To: bluetooth-dev@lists.apple.com Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=RhY9Ykt/jMv2HH6TvViirkS5RJR/m/SV9Ox7X1gduMhFWVlQP0fIYmwiXfRPuwuuR8NCBvXbMog9mJRQckYD639t8471OHXWWJ0DKInStBOUPcaV4tcpOIaiZIVZJRY6W+gOc5OQrS67AQWsh+5xRGBd5jBigDMhUBsye5XMviQ= Hi Members, I want to develop some command line based bluetooth applications using C and IOBluetooth.framework. I want to use functions from IOBluetoothUtilities.h, I succeeded at using functions, which return value directly after calling, but I can't get to work for example IOBluetoothDeviceInquiryGetFoundDevices(..), which I think is running in different thread for several seconds. I tried using CFRunLoopRuInMode and registring callback for IOBluetoothDeviceInquiryGetFoundDevices(..) but it is never called during the loop. What should be used instead CFRunLoop? or where is the mistake? Can someone help? Thanks for answers. void callback2(void *userRefCon,IOBluetoothDeviceInquiryRef inquiryRef, IOBluetoothDeviceRef deviceRef) { printf("callback\n"); } .... IOBluetoothDeviceInquiryRef inInquiry; inInquiry = IOBluetoothDeviceInquiryCreateWithCallbackRefCon(NULL); IOBluetoothDeviceInquirySetDeviceFoundCallback(inInquiry, callback2); IOBluetoothDeviceInquiryGetFoundDevices(inInquiry); CFRunLoopRunInMode(kCFRunLoopDefaultMode,50,true); .... _______________________________________________ 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... This email sent to site_archiver@lists.apple.com
participants (1)
-
Martin Elich