创建一个新的 Bluetooth® Low Energy 特性。
用法
BLECharacteristic(uuid, properties, value, valueSize)
BLECharacteristic(uuid, properties, stringValue)
BLEBoolCharacteristic(uuid, properties)
BLEBooleanCharacteristic(uuid, properties)
BLECharCharacteristic(uuid, properties)
BLEUnsignedCharCharacteristic(uuid, properties)
BLEByteCharacteristic(uuid, properties)
BLEShortCharacteristic(uuid, properties)
BLEUnsignedShortCharacteristic(uuid, properties)
BLEWordCharacteristic(uuid, properties)
BLEIntCharacteristic(uuid, properties)
BLEUnsignedIntCharacteristic(uuid, properties)
BLELongCharacteristic(uuid, properties)
BLEUnsignedLongCharacteristic(uuid, properties)
BLEFloatCharacteristic(uuid, properties)
BLEDoubleCharacteristic(uuid, properties)
参数
- uuid: 16 位或 128 位 UUID String 格式
- properties: 属性掩码 (BLEBroadcast, BLERead, BLEWriteWithoutResponse, BLEWrite, BLENotify, BLEIndicate)
- valueSize:(最大)特征值的大小
- stringValue: 作为字符串的值
返回
- 新的BLE特点与指定UUID和值
示例
// Bluetooth® Low Energy Battery Level Characteristic
BLEUnsignedCharCharacteristic batteryLevelChar("2A19", // standard 16-bit characteristic UUID
BLERead | BLENotify); // remote clients will be able to get notifications if this characteristic changes
相关用法
- Arduino ArduinoBLE - BLEService()用法及代码示例
- Arduino ArduinoBLE - BLE.poll()用法及代码示例
- Arduino ArduinoBLE - BLEDescriptor()用法及代码示例
- Arduino ArduinoBLE - BLE.advertise()用法及代码示例
- Arduino ArduinoBLE - BLE.setEventHandler()用法及代码示例
- Arduino ArduinoBLE - BLE.disconnect()用法及代码示例
- Arduino ArduinoBLE - BLE.end()用法及代码示例
- Arduino ArduinoBLE - BLE.scan()用法及代码示例
- Arduino ArduinoBLE - BLE.setAdvertisingInterval()用法及代码示例
- Arduino ArduinoBLE - BLE.setLocalName()用法及代码示例
- Arduino ArduinoBLE - BLE.setConnectionInterval()用法及代码示例
- Arduino ArduinoBLE - BLE.addService()用法及代码示例
- Arduino ArduinoBLE - BLE.stopAdvertise()用法及代码示例
- Arduino ArduinoBLE - BLE.rssi()用法及代码示例
- Arduino ArduinoBLE - BLE.setAdvertisedService()用法及代码示例
- Arduino ArduinoBLE - BLE.stopScan()用法及代码示例
- Arduino ArduinoBLE - BLE.setAdvertisedServiceUuid()用法及代码示例
- Arduino ArduinoBLE - BLE.setAppearance()用法及代码示例
- Arduino ArduinoBLE - BLE.setConnectable()用法及代码示例
- Arduino ArduinoBLE - BLE.setManufacturerData()用法及代码示例
- Arduino ArduinoBLE - BLE.begin()用法及代码示例
- Arduino ArduinoBLE - BLE.scanForUuid()用法及代码示例
- Arduino ArduinoBLE - BLE.available()用法及代码示例
- Arduino ArduinoBLE - BLE.connected()用法及代码示例
- Arduino ArduinoBLE - BLE.scanForAddress()用法及代码示例
注:本文由纯净天空筛选整理自arduino.cc大神的英文原创作品 ArduinoBLE - BLECharacteristic()。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。