Parameters
Success Callback Parameters
Service Object
Code Example
Related APIs
my.getBLEDeviceCharacteristics
Get service characteristics
my.connectBLEDevice
Connect to BLE device
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Get the service list of a connected BLE device.
| Property | Type | Required | Description |
|---|---|---|---|
| deviceId | String | Yes | Device identifier from discovery |
| success | Function | No | Callback on success |
| fail | Function | No | Callback on failure |
| complete | Function | No | Callback that always executes |
| Property | Type | Description |
|---|---|---|
| services | Array | List of service objects |
| Property | Type | Description |
|---|---|---|
| serviceId | String | Service UUID |
| isPrimary | Boolean | Whether this is a primary service |
my.getBLEDeviceServices({
deviceId: 'XX:XX:XX:XX:XX:XX',
success: (res) => {
console.log('Services:', res.services);
res.services.forEach((service) => {
console.log('Service UUID:', service.serviceId);
});
},
fail: (err) => {
console.error('Failed to get services:', err);
}
});