Skip to content

Data Types and Events

When working with Aidlab / Aidmed One you select data types to stream and handle events per sample.

Collecting data

python
async def did_connect(self, device):
    await device.collect([
        DataType.RESPIRATION_RATE,
        DataType.SKIN_TEMPERATURE,
    ])
kotlin
override fun didConnect(device: Device) {
    device.collect(
        EnumSet.of(DataType.RESPIRATION_RATE, DataType.SKIN_TEMPERATURE),
        EnumSet.noneOf(DataType::class.java)
    )
}
swift
func didConnect(_ device: Device) {
    device.collect(dataTypes: [.respirationRate, .skinTemperature], dataTypesToStore: [])
}
dart
@override
void didConnect(Device device) {
    device.collect([DataType.RESPIRATION_RATE, DataType.SKIN_TEMPERATURE], []);
}

collect takes two lists: data types to stream in real time and optional data types to store in the device’s internal memory for later synchronization. Pass an empty list/set if you don’t need offline storage.

collect takes the list of data types to stream. Available data types include:

Data typeDescriptionMin FW
ECG (Electrocardiogram)Samples in volts (±0.8 V ADC range, 24-bit) capturing heart electrical activity.1.0.0
RespirationBreathing waveform in Ohms, enough to plot a breathing curve.1.0.0
Skin TemperatureSkin temp in °C; stabilizes in ~5–15 min (touch sensor).1.0.0
ActivityActivity changes: still, walking, running, automotive, cycling.2.1.0
StepsSteps counted since the previous update.2.1.0
RRR–R intervals from ECG, in milliseconds.2.1.0
Respiration RateBreaths per minute.2.1.0
Body PositionFor lying posture: prone, supine, left side, right side, unknown.2.2.0
Heart RateBPM over a 1-minute window.2.2.0
Sound VolumeMicrophone amplitude 0–65536 (16-bit PCM raw units); cannot be streamed with Motion at the same time.2.2.5
OrientationEuler angles (roll, pitch, yaw) and quaternions; with Motion powers the bodyweight workout classifier.2.2.6
Motion9-axis IMU: accel (ax, ay, az) in ±2 g, gyro (gx, gy, gz) in deg/s (±250 dps), mag (mx, my, mz) in µT (±4900 µT); with Orientation powers workout classifier.2.2.6
PressureNasal cannula airflow (Aidmed One only); useful for sleep/apnea studies.3.0.0
Electrodermal ActivitySkin conductance in µS (resistance in Ω when available), batched at 10 Hz.4.0.0
GPSLatitude/longitude, altitude, speed, heading, HDOP.4.0.0

Sample rates per data type are listed on the support page: Measurements range and accuracy.

Events

Each data sample invokes its handler. Timestamps are taken at capture time; the reference point is set on first pairing (or after set_time) and all timestamps are strictly ascending. Implement handlers for the data types you stream to react in real time and keep chronology intact. Below are concise per-platform examples covering the key callbacks (including EDA/GPS, sync, and past data):

