2

I'm trying to range estimote beacons in my app. But when app ranges beacons after firing [beaconManager:didRangeBeacons:inRegion:] method,it outputs "CoreBluetooth[API MISUSE] CBCentralManager can only accept commands while in the powered on state " into debug console,and also i'm not able to connect to beacon for changing some values.I can range beacons and read values which don't require connection to beacon,such as minor,major,proximity etc.,but I also need to change them.

What's my problem?

Thanks in advance!

chingi3
  • 91
  • 1
  • 10
  • The comment says it all: you should not call any APIs on the central manager before you receive the state update with the Powered On state. The [Core Bluetooth Programming Guide](https://developer.apple.com/library/ios/documentation/NetworkingInternetWeb/Conceptual/CoreBluetooth_concepts/PerformingCommonCentralRoleTasks/PerformingCommonCentralRoleTasks.html#//apple_ref/doc/uid/TP40013257-CH3-SW2) contains lots of info on how you should use the APIs. – allprog Jun 12 '14 at 14:51
  • 1
    http://stackoverflow.com/questions/23338767/ios-core-bluetooth-getting-api-misuse-warning – Larme Jun 13 '14 at 11:28
  • Hi there, We're still investigating the bug at Estimote. As for connecting to the beacons, please elaborate. Are you logged in to your Estimote Account when you try to access them, and are the beacons properly assigned to the account? – Wojtek Borowicz Jul 10 '14 at 15:46
  • I've created a tool to help debug the API Misuse errors: https://github.com/nrbrook/NBCoreBluetoothAPIMisuseGuard – Nick May 03 '16 at 16:30

1 Answers1

0

I ran into the same problem. I suspect this is a bug with Estimote SDK. I managed to work around this by calling the startEstimoteBeaconsDiscoveryForRegion method (which I believe goes on to turn on CBCentralManager). My initialisation code is as follows:

_estBeaconManager = [[ESTBeaconManager alloc] init];
_estBeaconManager.delegate = self;
_estBeaconRegion = [[ESTBeaconRegion alloc] initWithProximityUUID:ESTIMOTE_PROXIMITY_UUID identifier:@"Estimotes"];
[_estBeaconManager startRangingBeaconsInRegion:_estBeaconRegion];
[_estBeaconManager startEstimoteBeaconsDiscoveryForRegion:_estBeaconRegion];

Hope this helps

Ege Akpinar
  • 3,141
  • 20
  • 28