Continuous Glucose Monitoring Service

nRF5 SDK v14.0.0

Continuous Glucose Monitoring Service (CGMS) module. More...

Modules

Continuous Glucose Monitoring Service database
Continuous Glucose Monitoring Service database module.
Continuous Glucose Monitoring Service Measurement
Continuous Glucose Monitoring Service Measurement module.
Record Access Control Point
Continuous Glucose Monitoring Service RACP module.
Specific Operations Control Point
Continuous Glucose Monitoring Service SOCP module.
Session Start Time
Continuous Glucose Monitoring Service SST module.
Enumerations
Structures
Types
Functions

Macros

#define NRF_BLE_CGMS_DEF (_name)
Macro for defining a nrf_ble_cgms instance. More...

CGM Feature characteristic defines

#define NRF_BLE_CGMS_FEAT_CALIBRATION_SUPPORTED (0x01 << 0)
Calibration supported.
#define NRF_BLE_CGMS_FEAT_PATIENT_HIGH_LOW_ALERTS_SUPPORTED (0x01 << 1)
Patient High/Low Alerts supported.
#define NRF_BLE_CGMS_FEAT_HYPO_ALERTS_SUPPORTED (0x01 << 2)
Hypo Alerts supported.
#define NRF_BLE_CGMS_FEAT_HYPER_ALERTS_SUPPORTED (0x01 << 3)
Hyper Alerts supported.
#define NRF_BLE_CGMS_FEAT_RATE_OF_INCREASE_DECREASE_ALERTS_SUPPORTED (0x01 << 4)
Rate of Increase/Decrease Alerts supported.
#define NRF_BLE_CGMS_FEAT_DEVICE_SPECIFIC_ALERT_SUPPORTED (0x01 << 5)
Device Specific Alert supported.
#define NRF_BLE_CGMS_FEAT_SENSOR_MALFUNCTION_DETECTION_SUPPORTED (0x01 << 6)
Sensor Malfunction Detection supported.
#define NRF_BLE_CGMS_FEAT_SENSOR_TEMPERATURE_HIGH_LOW_DETECTION_SUPPORTED (0x01 << 7)
Sensor Temperature High-Low Detection supported.
#define NRF_BLE_CGMS_FEAT_SENSOR_RESULT_HIGH_LOW_DETECTION_SUPPORTED (0x01 << 8)
Sensor Result High-Low Detection supported.
#define NRF_BLE_CGMS_FEAT_LOW_BATTERY_DETECTION_SUPPORTED (0x01 << 9)
Low Battery Detection supported.
#define NRF_BLE_CGMS_FEAT_SENSOR_TYPE_ERROR_DETECTION_SUPPORTED (0x01 << 10)
Sensor Type Error Detection supported.
#define NRF_BLE_CGMS_FEAT_GENERAL_DEVICE_FAULT_SUPPORTED (0x01 << 11)
General Device Fault supported.
#define NRF_BLE_CGMS_FEAT_E2E_CRC_SUPPORTED (0x01 << 12)
E2E-CRC supported.
#define NRF_BLE_CGMS_FEAT_MULTIPLE_BOND_SUPPORTED (0x01 << 13)
Multiple Bond supported.
#define NRF_BLE_CGMS_FEAT_MULTIPLE_SESSIONS_SUPPORTED (0x01 << 14)
Multiple Sessions supported.
#define NRF_BLE_CGMS_FEAT_CGM_TREND_INFORMATION_SUPPORTED (0x01 << 15)
CGM Trend Information supported.
#define NRF_BLE_CGMS_FEAT_CGM_QUALITY_SUPPORTED (0x01 << 16)
CGM Quality supported.

Continuous Glucose Monitoring type

#define NRF_BLE_CGMS_MEAS_TYPE_CAP_BLOOD 0x01
Capillary Whole blood.
#define NRF_BLE_CGMS_MEAS_TYPE_CAP_PLASMA 0x02
Capillary Plasma.
#define NRF_BLE_CGMS_MEAS_TYPE_VEN_BLOOD 0x03
Venous Whole blood.
#define NRF_BLE_CGMS_MEAS_TYPE_VEN_PLASMA 0x04
Venous Plasma.
#define NRF_BLE_CGMS_MEAS_TYPE_ART_BLOOD 0x05
Arterial Whole blood.
#define NRF_BLE_CGMS_MEAS_TYPE_ART_PLASMA 0x06
Arterial Plasma.
#define NRF_BLE_CGMS_MEAS_TYPE_UNDET_BLOOD 0x07
Undetermined Whole blood.
#define NRF_BLE_CGMS_MEAS_TYPE_UNDET_PLASMA 0x08
Undetermined Plasma.
#define NRF_BLE_CGMS_MEAS_TYPE_FLUID 0x09
Interstitial Fluid (ISF).
#define NRF_BLE_CGMS_MEAS_TYPE_CONTROL 0x0A
Control Solution.

CGM sample location

#define NRF_BLE_CGMS_MEAS_LOC_FINGER 0x01
Finger.
#define NRF_BLE_CGMS_MEAS_LOC_AST 0x02
Alternate Site Test (AST).
#define NRF_BLE_CGMS_MEAS_LOC_EAR 0x03
Earlobe.
#define NRF_BLE_CGMS_MEAS_LOC_CONTROL 0x04
Control solution.
#define NRF_BLE_CGMS_MEAS_LOC_SUB_TISSUE 0x05
Subcutaneous tissue.
#define NRF_BLE_CGMS_MEAS_LOC_NOT_AVAIL 0x0F
Sample Location value not available.

CGM Measurement Sensor Status Annunciation

