HomeDocs
Skip to main content

dlt.getBLEDeviceCharacteristics

Introduction​

Gets the characteristics of a device's service.

Parameters​

Object object​

PropertyTypeDefaultRequiredDescription
serviceUUIDstringYesThe UUID of the device's service.
successfunctionNoCallback function called when the interface is successfully invoked.
failfunctionNoCallback function called when the interface invocation fails.
completefunctionNoCallback function called when the interface invocation is complete (called whether the invocation is successful or not).

object.success Callback Function​

Parameters​

Object res​

PropertyTypeDescription
successstringtrue - Success
characteristicsstring[]Characteristics

Explanation of Characteristics​

PropertyTypeDescription
uuidstringUUID of the service
propertiesstringCharacteristic properties

object.fail Callback Function​

Parameters​

Object res​

PropertyTypeDescription
successstringfalse - Failure

Sample Code​

dlt.getBLEDeviceCharacteristics({
serviceUUID: 'xxx',
success(res) {
console.log(res);
},
});

In the provided sample code, the getBLEDeviceCharacteristics function is called to retrieve the characteristics of a device's service with the specified serviceUUID. The success callback logs the result, which includes the characteristics' UUIDs and properties. Replace 'xxx' with the actual service UUID of the Bluetooth device you are working with.

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