Members
(readonly) isDiscovered :boolean
是否已经被发现
(readonly) isValueLoaded :boolean
数值是否已经加载, 为 true 时,本类才能读到正确的 value
(readonly) UUID :string
特征值的 UUID
(readonly) value :*
数值, 配合 isValueLoaded 使用
Example
...
if(charateristic.isValueLoaded){
const val = characteristic.value;
...
}
...
Methods
read() → {Promise.<IBluetoothCharacteristic>}
读取蓝牙数据
setNotify(flag) → {Promise.<IBluetoothCharacteristic>}
设置数值变化监听开关
Parameters:
Name | Type | Description |
---|---|---|
flag |
boolean | true 打开监听, false 则关闭监听 |
write(value) → {Promise.<IBluetoothCharacteristic>}
写数据 对应 writeWithResponse
Parameters:
Name | Type | Description |
---|---|---|
value |
* | hexstring |
writeWithoutResponse(value) → {Promise.<IBluetoothCharacteristic>}
直接写数据 对应 writeWithoutResponse
Parameters:
Name | Type | Description |
---|---|---|
value |
* |