#define NRF_BLE_CGMS_STATUS_SESSION_STOPPED (0x01 << 0)
Status: Session Stopped.
#define NRF_BLE_CGMS_STATUS_DEVICE_BATTERY_LOW (0x01 << 1)
Status: Device Battery Low.
#define NRF_BLE_CGMS_STATUS_SENSOR_TYPE_INCORRECT_FOR_DEVICE (0x01 << 2)
Status: Sensor type incorrect for device.
#define NRF_BLE_CGMS_STATUS_SENSOR_MALFUNCTION (0x01 << 3)
Status: Sensor malfunction.
#define NRF_BLE_CGMS_STATUS_DEVICE_SPECIFIC_ALERT (0x01 << 4)
Status: Device Specific Alert.
#define NRF_BLE_CGMS_STATUS_GENERAL_DEVICE_FAULT (0x01 << 5)
Status: General device fault has occurred in the sensor.

CGM Measurement flags

#define NRF_BLE_CGMS_FLAG_TREND_INFO_PRESENT 0x01
CGM Trend Information Present.
#define NRF_BLE_CGMS_FLAGS_QUALITY_PRESENT 0x02
CGM Quality Present.
#define NRF_BLE_CGMS_STATUS_FLAGS_WARNING_OCT_PRESENT 0x20
Sensor Status Annunciation Field, Warning-Octet present.
#define NRF_BLE_CGMS_STATUS_FLAGS_CALTEMP_OCT_PRESENT 0x40
Sensor Status Annunciation Field, Cal/Temp-Octet present.
#define NRF_BLE_CGMS_STATUS_FLAGS_STATUS_OCT_PRESENT 0x80
Sensor Status Annunciation Field, Status-Octet present.

Byte length of various commands (used for validating, encoding, and decoding data).

#define NRF_BLE_CGMS_MEAS_OP_LEN 1
Length of the opcode inside the Glucose Measurement packet.
#define NRF_BLE_CGMS_MEAS_HANDLE_LEN 2
Length of the handle inside the Glucose Measurement packet.
#define NRF_BLE_CGMS_MEAS_LEN_MAX
Maximum size of a transmitted Glucose Measurement. More...
#define NRF_BLE_CGMS_MEAS_REC_LEN_MAX 15
Maximum length of one measurement record. Size 1 byte, flags 1 byte, glucose concentration 2 bytes, offset 2 bytes, status 3 bytes, trend 2 bytes, quality 2 bytes, CRC 2 bytes.
#define NRF_BLE_CGMS_MEAS_REC_LEN_MIN 6
Minimum length of one measurement record. Size 1 byte, flags 1 byte, glucose concentration 2 bytes, offset 2 bytes.
#define NRF_BLE_CGMS_MEAS_REC_PER_NOTIF_MAX
Maximum number of records per notification. We can send more than one measurement record per notification, but we do not want a a single record split over two notifications. More...
#define NRF_BLE_CGMS_SOCP_RESP_CODE_LEN 2
Length of a response. Response code 1 byte, response value 1 byte.
#define NRF_BLE_CGMS_FEATURE_LEN 6
Length of a feature. Feature 3 bytes, type 4 bits, sample location 4 bits, CRC 2 bytes.
#define NRF_BLE_CGMS_STATUS_LEN 7
Length of a status. Offset 2 bytes, status 3 bytes, CRC 2 bytes.
#define NRF_BLE_CGMS_MAX_CALIB_LEN 10
Length of a calibration record. Concentration 2 bytes, time 2 bytes, calibration 4 bits, calibration sample location 4 bits, next calibration time 2 bytes, record number 2 bytes, calibration status 1 byte.
#define NRF_BLE_CGMS_CALIBS_NB_MAX 5
Maximum number of calibration values that can be stored.
#define NRF_BLE_CGMS_SST_LEN 9
Length of the start time. Date time 7 bytes, time zone 1 byte, DST 1 byte.
#define NRF_BLE_CGMS_CRC_LEN 2
Length of the CRC bytes (if used).
#define NRF_BLE_CGMS_SRT_LEN 2
Length of the Session Run Time attribute.
#define NRF_BLE_CGMS_SOCP_RESP_LEN
Max lenth of a SOCP response. More...
#define NRF_BLE_CGMS_RACP_PENDING_OPERANDS_MAX 2

Detailed Description

Continuous Glucose Monitoring Service (CGMS) module.

This module implements a sensor for the Continuous Glucose Monitoring Service. The sensor is a GATT Server that sends CGM measurements to a connected CGMS Collector. The CGMS Sensor stores records that can be accessed with the Record Access Control Point (RACP). The collector can access the features and status of the sensor. Session Run Time and Session Start Time can be used to convey timing information between the sensor and the collector. The Specific Operations Control Point is used to stop and start monitoring sessions, among other things.

Note
The application must register this module as BLE event observer using the NRF_SDH_BLE_OBSERVER macro. Example:

Macro Definition Documentation

#define NRF_BLE_CGMS_DEF ( _name )

Macro for defining a nrf_ble_cgms instance.

Parameters
_name Name of the instance.
#define NRF_BLE_CGMS_MEAS_LEN_MAX
Value:
NRF_BLE_CGMS_MEAS_OP_LEN - \
NRF_BLE_CGMS_MEAS_HANDLE_LEN)

Maximum size of a transmitted Glucose Measurement.

#define NRF_BLE_CGMS_MEAS_REC_PER_NOTIF_MAX
Value:
NRF_BLE_CGMS_MEAS_REC_LEN_MIN)

Maximum number of records per notification. We can send more than one measurement record per notification, but we do not want a a single record split over two notifications.

#define NRF_BLE_CGMS_SOCP_RESP_LEN
Value:
NRF_BLE_CGMS_SOCP_RESP_CODE_LEN)

Max lenth of a SOCP response.