rdar://23374935
Bluetooth LE devices are never detected by a CBCentralManager when scanning for all devices.
- Clone and run a Bluetooth LE peripheral, e.g.
git clone [email protected]:sandeepmistry/osx-ble-peripheral.git
- Clone this example on an Apple TV:
git clone [email protected]:bdotdub/CBExample.git
- Run the example on a tvOS device
The CBCentralManagerDelegate discovery functions called with Bluetooth LE peripherals nearby
None of the CBCentralManagerDelegate functions are called
tvOS 9.0
Apple TV
I believe that you are calling the centralManager too soon in the referenced example project. You must wait until the centralManager calls the delegate method centralManagerDidUpdateState() with a state parameter of .PoweredOn or higher before calling methods on the centralManager.
When I moved the call to scanForPerihperalsWithServices() into the .PoweredOn case in ..didUpdateState() then nearby peripherals were discovered as expected.