取消订阅 Bluetooth® Low Energy 特性通知或指示。
用法
bleCharacteristic.unsubscribe()
参数
None
返回
- true, 成功时,
- false失败时
示例
// ...
// retrieve the simple key characteristic
BLECharacteristic simpleKeyCharacteristic = peripheral.characteristic("ffe1");
// subscribe to the simple key characteristic
Serial.println("Subscribing to simple key characteristic ...");
if (!simpleKeyCharacteristic) {
Serial.println("no simple key characteristic found!");
peripheral.disconnect();
return;
} else if (!simpleKeyCharacteristic.canSubscribe()) {
Serial.println("simple key characteristic is not subscribable!");
peripheral.disconnect();
return;
} else if (!simpleKeyCharacteristic.subscribe()) {
Serial.println("subscription failed!");
peripheral.disconnect();
return;
}
// ...
simpleKeyCharacteristic.unsubscribe();
相关用法
- Arduino ArduinoBLE - bleCharacteristic.uuid()用法及代码示例
- Arduino ArduinoBLE - bleCharacteristic.subscribe()用法及代码示例
- Arduino ArduinoBLE - bleCharacteristic.hasDescriptor()用法及代码示例
- Arduino ArduinoBLE - bleCharacteristic.canRead()用法及代码示例
- Arduino ArduinoBLE - bleCharacteristic.addDescriptor()用法及代码示例
- Arduino ArduinoBLE - bleCharacteristic.broadcast()用法及代码示例
- Arduino ArduinoBLE - bleCharacteristic.properties()用法及代码示例
- Arduino ArduinoBLE - bleCharacteristic.written()用法及代码示例
- Arduino ArduinoBLE - bleCharacteristic.canSubscribe()用法及代码示例
- Arduino ArduinoBLE - bleCharacteristic.subscribed()用法及代码示例
- Arduino ArduinoBLE - bleCharacteristic.valueLength()用法及代码示例
- Arduino ArduinoBLE - bleCharacteristic.canUnsubscribe()用法及代码示例
- Arduino ArduinoBLE - bleCharacteristic.readValue()用法及代码示例
- Arduino ArduinoBLE - bleCharacteristic.setEventHandler()用法及代码示例
- Arduino ArduinoBLE - bleCharacteristic.value()用法及代码示例
- Arduino ArduinoBLE - bleCharacteristic.valueUpdated()用法及代码示例
- Arduino ArduinoBLE - bleCharacteristic.canWrite()用法及代码示例
- Arduino ArduinoBLE - bleCharacteristic.descriptor()用法及代码示例
- Arduino ArduinoBLE - bleCharacteristic.descriptorCount()用法及代码示例
- Arduino ArduinoBLE - bleCharacteristic.writeValue()用法及代码示例
- Arduino ArduinoBLE - bleCharacteristic.valueSize()用法及代码示例
- Arduino ArduinoBLE - bleDevice.advertisedServiceUuidCount()用法及代码示例
- Arduino ArduinoBLE - bleService.uuid()用法及代码示例
- Arduino ArduinoBLE - bleDescriptor.read()用法及代码示例
- Arduino ArduinoBLE - bleDevice.hasCharacteristic()用法及代码示例
注:本文由纯净天空筛选整理自arduino.cc大神的英文原创作品 ArduinoBLE - bleCharacteristic.unsubscribe()。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。