python
async def did_connect(self, device): ...
def did_disconnect(self, device): ...
def did_receive_battery_level(self, device, soc): ...
def did_receive_ecg(self, device, ts, value): ...
def did_receive_respiration(self, device, ts, value): ...
def did_receive_skin_temperature(self, device, ts, value): ...
def did_receive_heart_rate(self, device, ts, bpm): ...
def did_receive_rr(self, device, ts, rr): ...
def did_receive_activity(self, device, ts, activity): ...
def did_receive_steps(self, device, ts, steps): ...
def did_receive_signal_quality(self, device, ts, quality): ...
def did_receive_motion(self, device, ts, ax, ay, az, gx, gy, gz, mx, my, mz): ...
def did_receive_orientation(self, device, ts, roll, pitch, yaw): ...
def did_receive_sound_volume(self, device, ts, value): ...
def did_receive_pressure(self, device, ts, value): ...
def did_receive_pressure_wear_state(self, device, wear_state): ...
def did_receive_eda(self, device, ts, conductance): ...  # FW 4.0.0
def did_receive_gps(self, device, ts, lat, lon, alt, speed, heading, hdop): ...  # FW 4.0.0
def did_detect_user_event(self, device, ts): ...
def did_detect_exercise(self, device, exercise): ...
def did_receive_payload(self, device, process, payload): ...
def did_receive_error(self, error): ...
def sync_state_did_change(self, device, state): ...
def did_receive_unsynchronized_size(self, device, size, throughput): ...
def did_receive_past_ecg(self, device, ts, value): ...
def did_receive_past_eda(self, device, ts, conductance): ...
def did_receive_past_gps(self, device, ts, lat, lon, alt, speed, heading, hdop): ...
kotlin
fun didConnect(device: Device)
fun didDisconnect(device: Device, reason: DisconnectReason)
fun didReceiveBatteryLevel(device: Device, soc: Int)
fun didReceiveECG(device: Device, timestamp: Long, value: Float)
fun didReceiveRespiration(device: Device, timestamp: Long, value: Float)
fun didReceiveSkinTemperature(device: Device, timestamp: Long, value: Float)
fun didReceiveHeartRate(device: Device, timestamp: Long, heartRate: Int)
fun didReceiveRr(device: Device, timestamp: Long, rr: Int)
fun didReceiveActivity(device: Device, timestamp: Long, activity: ActivityType)
fun didReceiveSteps(device: Device, timestamp: Long, steps: Int)
fun didReceiveSignalQuality(device: Device, timestamp: Long, quality: Int)
fun didReceiveMotion(...)
fun didReceiveOrientation(...)
fun didReceiveSoundVolume(device: Device, timestamp: Long, value: Int)
fun didReceivePressure(device: Device, timestamp: Long, value: Int)
fun didReceivePressureWearState(device: Device, wearState: WearState)
fun didReceiveEDA(device: Device, timestamp: Long, conductance: Double) // FW 4.0.0
fun didReceiveGPS(device: Device, timestamp: Long, lat: Double, lon: Double, alt: Double, speed: Double, heading: Double, hdop: Double) // FW 4.0.0
fun didDetectUserEvent(device: Device, timestamp: Long)
fun didDetectExercise(device: Device, exercise: Exercise)
fun didReceivePayload(device: Device, process: String, payload: ByteArray)
fun didReceiveError(error: String)
fun syncStateDidChange(device: Device, state: SyncState)
fun didReceiveUnsynchronizedSize(device: Device, size: Int, throughput: Float)
fun didReceivePastECG(device: Device, timestamp: Long, value: Float)
fun didReceivePastEDA(device: Device, timestamp: Long, conductance: Double)
fun didReceivePastGPS(device: Device, timestamp: Long, lat: Double, lon: Double, alt: Double, speed: Double, heading: Double, hdop: Double)
swift
func didConnect(_ device: Device)
func didDisconnect(_ device: Device, reason: DisconnectReason)
func didReceiveBatteryLevel(_ device: Device, stateOfCharge: UInt8)
func didReceiveECG(_ device: Device, timestamp: UInt64, value: Float)
func didReceiveRespiration(_ device: Device, timestamp: UInt64, value: Float)
func didReceiveSkinTemperature(_ device: Device, timestamp: UInt64, value: Float)
func didReceiveHeartRate(_ device: Device, timestamp: UInt64, heartRate: UInt32)
func didReceiveRr(_ device: Device, timestamp: UInt64, rr: UInt32)
func didReceiveActivity(_ device: Device, timestamp: UInt64, activity: ActivityType)
func didReceiveSteps(_ device: Device, timestamp: UInt64, steps: UInt32)
func didReceiveSignalQuality(_ device: Device, timestamp: UInt64, value: UInt32)
func didReceiveMotion(...) // accel/gyro/mag
func didReceiveOrientation(_ device: Device, timestamp: UInt64, roll: Float, pitch: Float, yaw: Float)
func didReceiveSoundVolume(_ device: Device, timestamp: UInt64, value: UInt16)
func didReceivePressure(_ device: Device, timestamp: UInt64, value: UInt16)
func didReceivePressureWearState(_ device: Device, wearState: WearState)
func didReceiveEDA(_ device: Device, timestamp: UInt64, conductance: Float) // FW 4.0.0
func didReceiveGPS(_ device: Device, timestamp: UInt64, lat: Double, lon: Double, alt: Double, speed: Double, heading: Double, hdop: Double) // FW 4.0.0
func didDetectUserEvent(_ device: Device, timestamp: UInt64)
func didDetectExercise(_ device: Device, exercise: Exercise)
func didReceivePayload(_ device: Device, process: String, payload: [UInt8])
func didReceiveError(_ error: String)
func syncStateDidChange(_ device: Device, state: SyncState)
func didReceiveUnsynchronizedSize(_ device: Device, unsynchronizedSize: UInt16, syncBytesPerSecond: Float)
func didReceivePastECG(_ device: Device, timestamp: UInt64, value: Float)
func didReceivePastEDA(_ device: Device, timestamp: UInt64, conductance: Float)
func didReceivePastGPS(_ device: Device, timestamp: UInt64, lat: Double, lon: Double, alt: Double, speed: Double, heading: Double, hdop: Double)
dart
void didConnect(Device device);
void didDisconnect(Device device, DisconnectReason reason);
void didReceiveBatteryLevel(Device device, int stateOfCharge);
void didReceiveECG(Device device, int timestamp, double value);
void didReceiveRespiration(Device device, int timestamp, double value);
void didReceiveSkinTemperature(Device device, int timestamp, double value);
void didReceiveHeartRate(Device device, int timestamp, int heartRate);
void didReceiveRr(Device device, int timestamp, int rr);
void didReceiveActivity(Device device, int timestamp, ActivityType activity);
void didReceiveSteps(Device device, int timestamp, int steps);
void didReceiveSignalQuality(Device device, int timestamp, int value);
void didReceiveMotion(...);
void didReceiveOrientation(Device device, int timestamp, double roll, double pitch, double yaw);
void didReceiveSoundVolume(Device device, int timestamp, int value);
void didReceivePressure(Device device, int timestamp, int value);
void didReceivePressureWearState(Device device, WearState wearState);
void didReceiveEDA(Device device, int timestamp, double conductance); // FW 4.0.0
void didReceiveGPS(Device device, int timestamp, double lat, double lon, double alt, double speed, double heading, double hdop); // FW 4.0.0
void didDetectUserEvent(Device device, int timestamp);
void didDetectExercise(Device device, Exercise exercise);
void didReceivePayload(Device device, String process, Uint8List payload);
void didReceiveError(String error);
void syncStateDidChange(Device device, SyncState state);
void didReceiveUnsynchronizedSize(Device device, int unsynchronizedSize, double syncBytesPerSecond);
void didReceivePastECG(Device device, int timestamp, double value);
void didReceivePastEDA(Device device, int timestamp, double conductance);
void didReceivePastGPS(Device device, int timestamp, double lat, double lon, double alt, double speed, double heading, double hdop);

