Reading Data from Internal Memory (Synchronization)
Aidlab and Aidmed One have internal memory (8MB/64MB). If worn correctly but offline, data is stored until full. You can sync past data while also streaming live data.
If you use the official Android or iOS apps, the device stores ECG, Activity, Steps, Heart Rate, Respiration, and Skin Temperature by default.
Enabling storage (FW 3+)
Select what to store by passing a second argument to collect:
python
device.collect([DataType.ECG, ...], [DataType.ECG, ...])kotlin
device.collect(
EnumSet.of(DataType.ECG),
EnumSet.of(DataType.ECG)
)swift
device.collect(dataTypes: [.ecg, ...], dataTypesToStore: [.ecg, ...])dart
device.collect([DataType.ECG, ...], [DataType.ECG, ...]);Enabling storage (FW < 3)
Older firmware configures storage via the debug shell:
- In Chrome, enable
chrome://flags/#enable-experimental-web-platform-featuresand restart. - Open the debug console.
- Turn Aidlab on (pulsating green LED), run
connect, select the device, wait for the prompt. - Run
sync enable <signal>(e.g.,sync enable ecg). Repeat for multiple signals. - To stop storing a signal, run
sync disable <signal>.
Sync events (examples)
python
def sync_state_did_change(self, device, sync_state): ...
def did_receive_unsynchronized_size(self, device, size, bytes_per_second): ...
def did_receive_past_ecg(self, device, timestamp, values): ...
def did_receive_past_respiration(self, device, timestamp, values): ...
def did_receive_past_respiration_rate(self, device, timestamp, value): ...
def did_receive_past_skin_temperature(self, device, timestamp, value): ...
def did_receive_past_accelerometer(self, device, timestamp, ax, ay, az): ...
def did_receive_past_gyroscope(self, device, timestamp, gx, gy, gz): ...
def did_receive_past_magnetometer(self, device, timestamp, mx, my, mz): ...
def did_receive_past_orientation(self, device, timestamp, roll, pitch, yaw): ...
def did_receive_past_body_position(self, device, timestamp, body_position): ...
def did_receive_past_quaternion(self, device, timestamp, qw, qx, qy, qz): ...
def did_receive_past_activity(self, device, timestamp, activity): ...
def did_receive_past_steps(self, device, timestamp, steps): ...
def did_receive_past_heart_rate(self, device, timestamp, heart_rate): ...
def did_receive_past_rr(self, device, timestamp, rr): ...
def did_receive_past_sound_volume(self, device, timestamp, sound_volume): ...
def did_receive_past_pressure(self, device, timestamp, value): ...
def did_receive_past_signal_quality(self, device, timestamp, value): ...kotlin
fun syncStateDidChange(device: Device, syncState: SyncState)
fun didReceiveUnsynchronizedSize(device: Device, size: Int, bytesPerSecond: Int)
fun didReceivePastECG(device: Device, timestamp: Long, values: FloatArray)
fun didReceivePastRespiration(device: Device, timestamp: Long, values: FloatArray)
fun didReceivePastSkinTemperature(device: Device, timestamp: Long, value: Float)
fun didReceivePastHeartRate(device: Device, timestamp: Long, heartRate: Int)
fun didReceivePastRr(device: Device, timestamp: Long, rr: Int)
fun didReceivePastRespirationRate(device: Device, timestamp: Long, value: Int)
fun didReceivePastActivity(device: Device, timestamp: Long, activity: ActivityType)
fun didReceivePastSteps(device: Device, timestamp: Long, value: Long)
fun didReceivePastAccelerometer(device: Device, timestamp: Long, ax: Float, ay: Float, az: Float)
fun didReceivePastGyroscope(device: Device, timestamp: Long, qx: Float, qy: Float, qz: Float)
fun didReceivePastMagnetometer(device: Device, timestamp: Long, mx: Float, my: Float, mz: Float)
fun didReceivePastQuaternion(device: Device, timestamp: Long, qw: Float, qx: Float, qy: Float, qz: Float)
fun didReceivePastOrientation(device: Device, timestamp: Long, roll: Float, pitch: Float, yaw: Float)
fun didReceivePastBodyPosition(device: Device, timestamp: Long, bodyPosition: BodyPosition)
fun didReceivePastSoundVolume(device: Device, timestamp: Long, value: Int)
fun didReceivePastPressure(device: Device, timestamp: Long, value: Int)
fun didDetectPastUserEvent(timestamp: Long)
fun didReceivePastSignalQuality(device: Device, timestamp: Long, value: Int)swift
func syncStateDidChange(_ device: Device, syncState: SyncState)
func didReceiveUnsynchronizedSize(_ device: Device, size: Int, bytesPerSecond: Int)
func didReceivePastECG(_ device: Device, timestamp: UInt64, values: [Float])
func didReceivePastRespiration(_ device: Device, timestamp: UInt64, values: [Float])
func didReceivePastSkinTemperature(_ device: Device, timestamp: UInt64, value: Float)
func didReceivePastHeartRate(_ device: Device, timestamp: UInt64, heartRate: Int32)
func didReceivePastRr(_ device: Device, timestamp: UInt64, rr: Int32)
func didReceivePastRespirationRate(_ device: Device, timestamp: UInt64, value: UInt32)
func didReceivePastActivity(_ device: Device, timestamp: UInt64, activity: ActivityType)
func didReceivePastSteps(_ device: Device, timestamp: UInt64, value: UInt64)
func didReceivePastSoundVolume(_ device: Device, timestamp: UInt64, soundVolume: UInt16)
func didReceivePastAccelerometer(_ device: Device, timestamp: UInt64, ax: Float, ay: Float, az: Float)
func didReceivePastGyroscope(_ device: Device, timestamp: UInt64, qx: Float, qy: Float, qz: Float)
func didReceivePastMagnetometer(_ device: Device, timestamp: UInt64, mx: Float, my: Float, mz: Float)
func didReceivePastQuaternion(_ device: Device, timestamp: UInt64, qw: Float, qx: Float, qy: Float, qz: Float)
func didReceivePastOrientation(_ device: Device, timestamp: UInt64, roll: Float, pitch: Float, yaw: Float)
func didReceivePastBodyPosition(_ device: Device, timestamp: UInt64, bodyPosition: BodyPosition)
func didReceivePastPressure(_ device: Device, timestamp: UInt64, value: Int32)
func didReceivePastSignalQuality(_ device: Device, timestamp: UInt64, value: Int32)dart
void syncStateDidChange(Device device, SyncState state) {}
void didReceiveUnsynchronizedSize(Device device, int size, int bytesPerSecond) {}
void didReceivePastECG(Device device, int timestamp, List<double> values) {}
void didReceivePastRespiration(Device device, int timestamp, List<double> values) {}
void didReceivePastSkinTemperature(Device device, int timestamp, double value) {}
void didReceivePastHeartRate(Device device, int timestamp, int heartRate) {}
void didReceivePastRr(Device device, int timestamp, int rr) {}
void didReceivePastRespirationRate(Device device, int timestamp, int value) {}
void didReceivePastActivity(Device device, int timestamp, ActivityType activity) {}
void didReceivePastSteps(Device device, int timestamp, int steps) {}
void didReceivePastSoundVolume(Device device, int timestamp, int soundVolume) {}
void didReceivePastAccelerometer(Device device, int timestamp, double ax, double ay, double az) {}
void didReceivePastGyroscope(Device device, int timestamp, double qx, double qy, double qz) {}
void didReceivePastMagnetometer(Device device, int timestamp, double mx, double my, double mz) {}
void didReceivePastQuaternion(Device device, int timestamp, double qw, double qx, double qy, double qz) {}
void didReceivePastOrientation(Device device, int timestamp, double roll, double pitch, double yaw) {}
void didReceivePastBodyPosition(Device device, int timestamp, BodyPosition bodyPosition) {}
void didReceivePastPressure(Device device, int timestamp, int value) {}
void didReceivePastSignalQuality(Device device, int timestamp, int value) {}To stop synchronization call stop_synchronization (Python) / stopSynchronization (Android and Apple platforms).