my.readBLECharacteristicValue or when a characteristic with notify or indicate enabled pushes a new value.
Parameters
| Property | Type | Required | Description |
|---|---|---|---|
| callback | Function | Yes | Callback when a characteristic value changes |
Callback Parameters
| Property | Type | Description |
|---|---|---|
| deviceId | String | Device identifier |
| serviceId | String | Service UUID |
| characteristicId | String | Characteristic UUID |
| value | ArrayBuffer | The new characteristic value |
Code Example
Basic Usage
Read and Handle Value
Notify-Based Updates
The value is delivered as an
ArrayBuffer. Use DataView or Uint8Array to interpret the bytes according to the characteristic’s GATT profile.Related APIs
my.offBLECharacteristicValueChange
Stop listening for value changes
my.readBLECharacteristicValue
Trigger a read on a characteristic
my.getBLEDeviceCharacteristics
Get device characteristics