I am attempting to scan for a bluetooth device using the CoreBluetooth framework. The device is a prototype provided by a client.
I believe my implementation of the CBCentralManagerDelegate
is correct, but I am never receiving the centralManager: didDiscoverPeripheral: advertisementData: RSSI:
callback. Even if I register for nil
service UUIDs, which should fire discovery callbacks for all devices, nothing happens.
I would consider whether the bluetooth device might be defective, except here's the wrinkle... when I fire up the Bluetooth debugging application LightBlue on my iPad, the prototype device is listed, along with some services. In fact, as soon as I use that app's 'clone' feature to reproduce the service from the iPad directly, my delegate callback fires.
I can post some sample code but it really is boiler plate stuff (I believe). Bluetooth experts: are there any obvious causes for the behavior I am experiencing?
Some points to check: make sure you have set the delegate of your CCBCentralManager correctly. If your device is bonded to iOS device I suppose didDiscoverPeripheral
should not be fired, but in this case LightBlue app would not show any service at "Scanning for peripherals..." screen.
Good luck
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.