Configuration
In addition to selecting collected signals, you can configure the device after connecting.
Available settings
| Setting | Command | Accepted values |
|---|---|---|
| LED brightness | set led_brght <value> | 1–16 |
| ECG sampling frequency | set ecg_fs <value> | 250, 500, or 1000 Hz |
Changing the ECG sampling frequency may break compatibility with official apps.
Sending a configuration command
Send the command through send(...) using the default processId of 0.
python
# Set LED brightness to 10.
command = "set led_brght 10"
# To set the ECG sampling frequency to 500 Hz instead:
# command = "set ecg_fs 500"
await device.send(command)kotlin
// Set LED brightness to 10.
val command = "set led_brght 10"
// To set the ECG sampling frequency to 500 Hz instead:
// val command = "set ecg_fs 500"
val payload = "$command\u0000".toByteArray(Charsets.UTF_8)
device.send(payload, processId = 0)swift
// Set LED brightness to 10.
let command = "set led_brght 10"
// To set the ECG sampling frequency to 500 Hz instead:
// let command = "set ecg_fs 500"
let payload: [UInt8] = Array("\(command)\0".utf8)
device.send(payload, processId: 0)dart
import 'dart:convert';
import 'dart:typed_data';
// Set LED brightness to 10.
const command = 'set led_brght 10';
// To set the ECG sampling frequency to 500 Hz instead:
// const command = 'set ecg_fs 500';
final payload = Uint8List.fromList([...utf8.encode(command), 0]);
await device.send(payload, processId: 0);csharp
using UnityEngine;
public class ConfigureAidlab : MonoBehaviour {
private Aidlab.AidlabSDK sdk;
void Start() {
Aidlab.AidlabSDK.init();
sdk = FindObjectOfType<Aidlab.AidlabSDK>();
if (sdk == null) {
return;
}
sdk.Connected += Configure;
if (sdk.IsSdkInitialized) {
Configure();
}
}
void Configure() {
// Set LED brightness to 10.
sdk.SendCommand("set led_brght 10");
// To set the ECG sampling frequency to 500 Hz instead:
// sdk.SendCommand("set ecg_fs 500");
}
}Python strings and Unity's SendCommand(...) are null-terminated automatically. On Android, Apple platforms, and Flutter, encode the command as UTF-8 and append a null byte as shown above.