1. Connection, Telemetry & Hardware Self-Test
Connect via BLE NUS, calibrate the device RTC (SYNC_TIME), inspect firmware versions (BASE_INFO), battery (BATTERY), SD storage (STORAGE), and run the 11-module diagnostic (TEST_CHECK).
ReAI Recording Card SDK Documentation › Connection & Device Telemetry
SDK v0.0.9 (MIT)BLE 5 NUSMain >= 0.3.0 (BASE_INFO wifiVersion cached/built-in >= 0.3.18)
Handshake & Command Reference
| Command | Payload | Response Highlights | Notes |
|---|---|---|---|
SYNC_TIME | {"timestamp": 1794000000} | code, timestamp | Call immediately on connect so recordings get synced_ timestamps |
BASE_INFO | None | version, versionCode, deviceId, deviceName, wifiVersion, wifiVersionCode | Main >= 0.3.18 includes paired Wi-Fi FW constants even before opening Wi-Fi |
STATE_INFO | None | authState, recordRealtimeEnabled, wifiOpen, bootType, lowPowerMode | wifiOpen governs SD card ownership |
BATTERY | None | level, levelText, isCharging, voltage, adc_raw | voltage in mV |
STORAGE | None | total, used | MB; requires wifiOpen == false |
TEST_CHECK | None | 11 frames {"key":"...","result":true} | No index:-1 sentinel; wait for 11 frames |
Code Examples
javascript
const NUS_SERVICE = "6e400001-b5a3-f393-e0a9-e50e24dcca9e";
const device = await navigator.bluetooth.requestDevice({
filters: [{ services: [NUS_SERVICE] }, { namePrefix: "DYJ" }],
optionalServices: [NUS_SERVICE],
});
const server = await device.gatt.connect();
const service = await server.getPrimaryService(NUS_SERVICE);
const writeChar = await service.getCharacteristic("6e400002-b5a3-f393-e0a9-e50e24dcca9e");
const notifyChar = await service.getCharacteristic("6e400003-b5a3-f393-e0a9-e50e24dcca9e");
await notifyChar.startNotifications();
await writeChar.writeValueWithResponse(new TextEncoder().encode("BASE_INFO\r\n"));rust
use std::time::Duration;
use reai_card_sdk::DeviceManager;
let manager = DeviceManager::new().await?;
let devices = manager.scan(Duration::from_secs(5)).await?;
let device = manager.connect(devices.first().expect("no card")).await?;
println!("{:?}", device.device_info().await?);
println!("{:?}", device.battery().await?);
println!("{:?}", device.test_modules().await?);Live Web Demo
Web Bluetooth is unavailable in this browser/context (requires Chrome/Edge on HTTPS or localhost). You can still test every API using the Virtual Card Simulator.
DEVICE_ID / NAME
-
MAIN / WIFI FIRMWARE
-
BATTERY
-
STORAGE (MB)
-
Wire Protocol Log (BLE NUS / HTTP)
Connect a real card or Virtual Card Simulator to inspect live protocol frames.