Configuration
The Device object lets you adjust settings and issue commands.
Sending commands
# Accepts str or bytes; str will be UTF-8 encoded and null-terminated automatically.
await device.send("ping") # optional process_id defaults to 0// String overload auto-appends null; add it yourself only when sending raw bytes.
device.send("ping", processId = 0)device.send("ping", processId: 0)device.send("ping", 0); // pass Uint8List only if you need raw bytessend gives a direct line to the device (e.g., LED brightness, sampling rate tweaks). It accepts raw bytes and an optional processId (default 0). For text commands, send UTF-8 bytes with a trailing null. Do not send commands while synchronization is running to avoid conflicts.
processId picks the device-side process that should handle the payload; the transport echoes it in payload callbacks so you can correlate responses (e.g., didReceivePayload / did_receive_payload). For shell commands listed below, use processId = 0 (default). The SDK uses specific IDs internally for its own APIs (collect, sync, log, etc.).
Where responses arrive
Shell responses (e.g., Pong, log lines) come via the payload callback on your delegate:
def did_receive_payload(self, device, process: str, payload: bytes): ...fun didReceivePayload(device: Device, process: String, payload: ByteArray)func didReceivePayload(_ device: Device, process: String, payload: Data)void didReceivePayload(Device device, String process, Uint8List payload)void didReceivePayload(IAidlab aidlab, string process, byte[] payload)processId is numeric when you call send; the callback exposes process as a string label coming from the device firmware. Map them in your code if you need to correlate a request to a response.
Shell commands reference
When using send with processId = 0, the device accepts these text commands:
| Command | Description | Example |
|---|---|---|
ping | Checks connection; response Pong. | ping |
set date | Sets internal RTC date (DD:MM:YYYY). | set date 24:12:2024 |
set time | Sets internal RTC time (HH:mm:ss). | set time 14:30:00 |
set led_brght | Sets LED brightness (1–16). | set led_brght 10 |
set ecg_debug | Toggles ECG debug mode (0/1). | set ecg_debug 1 |
set ecg_fs | Sets ECG sampling rate (250/500/1000). Changing may break compatibility with Aidlab/Aidmed apps. | set ecg_fs 500 |
memtest | Runs flash memory test. | memtest |
log | Streams real-time status log. | log |
sync start/stop/count/clear | Manages flash sync. | sync start |
dump start/stop/clear | Sends or clears logs stored in flash. | dump start |
Avoid sending commands while a sync is running to prevent conflicts.