I am working on an App which tries to check bluetooth status of iPhone(ON/OFF) using CoreBluetooth framework.I tested app on iPhone 3GS and iPhone 4 devices to check bluetooth status,which do not support bluetooth LE hardware. Then how can i know bluetooth status on iPhone 3GS and iPhone 4 devices through Objective-C.
Asked
Active
Viewed 464 times
0
-
Take a look: http://stackoverflow.com/questions/1743610/programmatically-turn-on-bluetooth-in-the-iphone-sdk – Leo Chapiro Sep 03 '13 at 10:48
1 Answers
1
Using CoreBluetooth, you can get this information via the centralManagerDidUpdateState:
or peripheralManagerDidUpdateState:
callback, depending on which your device is acting as, a central or a peripheral.
If the device doesn't support BLE, you'll get the CBCentralManagerStateUnsupported
or CBPeripheralManagerStateUnsupported
status.
If BLE is turned off for your app, you'll get the CBCentralManagerStateUnauthorized
or CBPeripheralManagerStateUnauthorized
status.
If Bluetooth is turned off on the device, you'll get the CBPeripheralManagerStatePoweredOff
or CBCentralManagerStatePoweredOff
status.

Big-O Claire
- 956
- 8
- 13