dlt.getBLEDeviceServices
Introduction
Gets the service UUIDs of the device.
Parameters
Object object
Property | Type | Default | Required | Description |
---|---|---|---|---|
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 |
services | string[] | Service UUIDs |
object.fail Callback Function
Parameters
Object res
Property | Type | Description |
---|---|---|
success | string | false - Failure |
Sample Code
dlt.getBLEDeviceServices({
success(res) {
console.log('getBLEDeviceServices success', res);
},
});
In the provided sample code, the getBLEDeviceServices
function is called to retrieve the service UUIDs of the connected Bluetooth device. The success callback logs the result, which includes an array of service UUIDs.