func centralManagerDidUpdateState(central: CBCentralManager) {
switch (central.state)
{
case .PoweredOff:
print("off")
case .PoweredOn:
centralManager.scanForPeripheralsWithServices(nil, options: nil)
case .Resetting:
print("resetting")
case .Unauthorized:
print("unaithorized")
case .Unsupported:
print("unsupported")
case .Unknown:
print("unknown")
}
}
此代码仅检查蓝牙的状态,无法打开,我想以任何方式打开蓝牙