Re: Using CoreBluetooth from Command Line Tool
Not sure, but dispatch_main() might not be enough. You might have to actually run the runloop with CFRunLoopRun or something similar. I know that works because I've written a CoreBluetooth command line tool and it works fine. Dave On Apr 4, 2013, at 1:40 PM, dave-ble@greylogic.com wrote:
Hi,
I'm trying to write a simple command line app that uses CoreBluetooth on an BLE capable mac book (OSX v10.8.3).
If I use the retrievePeripherals I get the delegate didRetrievePeripherals to fire. If I then try to connect to the found peripheral, the didConnectPeripheral delegate never fires.
However, if I scan for peripherals and get the delegate didDiscoverPeripheral to fire. I can then connect and connect succeeds. However, once I'm connected and have my characteristics, the data I receive from my peripheral is not reliably received.
Using similar code in a GUI application works perfect.
Has anyone else been successful running the CoreBluetooth stack from within a command line app?
In my main I essentially create a dispatch_queue and let it run my operations via dispatch_async. Meanwhile, I let main just call dispatch_main().
-- dave _______________________________________________ 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: https://lists.apple.com/mailman/options/bluetooth-dev/dave%40thinbits.com
This email sent to dave@thinbits.com
_______________________________________________ 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: https://lists.apple.com/mailman/options/bluetooth-dev/site_archiver%40lists.... This email sent to site_archiver@lists.apple.com
participants (1)
-
Dave Camp