HomeDocs
Skip to main content

dlt.onBLECharacteristicValueChange(function listener)

Introduction​

Add a listener for characteristic value changes.

Usage Limitations​

You must register this listener before calling dlt.notifyBLECharacteristicValueChange.

Parameters​

function listener​

The listener function for the Bluetooth adapter state change event.

Parameters​

Object res​

PropertyTypeDescription
serviceUUIDstringService UUID
characteristicUUIDstringCharacteristic UUID
valuestringCharacteristic value

Sample Code​

dlt.onBLECharacteristicValueChange(function (res) {
console.log(res);
});

In the sample code provided, dlt.onBLECharacteristicValueChange is used to add a listener for characteristic value changes. When the characteristic value changes, the provided listener function is called, and it logs the received data to the console.

Privacy agreementDeveloper agreementcontact us: developer_private.mi@dlightek.com © 2024 MiniApp. All Rights Reserved.