Device object

python
class Device:
    firmware_revision: str
    hardware_revision: str
    serial_number: str
    manufacturer_name: str
    address: str

    async def connect(delegate: DeviceDelegate)
    async def disconnect()
    async def collect(self, data_types: list[DataType], data_types_to_store: Optional[List[DataType]] = None)
    async def start_synchronization()
    async def stop_synchronization()
    async def set_time(timestamp: float)
    async def send(self, payload: str | bytes, process_id: int = 0)
kotlin
class Device {
    val firmwareRevision: String?
    val hardwareRevision: String?
    val serialNumber: String?
    val manufacturerName: String?
    fun address(): String
    fun name(): String?

    fun connect(delegate: DeviceDelegate)
    fun collect(dataTypes: EnumSet<DataType>, dataTypesToStore: EnumSet<DataType>)
    fun disconnect()
    fun startSynchronization()
    fun stopSynchronization()
    fun send(payload: ByteArray, processId: Int = 0)
}
swift
public class Device {
    public var name: String?
    public var firmwareRevision: String?
    public var hardwareRevision: String?
    public var serialNumber: String?
    public var manufacturerName: String?
    public var address: UUID
    public var rssi: NSNumber
    public var peripheral: CBPeripheral

    public func readRSSI()
    public func connect(delegate: DeviceDelegate)
    public func collect(dataTypes: [DataType], dataTypesToStore: [DataType])
    public func disconnect()
    public func startSynchronization()
    public func stopSynchronization()
    public func send(_ bytes: [UInt8], processId: Int = 0)
}
dart
class Device {
    String? firmwareRevision;
    String? hardwareRevision;
    String? serialNumber;
    String? manufacturerName;
    String address;

    void connect(DeviceDelegate delegate);
    void collect(List<DataType> dataTypes, List<DataType> dataTypesToStore);
    void disconnect();
    void startSynchronization();
    void stopSynchronization();
    void send(Uint8List payload, int processId);
}