src.bluetooth_sig.gatt.characteristics.cgm_measurement¶
CGM Measurement characteristic implementation.
Implements the CGM Measurement characteristic (0x2AA7). The characteristic value contains one or more CGM Measurement Records concatenated together.
- Each record contains:
Size (uint8) – total size of the record including this field Flags (uint8) – controls presence of optional fields CGM Glucose Concentration (medfloat16) Time Offset (uint16) – minutes since session start Sensor Status Annunciation (0-3 octets, flag-gated) CGM Trend Information (medfloat16, optional) CGM Quality (medfloat16, optional)
- Flag-bit assignments:
Bit 0: CGM Trend Information present Bit 1: CGM Quality present Bits 2-4: Reserved Bit 5: Warning-Octet present (Sensor Status Annunciation) Bit 6: Cal/Temp-Octet present (Sensor Status Annunciation) Bit 7: Status-Octet present (Sensor Status Annunciation)
References
Bluetooth SIG Continuous Glucose Monitoring Service org.bluetooth.characteristic.cgm_measurement (GSS YAML)
Classes¶
Name | Description |
|---|---|
CGM Sensor Status Annunciation — Cal/Temp octet (bits 8-15). |
|
CGM Measurement characteristic (0x2AA7). |
|
Parsed data from CGM Measurement characteristic. |
|
CGM Measurement record flags. |
|
A single CGM Measurement Record. |
|
CGM Sensor Status Annunciation — Status octet (bits 0-7). |
|
CGM Sensor Status Annunciation — Warning octet (bits 16-23). |
Module Contents¶
- class src.bluetooth_sig.gatt.characteristics.cgm_measurement.CGMCalTempOctet¶
Bases:
enum.IntFlagCGM Sensor Status Annunciation — Cal/Temp octet (bits 8-15).
- CALIBRATION_NOT_ALLOWED = 2¶
- CALIBRATION_PENDING = 64¶
- CALIBRATION_RECOMMENDED = 4¶
- CALIBRATION_REQUIRED = 8¶
- SENSOR_TEMP_TOO_HIGH = 16¶
- SENSOR_TEMP_TOO_LOW = 32¶
- TIME_SYNC_REQUIRED = 1¶
- class src.bluetooth_sig.gatt.characteristics.cgm_measurement.CGMMeasurementCharacteristic(info: src.bluetooth_sig.types.CharacteristicInfo | None = None, validation: src.bluetooth_sig.gatt.characteristics.characteristic_meta.ValidationConfig | None = None)¶
Bases:
src.bluetooth_sig.gatt.characteristics.base.BaseCharacteristic[CGMMeasurementData]CGM Measurement characteristic (0x2AA7).
Contains one or more CGM Measurement Records concatenated together. Each record is self-sized via its leading Size byte.
- expected_type¶
- class src.bluetooth_sig.gatt.characteristics.cgm_measurement.CGMMeasurementData¶
Bases:
msgspec.StructParsed data from CGM Measurement characteristic.
- records¶
List of CGM Measurement Records.
- records: tuple[CGMMeasurementRecord, Ellipsis]¶
- class src.bluetooth_sig.gatt.characteristics.cgm_measurement.CGMMeasurementFlags¶
Bases:
enum.IntFlagCGM Measurement record flags.
- CAL_TEMP_OCTET_PRESENT = 64¶
- QUALITY_PRESENT = 2¶
- STATUS_OCTET_PRESENT = 128¶
- TREND_INFORMATION_PRESENT = 1¶
- WARNING_OCTET_PRESENT = 32¶
- class src.bluetooth_sig.gatt.characteristics.cgm_measurement.CGMMeasurementRecord¶
Bases:
msgspec.StructA single CGM Measurement Record.
- size¶
Total size of this record in bytes (including the size field).
- flags¶
Raw 8-bit flags field.
- glucose_concentration¶
Glucose concentration in mg/dL.
- time_offset¶
Minutes since session start.
- status_octet¶
Sensor status octet (8 bits). None if absent.
- cal_temp_octet¶
Calibration/temperature octet (8 bits). None if absent.
- warning_octet¶
Warning octet (8 bits). None if absent.
- trend_information¶
Glucose trend rate (mg/dL/min). None if absent.
- quality¶
CGM quality percentage. None if absent.
- cal_temp_octet: CGMCalTempOctet | None = None¶
- flags: CGMMeasurementFlags¶
- status_octet: CGMSensorStatusOctet | None = None¶
- warning_octet: CGMWarningOctet | None = None¶
- class src.bluetooth_sig.gatt.characteristics.cgm_measurement.CGMSensorStatusOctet¶
Bases:
enum.IntFlagCGM Sensor Status Annunciation — Status octet (bits 0-7).
- DEVICE_BATTERY_LOW = 2¶
- DEVICE_SPECIFIC_ALERT = 16¶
- GENERAL_DEVICE_FAULT = 32¶
- SENSOR_MALFUNCTION = 8¶
- SENSOR_TYPE_INCORRECT = 4¶
- SESSION_STOPPED = 1¶
- class src.bluetooth_sig.gatt.characteristics.cgm_measurement.CGMWarningOctet¶
Bases:
enum.IntFlagCGM Sensor Status Annunciation — Warning octet (bits 16-23).
- RATE_OF_DECREASE_EXCEEDED = 16¶
- RATE_OF_INCREASE_EXCEEDED = 32¶
- RESULT_HIGHER_THAN_DEVICE_CAN_PROCESS = 128¶
- RESULT_HIGHER_THAN_HYPER = 8¶
- RESULT_HIGHER_THAN_PATIENT_HIGH = 2¶
- RESULT_LOWER_THAN_DEVICE_CAN_PROCESS = 64¶
- RESULT_LOWER_THAN_HYPO = 4¶
- RESULT_LOWER_THAN_PATIENT_LOW = 1¶