dlt.getBLEDeviceCharacteristics
Introduction
Gets the characteristics of a device's service.
Parameters
Object object
| Property | Type | Default | Required | Description |
|---|---|---|---|---|
| serviceUUID | string | Yes | The UUID of the device's service. | |
| success | function | No | Callback function called when the interface is successfully invoked. | |
| fail | function | No | Callback function called when the interface invocation fails. | |
| complete | function | No | Callback function called when the interface invocation is complete (called whether the invocation is successful or not). |
object.success Callback Function
Parameters
Object res
| Property | Type | Description |
|---|---|---|
| success | string | true - Success |
| characteristics | string[] | Characteristics |
Explanation of Characteristics
| Property | Type | Description |
|---|---|---|
| uuid | string | UUID of the service |
| properties | string | Characteristic properties |
object.fail Callback Function
Parameters
Object res
| Property | Type | Description |
|---|---|---|
| success | string | false - 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.