Go to the documentation of this file.
68 #include "custom_config.h"
77 #define GLS_CONNECTION_MAX 10
78 #define GLS_MEAS_VAL_LEN_MAX 20
79 #define GLS_MEAS_CTX_LEN_MAX 20
80 #define GLS_REC_ACCESS_CTRL_LEN_MIN 2
81 #define GLS_REC_ACCESS_CTRL_LEN_MAX 21
84 #define GLS_NTF_OF_NULL 0x00
85 #define GLS_NTF_OF_MEAS 0x01
86 #define GLS_NTF_OF_MEAS_CTX 0x10
88 #define GLS_ERROR_PROC_IN_PROCESS 0x80
89 #define GLS_ERROR_CCCD_INVALID 0x81
96 #define GLS_CHAR_MANDATORY 0x0f8f
97 #define GLS_CHAR_MEAS_CTX_SUP 0x0070
98 #define GLS_CHAR_FULL 0x0fff
106 #define GLS_FEAT_LOW_BATT (0x01 << 0)
107 #define GLS_FEAT_MALFUNC (0x01 << 1)
108 #define GLS_FEAT_SAMPLE_SIZE (0x01 << 2)
109 #define GLS_FEAT_INSERT_ERR (0x01 << 3)
110 #define GLS_FEAT_TYPE_ERR (0x01 << 4)
111 #define GLS_FEAT_RES_HIGH_LOW (0x01 << 5)
112 #define GLS_FEAT_TEMP_HIGH_LOW (0x01 << 6)
113 #define GLS_FEAT_READ_INT (0x01 << 7)
114 #define GLS_FEAT_GENERAL_FAULT (0x01 << 8)
115 #define GLS_FEAT_TIME_FAULT (0x01 << 9)
116 #define GLS_FEAT_MULTI_BOND (0x01 << 10)
117 #define GLS_FEAT_FULL (0x07ff)
126 #define GLS_MEAS_FLAG_TIME_OFFSET 0x01
127 #define GLS_MEAS_FLAG_CONC_TYPE_LOC 0x02
128 #define GLS_MEAS_FLAG_UNITS_KG_L 0x00
129 #define GLS_MEAS_FLAG_UNITS_MOL_L 0x04
130 #define GLS_MEAS_FLAG_SENSOR_STATUS 0x08
131 #define GLS_MEAS_FLAG_CONTEXT_INFO 0x10
139 #define GLS_MEAS_CTX_FLAG_CARB (0x01 << 0)
140 #define GLS_MEAS_CTX_FLAG_MEAL (0x01 << 1)
141 #define GLS_MEAS_CTX_FLAG_TESTER (0x01 << 2)
142 #define GLS_MEAS_CTX_FLAG_EXERCISE (0x01 << 3)
143 #define GLS_MEAS_CTX_FLAG_MED (0x01 << 4)
144 #define GLS_MEAS_CTX_FLAG_MED_KG (0x01 << 5)
145 #define GLS_MEAS_CTX_FLAG_MED_L (0x01 << 6)
146 #define GLS_MEAS_CTX_FLAG_HBA1C (0x01 << 7)
147 #define GLS_MEAS_CTX_FLAG_EXT (0x01 << 8)
155 #define GLS_MEAS_STATUS_BATT_LOW (0x01 << 0)
156 #define GLS_MEAS_STATUS_SENSOR_FAULT (0x01 << 1)
157 #define GLS_MEAS_STATUS_SAMPLE_SIZE (0x01 << 2)
158 #define GLS_MEAS_STATUS_STRIP_INSERT (0x01 << 3)
159 #define GLS_MEAS_STATUS_STRIP_TYPE (0x01 << 4)
160 #define GLS_MEAS_STATUS_RESULT_HIGH (0x01 << 5)
161 #define GLS_MEAS_STATUS_RESULT_LOW (0x01 << 6)
162 #define GLS_MEAS_STATUS_TEMP_HIGH (0x01 << 7)
163 #define GLS_MEAS_STATUS_TEMP_LOW (0x01 << 8)
164 #define GLS_MEAS_STATUS_STRIP_PULL (0x01 << 9)
165 #define GLS_MEAS_STATUS_GENERAL_FAULT (0x01 << 10)
166 #define GLS_MEAS_STATUS_TIME_FAULT (0x01 << 11)
int8_t exponent
Base 10 exponent, only 4 bits.
bool gls_new_meas_record(gls_rec_t *p_rec)
Record a new glucose measurement.
@ GLS_MEAS_CTX_TESTER_LAB
Lab test.
@ GLS_MEAS_CTX_CARB_SUPPER
Supper.
@ GLS_MEAS_CTX_CARB_BREAKFAST
Breakfast.
Glucose Measurement structure.
@ GLS_MEAS_LOC_EAR
Earlobe.
gls_meas_loc_t
Glucose measurement location.
prf_date_time_t base_time
Time stamp.
gls_ieee_float16_t glucose_concentration
Glucose concentration.
@ GLS_MEAS_CTX_MED_LONG
Long acting insulin.
uint8_t conn_idx
The index of the connection.
@ GLS_MEAS_TYPE_UNDET_BLOOD
Undetermined whole blood.
SFLOAT format (IEEE-11073 16-bit FLOAT, defined as a 16-bit value with 12-bit mantissa and 4-bit expo...
gls_ieee_float16_t medication
Medication.
gls_evt_type_t evt_type
The GLS event type.
@ GLS_EVT_CTRL_INDICATION_ENABLED
Record Access Control Point indication enabled event.
void(* gls_evt_handler_t)(gls_evt_t *p_evt)
Glucose Service event handler type.
uint16_t sequence_number
Sequence number.
gls_meas_type_t
Glucose measurement type.
@ GLS_MEAS_CTX_CARB_DRINK
Drink.
@ GLS_EVT_CTRL_INDICATION_DISABLED
Record Access Control Point indication disabled event.
gls_evt_handler_t evt_handler
Glucose Service event handler.
gls_meas_ctx_health_t
Glucose measurement context health.
@ GLS_MEAS_CTX_MED_PREMIX
Pre-mixed insulin.
@ GLS_MEAS_TYPE_UNDET_PLASMA
Undetermined plasma.
@ GLS_EVT_MEAS_NOTIFICATION_DISABLED
Glucose Measurement notification disabled event.
@ GLS_MEAS_CTX_MEAL_PREPRANDIAL
Preprandial (before meal)
@ GLS_MEAS_CTX_HEALTH_MAJOR
Major health issues.
gls_meas_ctx_carb_id_t
Glucose measurement context carbohydrate ID.
@ GLS_MEAS_CTX_TESTER_SELF
Self.
@ GLS_MEAS_LOC_FINGER
Finger.
uint8_t tester_and_health
Tester and health.
uint16_t exercise_duration
Exercise Duration.
@ GLS_MEAS_CTX_MED_RAPID
Rapid acting insulin.
@ GLS_MEAS_TYPE_CONTROL
Control solution.
@ GLS_MEAS_TYPE_CAP_PLASMA
Capillary plasma.
@ GLS_MEAS_LOC_CONTROL
Control solution.
@ GLS_MEAS_CTX_MEAL_CASUAL
Casual (snacks, drinks, etc.)
@ GLS_EVT_CTX_NOTIFICATION_ENABLED
Glucose Measurement Context notification enabled event.
int16_t mantissa
Mantissa, only 12 bits.
@ GLS_MEAS_CTX_MED_INTERMED
Intermediate acting insulin.
uint8_t exercise_intensity
Exercise Intensity.
@ GLS_MEAS_CTX_CARB_BRUNCH
Brunch.
@ GLS_EVT_MEAS_NOTIFICATION_ENABLED
Glucose Measurement notification enabled event.
@ GLS_MEAS_CTX_TESTER_PRO
Health care professional.
sdk_err_t gls_racp_rsp_send(uint8_t conn_idx, uint8_t *p_data, uint16_t length)
Send RACP responce if indication has been enabled.
@ GLS_MEAS_CTX_CARB_DINNER
Dinner.
@ GLS_MEAS_TYPE_VEN_BLOOD
Venous whole blood.
@ GLS_MEAS_TYPE_ART_BLOOD
Arterial whole blood.
@ GLS_MEAS_CTX_HEALTH_MINOR
Minor health issues.
uint16_t sdk_err_t
SDK API result type.
uint8_t sample_location
Sample location.
sdk_err_t gls_service_init(gls_init_t *p_gls_init)
Initialize a Glucose Service instance and add in the DB.
@ GLS_MEAS_CTX_TESTER_NOT_AVAIL
Tester value not available.
The date and time structure.
@ GLS_MEAS_CTX_CARB_SNACK
Snack.
@ GLS_MEAS_CTX_HEALTH_NOT_AVAIL
Health value not available.
@ GLS_MEAS_LOC_AST
Alternate Site Test (AST)
@ GLS_MEAS_CTX_HEALTH_MENSES
During menses.
gls_ieee_float16_t carbohydrate
Carbohydrate.
int16_t time_offset
Time offset.
gls_meas_val_t meas_val
Glucose measurement value.
@ GLS_MEAS_TYPE_ART_PLASMA
Arterial plasma.
@ GLS_MEAS_CTX_HEALTH_NONE
No health issues.
uint16_t sensor_status_annunciation
Sensor status annunciation.
@ GLS_EVT_CTX_NOTIFICATION_DISABLED
Glucose Measurement Context notification disabled event.
gls_meas_ctx_tester_t
Glucose measurement context tester.
@ GLS_MEAS_TYPE_CAP_BLOOD
Capillary whole blood.
uint8_t medication_id
Medication ID.
@ GLS_EVT_CTRL_WRITE
Record Access Control Point write.
@ GLS_MEAS_CTX_MEAL_BEDTIME
Bedtime.
@ GLS_MEAS_CTX_CARB_LUNCH
Lunch.
uint16_t char_mask
Initial mask of supported characteristics, and configured with Characteristics Mask.
Glucose Service init stucture.
gls_meas_ctx_medic_id_t
Glucose measurement context medication ID.
Glucose measurement context structure.
Profile/Service Utilities API.
@ GLS_MEAS_CTX_MEAL_FASTING
Fasting.
@ GLS_EVT_INVALID
Invalid event.
gls_evt_type_t
Glucose Service event type.
uint8_t carbohydrate_id
Carbohydrate ID.
@ GLS_MEAS_CTX_MEAL_POSTPRANDIAL
Postprandial (after meal)
Glucose measurement record.
uint16_t feature
Initial value for features.
@ GLS_MEAS_TYPE_FLUID
Interstitial fluid (ISF)
uint16_t length
Length of event data.
@ GLS_MEAS_TYPE_VEN_PLASMA
Venous plasma.
@ GLS_MEAS_CTX_MED_SHORT
Short acting insulin.
gls_meas_ctx_t meas_ctx
Glucose measurement context.
@ GLS_MEAS_CTX_HEALTH_STRESS
Under stress.
@ GLS_MEAS_LOC_NOT_AVAIL
Sample Location value not available.
const uint8_t * p_data
Pointer to event data.
gls_meas_ctx_meal_t
Glucose measurement context meal.
uint8_t extended_flags
Extended Flags.