Skip to content

Reading Data from Internal Memory (Synchronization)

The device can record selected signals in internal memory while disconnected. After reconnecting, synchronization transfers the stored samples to your application. Live collection can continue during synchronization.

Starting synchronization

After connecting, call startSynchronization() / start_synchronization() to transfer stored data.

Firmware compatibility

Firmware 3.7.85–3.7.110 starts synchronization with collect, so do not start it separately.

python
# Start transferring stored data from internal memory.
await device.start_synchronization()

# Stop transferring stored data from internal memory.
await device.stop_synchronization()
kotlin
// Start transferring stored data from internal memory.
device.startSynchronization()

// Stop transferring stored data from internal memory.
device.stopSynchronization()
swift
// Start transferring stored data from internal memory.
try await device.startSynchronization()

// Stop transferring stored data from internal memory.
try await device.stopSynchronization()
dart
// Start transferring stored data from internal memory.
await device.startSynchronization();

// Stop transferring stored data from internal memory.
await device.stopSynchronization();
csharp
var sdk = FindObjectOfType<Aidlab.AidlabSDK>();
if (sdk != null) {
    // Start transferring stored data from internal memory.
    await sdk.StartSynchronization();

    // Stop transferring stored data from internal memory.
    await sdk.StopSynchronization();
}

// Unity Android bridge variant:
// await aidlab.startSynchronization();
// await aidlab.stopSynchronization();

Receiving stored data

Stored samples are delivered through the didReceivePast... / did_receive_past_... callbacks. Timestamps represent capture time in milliseconds since the Unix epoch. Within each data type, samples arrive in capture order, from oldest to newest. To combine multiple data types into one timeline, sort them by timestamp.

python
def did_receive_past_ecg(self, device, timestamp, value): ...
def did_receive_past_respiration(self, device, timestamp, value): ...
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 didReceivePastECG(device: Device, timestamp: Long, value: Float)
fun didReceivePastRespiration(device: Device, timestamp: Long, value: Float)
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, gx: Float, gy: Float, gz: 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 didReceivePastEDA(device: Device, timestamp: Long, conductance: Float)
fun didReceivePastGPS(device: Device, timestamp: Long, latitude: Double, longitude: Double, altitude: Double, speed: Float, heading: Float, hdop: 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(device: Device, timestamp: Long)
fun didReceivePastSignalQuality(device: Device, timestamp: Long, value: Int)
swift
func didReceivePastECG(_ device: Device, timestamp: UInt64, value: Float)
func didReceivePastRespiration(_ device: Device, timestamp: UInt64, value: 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, gx: Float, gy: Float, gz: 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 didReceivePastEDA(_ device: Device, timestamp: UInt64, conductance: Float)
func didReceivePastGPS(_ device: Device, timestamp: UInt64, latitude: Double, longitude: Double, altitude: Double, speed: Float, heading: Float, hdop: Float)
func didReceivePastBodyPosition(_ device: Device, timestamp: UInt64, bodyPosition: BodyPosition)
func didReceivePastPressure(_ device: Device, timestamp: UInt64, value: Int32)
func didDetectPastUserEvent(_ device: Device, timestamp: UInt64)
func didReceivePastSignalQuality(_ device: Device, timestamp: UInt64, value: UInt8)
dart
void didReceivePastECG(Device device, int timestamp, double value) {}
void didReceivePastRespiration(Device device, int timestamp, double value) {}
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 gx, double gy, double gz) {}
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 didReceivePastEDA(Device device, int timestamp, double conductance) {}
void didReceivePastGPS(Device device, int timestamp, double latitude, double longitude, double altitude, double speed, double heading, double hdop) {}
void didDetectPastUserEvent(Device device, int timestamp) {}
void didReceivePastSignalQuality(Device device, int timestamp, int value) {}
csharp
void didReceivePastECG(IAidlab aidlab, UInt64 timestamp, float value) {}
void didReceivePastRespiration(IAidlab aidlab, UInt64 timestamp, float value) {}
void didReceivePastSkinTemperature(IAidlab aidlab, UInt64 timestamp, float value) {}
void didReceivePastHeartRate(IAidlab aidlab, UInt64 timestamp, int heartRate) {}
void didReceivePastRr(IAidlab aidlab, UInt64 timestamp, int rr) {}
void didReceivePastRespirationRate(IAidlab aidlab, UInt64 timestamp, int value) {}
void didReceivePastActivity(IAidlab aidlab, UInt64 timestamp, ActivityType activity) {}
void didReceivePastSteps(IAidlab aidlab, UInt64 timestamp, ulong value) {}
void didReceivePastAccelerometer(IAidlab aidlab, UInt64 timestamp, float ax, float ay, float az) {}
void didReceivePastGyroscope(IAidlab aidlab, UInt64 timestamp, float gx, float gy, float gz) {}
void didReceivePastMagnetometer(IAidlab aidlab, UInt64 timestamp, float mx, float my, float mz) {}
void didReceivePastQuaternion(IAidlab aidlab, UInt64 timestamp, float qw, float qx, float qy, float qz) {}
void didReceivePastOrientation(IAidlab aidlab, UInt64 timestamp, float roll, float pitch, float yaw) {}
void didReceivePastEDA(IAidlab aidlab, UInt64 timestamp, float conductance) {} // Firmware 4.0.0+
void didReceivePastGPS(IAidlab aidlab, UInt64 timestamp, double latitude, double longitude, double altitude, float speed, float heading, float hdop) {} // Firmware 4.0.0+
void didReceivePastBodyPosition(IAidlab aidlab, UInt64 timestamp, BodyPosition bodyPosition) {}
void didReceivePastSoundVolume(IAidlab aidlab, UInt64 timestamp, int value) {}
void didReceivePastPressure(IAidlab aidlab, UInt64 timestamp, int value) {}
void didReceivePastSignalQuality(IAidlab aidlab, UInt64 timestamp, int value) {}
void didDetectPastUserEvent(UInt64 timestamp) {}

Synchronization progress

Use syncStateDidChange / sync_state_did_change to track the synchronization state. didReceiveUnsynchronizedSize / did_receive_unsynchronized_size reports how many bytes remain and, when available, the current transfer speed in bytes per second.

python
def sync_state_did_change(self, device, sync_state): ...
def did_receive_unsynchronized_size(self, device, size, bytes_per_second): ...
kotlin
fun syncStateDidChange(device: Device, state: SyncState)
fun didReceiveUnsynchronizedSize(device: Device, unsynchronizedSize: Int, syncBytesPerSecond: Float)
swift
func syncStateDidChange(_ device: Device, state: SyncState)
func didReceiveUnsynchronizedSize(_ device: Device, unsynchronizedSize: UInt32, syncBytesPerSecond: Float)
dart
void syncStateDidChange(Device device, SyncState state) {}
void didReceiveUnsynchronizedSize(Device device, int size, double bytesPerSecond) {}
csharp
void syncStateDidChange(IAidlab aidlab, SyncState state) {}
void didReceiveUnsynchronizedSize(IAidlab aidlab, int unsynchronizedSize, float syncBytesPerSecond) {}

SyncState has the following values:

StateMeaning
STARTTransfer of stored data has started.
ENDThe available stored data was transferred and synchronization finished normally.
STOPSynchronization was explicitly stopped before normal completion.
EMPTYThere was no stored data to transfer.
UNAVAILABLESynchronization could not access the device storage or is unavailable.

Clearing stored data

clearSynchronization() / clear_synchronization() deletes historical samples stored on the device.