您好我在使用" CBPeripheralManager"时遇到错误这是我的代码
扩展名BLEPeripheralManager:CBPeripheralManagerDelegate {
func peripheralManagerDidUpdateState(_ peripheral: CBPeripheralManager){
print("state updated\(peripheral.state)")
switch(peripheral.state){
case CBPeripheralManagerState.poweredOn:
self.delegate?.blePeripheralManager(self, communicatorInitializationSuccessWithBluetoothState:BluetoothState.PoweredOn)
break
case CBPeripheralManagerState.poweredOff:
self.delegate?.blePeripheralManager(self, communicatorInitializationFailWithBluetoothState: BluetoothState.PoweredOff)
break
case CBPeripheralManagerState.resetting:
self.delegate?.blePeripheralManager(self, communicatorInitializationFailWithBluetoothState: BluetoothState.Resetting)
break
case CBPeripheralManagerState.unauthorized:
self.delegate?.blePeripheralManager(self, communicatorInitializationFailWithBluetoothState: BluetoothState.Unauthorized)
break
case CBPeripheralManagerState.unknown:
self.delegate?.blePeripheralManager(self, communicatorInitializationFailWithBluetoothState: BluetoothState.Unknown)
break
case CBPeripheralManagerState.unsupported:
self.delegate?.blePeripheralManager(self, communicatorInitializationFailWithBluetoothState: BluetoothState.Unsupported)
break
}
}