import { type DataViewReader } from "./data-view-reader.js"; import { type DateTime } from "./date-time.js"; /**

The Glucose Measurement characteristic is a variable length structure containing a Flags field, a Sequence Number field, a Base Time field and, based upon the contents of the Flags field, may contain a Time Offset field, Glucose Concentration field, Type-Sample Location field and a Sensor Status Annunciation field.

*/ export interface GlucoseMeasurement { baseTime: DateTime; /** * | value | description | * | ----- | ----------- | * | 0 | False | * | 1 | True | */ contextInformationFollows: number; /** * | value | description | * | ----- | ----------- | * | 0 | False | * | 1 | True | */ deviceBatteryLowAtTimeOfMeasurement: number; /** *

Format: `8bit`

*

These flags define which data fields are present in the Characteristic value

* * Bit field: * * | index | size | req | name | * | ----- | ---- | ------ | ------------------------------------------------------- | * | 0 | 1 | C1 | Time Offset Present | * | 1 | 1 | C2 | Glucose Concentration, Type and Sample Location Present | * | 2 | 1 | C3, C4 | Glucose Concentration Units | * | 3 | 1 | C5 | Sensor Status Annunciation Present | * | 4 | 1 | | Context Information Follows | * | 5 | 3 | | Reserved for future use | * */ flags: number; /** * | value | description | * | ----- | ----------- | * | 0 | False | * | 1 | True | */ generalDeviceFaultHasOccurredInTheSensor: number; /** *

Format: `SFLOAT`

*

Unit: `org.bluetooth.unit.mass_density.kilogram_per_litre`

*

C2: Field exists if the key of bit 1 of the Flags field is set to 1, C3: Field exists if the key of bit 2 of the Flags field is set to 0

*/ glucoseConcentrationUnitsOfKgL?: number | undefined; /** *

Format: `SFLOAT`

*

Unit: `org.bluetooth.unit.mass_density.mole_per_litre`

*

C2: Field exists if the key of bit 1 of the Flags field is set to 1, C4: Field exists if the key of bit 2 of the Flags field is set to 1

*/ glucoseConcentrationUnitsOfMolL?: number | undefined; /** *

Format: `nibble`

*

C2: Field exists if the key of bit 1 of the Flags field is set to 1

* | Key | Description | * | --- | ----------------------------------- | * | 0 | Reserved for future use | * | 1 | Finger | * | 2 | Alternate Site Test (AST) | * | 3 | Earlobe | * | 4 | Control solution | * | 15 | Sample Location value not available | * *

Reserved for future use: 5 to 14

*/ sampleLocation?: number | undefined; /** * | value | description | * | ----- | ----------- | * | 0 | False | * | 1 | True | */ sampleSizeForBloodOrControlSolutionInsufficientAtTimeOfMeasurement: number; /** * | value | description | * | ----- | ----------- | * | 0 | False | * | 1 | True | */ sensorMalfunctionOrFaultingAtTimeOfMeasurement: number; /** * | value | description | * | ----- | ----------- | * | 0 | False | * | 1 | True | */ sensorReadInterruptedBecauseStripWasPulledTooSoonAtTimeOfMeasurement: number; /** * | value | description | * | ----- | ----------- | * | 0 | False | * | 1 | True | */ sensorResultHigherThanTheDeviceCanProcess: number; /** * | value | description | * | ----- | ----------- | * | 0 | False | * | 1 | True | */ sensorResultLowerThanTheDeviceCanProcess: number; /** *

Format: `16bit`

*

C5: Field exists if the key of bit 3 of the Flags field is set to 1

* * Bit field: * * | index | size | name | * | ----- | ---- | -------------------------------------------------------------------------------- | * | 0 | 1 | Device battery low at time of measurement | * | 1 | 1 | Sensor malfunction or faulting at time of measurement | * | 2 | 1 | Sample size for blood or control solution insufficient at time of measurement | * | 3 | 1 | Strip insertion error | * | 4 | 1 | Strip type incorrect for device | * | 5 | 1 | Sensor result higher than the device can process | * | 6 | 1 | Sensor result lower than the device can process | * | 7 | 1 | Sensor temperature too high for valid test/result at time of measurement | * | 8 | 1 | Sensor temperature too low for valid test/result at time of measurement | * | 9 | 1 | Sensor read interrupted because strip was pulled too soon at time of measurement | * | 10 | 1 | General device fault has occurred in the sensor | * | 11 | 1 | Time fault has occurred in the sensor and time may be inaccurate | * | 12 | 4 | Reserved for future use | * */ sensorStatusAnnunciation: number; /** * | value | description | * | ----- | ----------- | * | 0 | False | * | 1 | True | */ sensorTemperatureTooHighForValidTestResultAtTimeOfMeasurement: number; /** * | value | description | * | ----- | ----------- | * | 0 | False | * | 1 | True | */ sensorTemperatureTooLowForValidTestResultAtTimeOfMeasurement: number; /**

Format: `uint16`

*/ sequenceNumber: number; /** * | value | description | * | ----- | ----------- | * | 0 | False | * | 1 | True | */ stripInsertionError: number; /** * | value | description | * | ----- | ----------- | * | 0 | False | * | 1 | True | */ stripTypeIncorrectForDevice: number; /** * | value | description | * | ----- | ----------- | * | 0 | False | * | 1 | True | */ timeFaultHasOccurredInTheSensorAndTimeMayBeInaccurate: number; /** *

Format: `sint16`

*

Unit: `org.bluetooth.unit.time.minute`

*

C1: Field exists if the key of bit 0 of the Flags field is set to 1

*/ timeOffset?: number | undefined; /** *

Format: `nibble`

*

C2: Field exists if the key of bit 1 of the Flags field is set to 1

* | Key | Description | * | --- | ------------------------ | * | 0 | Reserved for future use | * | 1 | Capillary Whole blood | * | 2 | Capillary Plasma | * | 3 | Venous Whole blood | * | 4 | Venous Plasma | * | 5 | Arterial Whole blood | * | 6 | Arterial Plasma | * | 7 | Undetermined Whole blood | * | 8 | Undetermined Plasma | * | 9 | Interstitial Fluid (ISF) | * | 10 | Control Solution | * *

Reserved for future use: 11 to 15

*/ type?: number | undefined; } /** * Where fields with the format ?nibble? have been defined in the above table, the fields are shown in the order of Least Significant Nibble first, when reading the table from top to bottom. Where the characteristic definition contains two adjacent nibbles and the service specification has defined that that pair of nibbles comprise a single octet, the Least Significant Nibble means the four bits numbered 0, 1, 2 and 3 of the octet and the Most Significant Nibble means the four bits numbered 4, 5, 6 and 7 of that octet. * @see {@link https://raw.githubusercontent.com/oesmith/gatt-xml/refs/heads/master/org.bluetooth.characteristic.glucose_measurement.xml | Glucose Measurement} */ export declare class GlucoseMeasurementImpl implements GlucoseMeasurement { static readonly UUID_PREFIX = 10776; static readonly TYPE_NAME = "org.bluetooth.characteristic.glucose_measurement"; static readonly NAME = "Glucose Measurement"; /** Parse from a DataView into {@link GlucoseMeasurement}. */ static fromDataView(dataView: DataView | DataViewReader, indexStart?: number | undefined): GlucoseMeasurementImpl; readonly baseTime: DateTime; readonly contextInformationFollows: number; readonly deviceBatteryLowAtTimeOfMeasurement: number; readonly flags: number; readonly generalDeviceFaultHasOccurredInTheSensor: number; readonly glucoseConcentrationUnitsOfKgL?: number | undefined; readonly glucoseConcentrationUnitsOfMolL?: number | undefined; readonly sampleLocation?: number | undefined; readonly sampleSizeForBloodOrControlSolutionInsufficientAtTimeOfMeasurement: number; readonly sensorMalfunctionOrFaultingAtTimeOfMeasurement: number; readonly sensorReadInterruptedBecauseStripWasPulledTooSoonAtTimeOfMeasurement: number; readonly sensorResultHigherThanTheDeviceCanProcess: number; readonly sensorResultLowerThanTheDeviceCanProcess: number; readonly sensorStatusAnnunciation: number; readonly sensorTemperatureTooHighForValidTestResultAtTimeOfMeasurement: number; readonly sensorTemperatureTooLowForValidTestResultAtTimeOfMeasurement: number; readonly sequenceNumber: number; readonly stripInsertionError: number; readonly stripTypeIncorrectForDevice: number; readonly timeFaultHasOccurredInTheSensorAndTimeMayBeInaccurate: number; readonly timeOffset?: number | undefined; readonly type?: number | undefined; constructor(glucoseMeasurement: GlucoseMeasurement); } /** Parse from a DataView into {@link GlucoseMeasurement}. */ export declare function glucoseMeasurementFromDataView(dataView: DataView | DataViewReader, indexStart?: number): GlucoseMeasurement; //# sourceMappingURL=glucose-measurement.d.ts.map