src.bluetooth_sig.gatt.characteristics.glucose_measurement

Glucose Measurement characteristic implementation.

Classes

Name

Description

GlucoseMeasurementBits

Glucose measurement bit field constants.

GlucoseMeasurementCharacteristic

Glucose Measurement characteristic (0x2A18).

GlucoseMeasurementData

Parsed glucose measurement data.

GlucoseMeasurementFlags

Glucose Measurement flags as per Bluetooth SIG specification.

GlucoseType

Glucose sample type enumeration as per Bluetooth SIG specification.

SampleLocation

Sample location enumeration as per Bluetooth SIG specification.

Module Contents

class src.bluetooth_sig.gatt.characteristics.glucose_measurement.GlucoseMeasurementBits

Glucose measurement bit field constants.

GLUCOSE_SAMPLE_LOCATION_BIT_WIDTH = 4
GLUCOSE_SAMPLE_LOCATION_START_BIT = 0
GLUCOSE_TYPE_BIT_WIDTH = 4
GLUCOSE_TYPE_SAMPLE_MASK = 15
GLUCOSE_TYPE_START_BIT = 4
class src.bluetooth_sig.gatt.characteristics.glucose_measurement.GlucoseMeasurementCharacteristic

Bases: src.bluetooth_sig.gatt.characteristics.base.BaseCharacteristic[GlucoseMeasurementData]

Glucose Measurement characteristic (0x2A18).

Used to transmit glucose concentration measurements with timestamps and status. Core characteristic for glucose monitoring devices.

allow_variable_length: bool = True
max_length: int = 17
min_length: int = 12
class src.bluetooth_sig.gatt.characteristics.glucose_measurement.GlucoseMeasurementData

Bases: msgspec.Struct

Parsed glucose measurement data.

static is_reserved_range(value: int) bool

Check if glucose type or sample location is in reserved range.

base_time: datetime.datetime
flags: GlucoseMeasurementFlags
glucose_concentration: float
glucose_type: GlucoseType | None = None
max_length: int = 17
min_length: int = 12
sample_location: SampleLocation | None = None
sensor_status: int | None = None
sequence_number: int
time_offset_minutes: int | None = None
unit: str
class src.bluetooth_sig.gatt.characteristics.glucose_measurement.GlucoseMeasurementFlags

Bases: enum.IntFlag

Glucose Measurement flags as per Bluetooth SIG specification.

GLUCOSE_CONCENTRATION_UNITS_MMOL_L = 2
SENSOR_STATUS_ANNUNCIATION_PRESENT = 8
TIME_OFFSET_PRESENT = 1
TYPE_SAMPLE_LOCATION_PRESENT = 4
class src.bluetooth_sig.gatt.characteristics.glucose_measurement.GlucoseType

Bases: enum.IntEnum

Glucose sample type enumeration as per Bluetooth SIG specification.

ARTERIAL_PLASMA = 6
ARTERIAL_WHOLE_BLOOD = 5
CAPILLARY_PLASMA = 2
CAPILLARY_WHOLE_BLOOD = 1
CONTROL_SOLUTION = 10
INTERSTITIAL_FLUID = 9
UNDETERMINED_PLASMA = 8
UNDETERMINED_WHOLE_BLOOD = 7
VENOUS_PLASMA = 4
VENOUS_WHOLE_BLOOD = 3
class src.bluetooth_sig.gatt.characteristics.glucose_measurement.SampleLocation

Bases: enum.IntEnum

Sample location enumeration as per Bluetooth SIG specification.

ALTERNATE_SITE_TEST = 2
CONTROL_SOLUTION = 4
EARLOBE = 3
FINGER = 1
NOT_AVAILABLE = 15