gls.h
Go to the documentation of this file.
1 /**
2 ****************************************************************************************
3 *
4 * @file gls.h
5 *
6 * @brief Glucose Service API.
7 *
8 ****************************************************************************************
9 * @attention
10 #####Copyright (c) 2019 GOODIX
11 All rights reserved.
12
13 Redistribution and use in source and binary forms, with or without
14 modification, are permitted provided that the following conditions are met:
15 * Redistributions of source code must retain the above copyright
16 notice, this list of conditions and the following disclaimer.
17 * Redistributions in binary form must reproduce the above copyright
18 notice, this list of conditions and the following disclaimer in the
19 documentation and/or other materials provided with the distribution.
20 * Neither the name of GOODIX nor the names of its contributors may be used
21 to endorse or promote products derived from this software without
22 specific prior written permission.
23
24 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
25 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27 ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE
28 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
29 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
30 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
31 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
32 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
33 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34 POSSIBILITY OF SUCH DAMAGE.
35 *****************************************************************************************
36 */
37
38 /**
39 * @addtogroup BLE_SRV BLE Services
40 * @{
41 * @brief Definitions and prototypes for the BLE Service interface.
42 */
43
44 /**
45 * @defgroup BLE_SDK_GLS Glucose Service (GLS)
46 * @{
47 * @brief Glucose Service module.
48 *
49 * @details The Glucose Service exposes glucose and other data related to a personal glucose
50 * sensor for consumer healthcare applications and is not designed for clinical use.
51 * This module implements the Glucose Service with Glucose Measurement, Glucose Measurement
52 * Context, Glucose Feature and Record Access Control Point characteristics.
53 *
54 * After \ref gls_init_t variable is intialized, the application must call \ref gls_service_init()
55 * to add Glucose Service and Glucose Measurement, Glucose Measurement Context, Glucose
56 * Feature and Record Access Control Point characteristics to the BLE Stack database
57 * according to \ref gls_init_t.char_mask.
58 */
59
60 #ifndef __GLS_H__
61 #define __GLS_H__
62
63 /*
64 * INCLUDE FILES
65 ****************************************************************************************
66 */
67 #include "gr55xx_sys.h"
68 #include "custom_config.h"
69 #include "ble_prf_utils.h"
70 #include <stdint.h>
71 #include <stdbool.h>
72
73 /**
74 * @defgroup GLS_MACRO Defines
75 * @{
76 */
77 #define GLS_CONNECTION_MAX (10 < CFG_MAX_CONNECTIONS ?\
78 10 : CFG_MAX_CONNECTIONS) /**< Maximum number of Glucose Profile connections. */
79 #define GLS_MEAS_VAL_LEN_MAX 20 /**< Maximum length of GLS measurement value. */
80 #define GLS_MEAS_CTX_LEN_MAX 20 /**< Maximum length of GLS measurement context value. */
81 #define GLS_REC_ACCESS_CTRL_LEN_MIN 2 /**< Minimum length of Record Access Control Point packet. */
82 #define GLS_REC_ACCESS_CTRL_LEN_MAX 21 /**< Maximum length of Record Access Control Point packet. */
83
84
85 #define GLS_NTF_OF_NULL 0x00 /**< Mask for no notify. */
86 #define GLS_NTF_OF_MEAS 0x01 /**< Mask for measurement notify. */
87 #define GLS_NTF_OF_MEAS_CTX 0x10 /**< Mask for measurement context notify. */
88
89 #define GLS_ERROR_PROC_IN_PROCESS 0x80 /**< Error code: A previously triggered SC Control Point operation is still in progress. */
90 #define GLS_ERROR_CCCD_INVALID 0x81 /**< Error code: The Client Characteristic Configuration descriptor is not configured. */
91
92 /**
93 * @defgroup GLS_CHAR_MASK Characteristics Mask
94 * @{
95 * @brief Bit masks for the initialization of \ref gls_init_t.char_mask.
96 */
97 #define GLS_CHAR_MANDATORY 0x0f8f /**< Bit mask for mandatory characteristic in GLS. */
98 #define GLS_CHAR_MEAS_CTX_SUP 0x0070 /**< Bit mask for Glucose Measurement Context characteristic that is optional. */
99 #define GLS_CHAR_FULL 0x0fff /**< Bit mask of the full characteristic. */
100 /** @} */
101
102 /**
103 * @defgroup GLS_FEAT Glucose Feature
104 * @{
105 * @brief Glucose Service feature.
106 */
107 #define GLS_FEAT_LOW_BATT (0x01 << 0) /**< Low Battery Detection During Measurement Supported */
108 #define GLS_FEAT_MALFUNC (0x01 << 1) /**< Sensor Malfunction Detection Supported */
109 #define GLS_FEAT_SAMPLE_SIZE (0x01 << 2) /**< Sensor Sample Size Supported */
110 #define GLS_FEAT_INSERT_ERR (0x01 << 3) /**< Sensor Strip Insertion Error Detection Supported */
111 #define GLS_FEAT_TYPE_ERR (0x01 << 4) /**< Sensor Strip Type Error Detection Supported */
112 #define GLS_FEAT_RES_HIGH_LOW (0x01 << 5) /**< Sensor Result High-Low Detection Supported */
113 #define GLS_FEAT_TEMP_HIGH_LOW (0x01 << 6) /**< Sensor Temperature High-Low Detection Supported */
114 #define GLS_FEAT_READ_INT (0x01 << 7) /**< Sensor Read Interrupt Detection Supported */
115 #define GLS_FEAT_GENERAL_FAULT (0x01 << 8) /**< General Device Fault Supported */
116 #define GLS_FEAT_TIME_FAULT (0x01 << 9) /**< Time Fault Supported */
117 #define GLS_FEAT_MULTI_BOND (0x01 << 10) /**< Multiple Bond Supported */
118 #define GLS_FEAT_FULL (0x07ff) /**< All feature Supported. */
119 /** @} */
120
121
122 /**
123 * @defgroup GLS_MEAS_FLAG Measurement Flag
124 * @{
125 * @brief Glucose Measurement Flags.
126 */
127 #define GLS_MEAS_FLAG_TIME_OFFSET 0x01 /**< Time Offset Present */
128 #define GLS_MEAS_FLAG_CONC_TYPE_LOC 0x02 /**< Glucose Concentration, Type, and Sample Location Present */
129 #define GLS_MEAS_FLAG_UNITS_KG_L 0x00 /**< Glucose Concentration Units kg/L */
130 #define GLS_MEAS_FLAG_UNITS_MOL_L 0x04 /**< Glucose Concentration Units mol/L */
131 #define GLS_MEAS_FLAG_SENSOR_STATUS 0x08 /**< Sensor Status Annunciation Present */
132 #define GLS_MEAS_FLAG_CONTEXT_INFO 0x10 /**< Context Information Follows */
133 /** @} */
134
135 /**
136 * @defgroup GLS_MEAS_CTX_FLAG Measurement Context Flag
137 * @{
138 * @brief Glucose measurement context flags
139 */
140 #define GLS_MEAS_CTX_FLAG_CARB (0x01 << 0) /**< Carbohydrate id and carbohydrate present */
141 #define GLS_MEAS_CTX_FLAG_MEAL (0x01 << 1) /**< Meal present */
142 #define GLS_MEAS_CTX_FLAG_TESTER (0x01 << 2) /**< Tester-health present */
143 #define GLS_MEAS_CTX_FLAG_EXERCISE (0x01 << 3) /**< Exercise duration and exercise intensity present */
144 #define GLS_MEAS_CTX_FLAG_MED (0x01 << 4) /**< Medication ID and medication present */
145 #define GLS_MEAS_CTX_FLAG_MED_KG (0x01 << 5) /**< Medication value units, kilograms */
146 #define GLS_MEAS_CTX_FLAG_MED_L (0x01 << 6) /**< Medication value units, liters */
147 #define GLS_MEAS_CTX_FLAG_HBA1C (0x01 << 7) /**< Hba1c present */
148 #define GLS_MEAS_CTX_FLAG_EXT (0x01 << 8) /**< Extended flags present */
149 /** @} */
150
151 /**
152 * @defgroup GLS_MEAS_STATUS Measurement Status
153 * @{
154 * @brief Glucose measurement status annunciation.
155 */
156 #define GLS_MEAS_STATUS_BATT_LOW (0x01 << 0) /**< Device battery low at time of measurement */
157 #define GLS_MEAS_STATUS_SENSOR_FAULT (0x01 << 1) /**< Sensor malfunction or faulting at time of measurement */
158 #define GLS_MEAS_STATUS_SAMPLE_SIZE (0x01 << 2) /**< Sample size for blood or control solution insufficient at time of measurement */
159 #define GLS_MEAS_STATUS_STRIP_INSERT (0x01 << 3) /**< Strip insertion error */
160 #define GLS_MEAS_STATUS_STRIP_TYPE (0x01 << 4) /**< Strip type incorrect for device */
161 #define GLS_MEAS_STATUS_RESULT_HIGH (0x01 << 5) /**< Sensor result higher than the device can process */
162 #define GLS_MEAS_STATUS_RESULT_LOW (0x01 << 6) /**< Sensor result lower than the device can process */
163 #define GLS_MEAS_STATUS_TEMP_HIGH (0x01 << 7) /**< Sensor temperature too high for valid test/result at time of measurement */
164 #define GLS_MEAS_STATUS_TEMP_LOW (0x01 << 8) /**< Sensor temperature too low for valid test/result at time of measurement */
165 #define GLS_MEAS_STATUS_STRIP_PULL (0x01 << 9) /**< Sensor read interrupted because strip was pulled too soon at time of measurement */
166 #define GLS_MEAS_STATUS_GENERAL_FAULT (0x01 << 10) /**< General device fault has occurred in the sensor */
167 #define GLS_MEAS_STATUS_TIME_FAULT (0x01 << 11) /**< Time fault has occurred in the sensor and time may be inaccurate */
168 /** @} */
169 /** @} */
170
171 /**
172 * @defgroup GLS_ENUM Enumerations
173 * @{
174 */
175 /**@brief Glucose measurement type */
176 typedef enum
177 {
178 GLS_MEAS_TYPE_CAP_BLOOD = 0x01, /**< Capillary whole blood */
179 GLS_MEAS_TYPE_CAP_PLASMA, /**< Capillary plasma */
180 GLS_MEAS_TYPE_VEN_BLOOD, /**< Venous whole blood */
181 GLS_MEAS_TYPE_VEN_PLASMA, /**< Venous plasma */
182 GLS_MEAS_TYPE_ART_BLOOD, /**< Arterial whole blood */
183 GLS_MEAS_TYPE_ART_PLASMA, /**< Arterial plasma */
184 GLS_MEAS_TYPE_UNDET_BLOOD, /**< Undetermined whole blood */
185 GLS_MEAS_TYPE_UNDET_PLASMA, /**< Undetermined plasma */
186 GLS_MEAS_TYPE_FLUID, /**< Interstitial fluid (ISF) */
187 GLS_MEAS_TYPE_CONTROL, /**< Control solution */
188 } gls_meas_type_t;
189
190 /**@brief Glucose measurement location */
191 typedef enum
192 {
193 GLS_MEAS_LOC_FINGER = 0x01, /**< Finger */
194 GLS_MEAS_LOC_AST, /**< Alternate Site Test (AST) */
195 GLS_MEAS_LOC_EAR, /**< Earlobe */
196 GLS_MEAS_LOC_CONTROL, /**< Control solution */
197 GLS_MEAS_LOC_NOT_AVAIL = 0x0f, /**< Sample Location value not available */
198 } gls_meas_loc_t;
199
200 /**@brief Glucose measurement context carbohydrate ID */
201 typedef enum
202 {
203 GLS_MEAS_CTX_CARB_BREAKFAST = 0x01, /**< Breakfast */
204 GLS_MEAS_CTX_CARB_LUNCH, /**< Lunch */
205 GLS_MEAS_CTX_CARB_DINNER, /**< Dinner */
206 GLS_MEAS_CTX_CARB_SNACK, /**< Snack */
207 GLS_MEAS_CTX_CARB_DRINK, /**< Drink */
208 GLS_MEAS_CTX_CARB_SUPPER, /**< Supper */
209 GLS_MEAS_CTX_CARB_BRUNCH, /**< Brunch */
210 } gls_meas_ctx_carb_id_t;
211
212 /**@brief Glucose measurement context meal */
213 typedef enum
214 {
215 GLS_MEAS_CTX_MEAL_PREPRANDIAL = 0x01, /**< Preprandial (before meal) */
216 GLS_MEAS_CTX_MEAL_POSTPRANDIAL, /**< Postprandial (after meal) */
217 GLS_MEAS_CTX_MEAL_FASTING, /**< Fasting */
218 GLS_MEAS_CTX_MEAL_CASUAL, /**< Casual (snacks, drinks, etc.) */
219 GLS_MEAS_CTX_MEAL_BEDTIME, /**< Bedtime */
220 } gls_meas_ctx_meal_t;
221
222 /**@brief Glucose measurement context tester */
223 typedef enum
224 {
225 GLS_MEAS_CTX_TESTER_SELF = 0x01, /**< Self */
226 GLS_MEAS_CTX_TESTER_PRO, /**< Health care professional */
227 GLS_MEAS_CTX_TESTER_LAB, /**< Lab test */
228 GLS_MEAS_CTX_TESTER_NOT_AVAIL = 0x0f, /**< Tester value not available */
229 } gls_meas_ctx_tester_t;
230
231 /**@brief Glucose measurement context health */
232 typedef enum
233 {
234 GLS_MEAS_CTX_HEALTH_MINOR = 0x01, /**< Minor health issues */
235 GLS_MEAS_CTX_HEALTH_MAJOR, /**< Major health issues */
236 GLS_MEAS_CTX_HEALTH_MENSES, /**< During menses */
237 GLS_MEAS_CTX_HEALTH_STRESS, /**< Under stress */
238 GLS_MEAS_CTX_HEALTH_NONE, /**< No health issues */
239 GLS_MEAS_CTX_HEALTH_NOT_AVAIL = 0x0f, /**< Health value not available */
240 } gls_meas_ctx_health_t;
241
242 /**@brief Glucose measurement context medication ID */
243 typedef enum
244 {
245 GLS_MEAS_CTX_MED_RAPID = 0x01, /**< Rapid acting insulin */
246 GLS_MEAS_CTX_MED_SHORT, /**< Short acting insulin */
247 GLS_MEAS_CTX_MED_INTERMED, /**< Intermediate acting insulin */
248 GLS_MEAS_CTX_MED_LONG, /**< Long acting insulin */
249 GLS_MEAS_CTX_MED_PREMIX, /**< Pre-mixed insulin */
250 } gls_meas_ctx_medic_id_t;
251
252 /**@brief Glucose Service event type. */
253 typedef enum
254 {
255 GLS_EVT_INVALID = 0x00, /**< Invalid event. */
256 GLS_EVT_MEAS_NOTIFICATION_ENABLED, /**< Glucose Measurement notification enabled event. */
257 GLS_EVT_MEAS_NOTIFICATION_DISABLED, /**< Glucose Measurement notification disabled event. */
258 GLS_EVT_CTX_NOTIFICATION_ENABLED, /**< Glucose Measurement Context notification enabled event. */
259 GLS_EVT_CTX_NOTIFICATION_DISABLED, /**< Glucose Measurement Context notification disabled event. */
260 GLS_EVT_CTRL_INDICATION_ENABLED, /**< Record Access Control Point indication enabled event. */
261 GLS_EVT_CTRL_INDICATION_DISABLED, /**< Record Access Control Point indication disabled event. */
262 GLS_EVT_CTRL_WRITE, /**< Record Access Control Point write. */
263 } gls_evt_type_t;
264 /** @} */
265
266 /**
267 * @defgroup GLS_STRUCT Structures
268 * @{
269 */
270 /**@brief SFLOAT format (IEEE-11073 16-bit FLOAT, defined as a 16-bit value with 12-bit mantissa and 4-bit exponent). */
271 typedef struct
272 {
273 int8_t exponent; /**< Base 10 exponent, only 4 bits. */
274 int16_t mantissa; /**< Mantissa, only 12 bits. */
275 } ieee_float16_t;
276
277 /**@brief Glucose Service event. */
278 typedef struct
279 {
280 gls_evt_type_t evt_type; /**< The GLS event type. */
281 uint8_t conn_idx; /**< The index of the connection. */
282 const uint8_t *p_data; /**< Pointer to event data. */
283 uint16_t length; /**< Length of event data. */
284 } gls_evt_t;
285 /** @} */
286
287 /**
288 * @defgroup GLS_TYPEDEF Typedefs
289 * @{
290 */
291 /**@brief Glucose Service event handler type.*/
292 typedef void (*gls_evt_handler_t)(gls_evt_t *p_evt);
293 /** @} */
294
295 /**
296 * @defgroup GLS_STRUCT Structures
297 * @{
298 */
299 /**@brief Glucose Measurement structure. This contains glucose measurement value. */
300 typedef struct
301 {
302 uint8_t flags; /**< Flags. */
303 uint16_t sequence_number; /**< Sequence number. */
304 prf_date_time_t base_time; /**< Time stamp. */
305 int16_t time_offset; /**< Time offset. */
306 ieee_float16_t glucose_concentration; /**< Glucose concentration. */
307 uint8_t type; /**< Type. */
308 uint8_t sample_location; /**< Sample location. */
309 uint16_t sensor_status_annunciation; /**< Sensor status annunciation. */
310 } gls_meas_val_t;
311
312 /**@brief Glucose measurement context structure */
313 typedef struct
314 {
315 uint8_t flags; /**< Flags. */
316 uint8_t extended_flags; /**< Extended Flags. */
317 uint8_t carbohydrate_id; /**< Carbohydrate ID. */
318 ieee_float16_t carbohydrate; /**< Carbohydrate. */
319 uint8_t meal; /**< Meal. */
320 uint8_t tester_and_health; /**< Tester and health. */
321 uint16_t exercise_duration; /**< Exercise Duration. */
322 uint8_t exercise_intensity; /**< Exercise Intensity. */
323 uint8_t medication_id; /**< Medication ID. */
324 ieee_float16_t medication; /**< Medication. */
325 uint16_t hba1c; /**< HbA1c. */
326 } gls_meas_ctx_t;
327
328 /**@brief Glucose measurement record */
329 typedef struct
330 {
331 gls_meas_val_t meas_val; /**< Glucose measurement value. */
332 gls_meas_ctx_t meas_ctx; /**< Glucose measurement context. */
333 } gls_rec_t;
334
335 /**@brief Glucose Service init stucture. This contains all option and data needed for initialization of the service. */
336 typedef struct
337 {
338 gls_evt_handler_t evt_handler; /**< Glucose Service event handler. */
339 uint16_t char_mask; /**< Initial mask of supported characteristics, and configured with \ref GLS_CHAR_MASK. */
340 uint16_t feature; /**< Initial value for features. */
341 } gls_init_t;
342 /** @} */
343
344 /**
345 * @defgroup GLS_FUNCTION Functions
346 * @{
347 */
348 /**
349 *****************************************************************************************
350 * @brief Initialize a Glucose Service instance and add in the DB.
351 *
352 * @param[in] p_gls_init: Pointer to gls_init_t Service initialization variable
353 *
354 * @return Result of service initialization.
355 *****************************************************************************************
356 */
357 sdk_err_t gls_service_init(gls_init_t *p_gls_init);
358
359 /**
360 *****************************************************************************************
361 * @brief Record a new glucose measurement.
362 *
363 * @param[in] p_rec: Pointer to glucose record (measurement plus context).
364 *
365 * @return If record successfully or not.
366 *****************************************************************************************
367 */
368 bool gls_new_meas_record(gls_rec_t *p_rec);
369
370 /**
371 *****************************************************************************************
372 * @brief Send RACP responce if indication has been enabled.
373 *
374 * @param[in] conn_idx: Connnection index.
375 * @param[in] p_data: Pointer to data.
376 * @param[in] length: Length of data.
377 *
378 * @return Result of indicate value
379 *****************************************************************************************
380 */
381 sdk_err_t gls_racp_rsp_send(uint8_t conn_idx, uint8_t *p_data, uint16_t length);
382 /** @} */
383
384 #endif
385 /** @} */
386 /** @} */
387
gls_new_meas_record
bool gls_new_meas_record(gls_rec_t *p_rec)
Record a new glucose measurement.
GLS_MEAS_CTX_TESTER_LAB
@ GLS_MEAS_CTX_TESTER_LAB
Lab test.
Definition: gls.h:227
GLS_MEAS_CTX_CARB_SUPPER
@ GLS_MEAS_CTX_CARB_SUPPER
Supper.
Definition: gls.h:208
GLS_MEAS_CTX_CARB_BREAKFAST
@ GLS_MEAS_CTX_CARB_BREAKFAST
Breakfast.
Definition: gls.h:203
gls_meas_val_t
Glucose Measurement structure.
Definition: gls.h:301
GLS_MEAS_LOC_EAR
@ GLS_MEAS_LOC_EAR
Earlobe.
Definition: gls.h:195
gls_meas_loc_t
gls_meas_loc_t
Glucose measurement location.
Definition: gls.h:192
gls_meas_ctx_t::carbohydrate
ieee_float16_t carbohydrate
Carbohydrate.
Definition: gls.h:318
gls_meas_val_t::base_time
prf_date_time_t base_time
Time stamp.
Definition: gls.h:304
GLS_MEAS_CTX_MED_LONG
@ GLS_MEAS_CTX_MED_LONG
Long acting insulin.
Definition: gls.h:248
gls_evt_t::conn_idx
uint8_t conn_idx
The index of the connection.
Definition: gls.h:281
GLS_MEAS_TYPE_UNDET_BLOOD
@ GLS_MEAS_TYPE_UNDET_BLOOD
Undetermined whole blood.
Definition: gls.h:184
gls_evt_t::evt_type
gls_evt_type_t evt_type
The GLS event type.
Definition: gls.h:280
GLS_EVT_CTRL_INDICATION_ENABLED
@ GLS_EVT_CTRL_INDICATION_ENABLED
Record Access Control Point indication enabled event.
Definition: gls.h:260
gls_meas_ctx_t::medication
ieee_float16_t medication
Medication.
Definition: gls.h:324
gls_evt_handler_t
void(* gls_evt_handler_t)(gls_evt_t *p_evt)
Glucose Service event handler type.
Definition: gls.h:292
gls_meas_val_t::sequence_number
uint16_t sequence_number
Sequence number.
Definition: gls.h:303
gr55xx_sys.h
GR55XX System API.
gls_meas_type_t
gls_meas_type_t
Glucose measurement type.
Definition: gls.h:177
GLS_MEAS_CTX_CARB_DRINK
@ GLS_MEAS_CTX_CARB_DRINK
Drink.
Definition: gls.h:207
gls_meas_val_t::type
uint8_t type
Type.
Definition: gls.h:307
GLS_EVT_CTRL_INDICATION_DISABLED
@ GLS_EVT_CTRL_INDICATION_DISABLED
Record Access Control Point indication disabled event.
Definition: gls.h:261
gls_init_t::evt_handler
gls_evt_handler_t evt_handler
Glucose Service event handler.
Definition: gls.h:338
gls_meas_ctx_health_t
gls_meas_ctx_health_t
Glucose measurement context health.
Definition: gls.h:233
GLS_MEAS_CTX_MED_PREMIX
@ GLS_MEAS_CTX_MED_PREMIX
Pre-mixed insulin.
Definition: gls.h:249
GLS_MEAS_TYPE_UNDET_PLASMA
@ GLS_MEAS_TYPE_UNDET_PLASMA
Undetermined plasma.
Definition: gls.h:185
GLS_EVT_MEAS_NOTIFICATION_DISABLED
@ GLS_EVT_MEAS_NOTIFICATION_DISABLED
Glucose Measurement notification disabled event.
Definition: gls.h:257
GLS_MEAS_CTX_MEAL_PREPRANDIAL
@ GLS_MEAS_CTX_MEAL_PREPRANDIAL
Preprandial (before meal)
Definition: gls.h:215
GLS_MEAS_CTX_HEALTH_MAJOR
@ GLS_MEAS_CTX_HEALTH_MAJOR
Major health issues.
Definition: gls.h:235
gls_meas_ctx_carb_id_t
gls_meas_ctx_carb_id_t
Glucose measurement context carbohydrate ID.
Definition: gls.h:202
gls_meas_ctx_t::flags
uint8_t flags
Flags.
Definition: gls.h:315
GLS_MEAS_CTX_TESTER_SELF
@ GLS_MEAS_CTX_TESTER_SELF
Self.
Definition: gls.h:225
GLS_MEAS_LOC_FINGER
@ GLS_MEAS_LOC_FINGER
Finger.
Definition: gls.h:193
gls_meas_ctx_t::tester_and_health
uint8_t tester_and_health
Tester and health.
Definition: gls.h:320
gls_meas_val_t::glucose_concentration
ieee_float16_t glucose_concentration
Glucose concentration.
Definition: gls.h:306
gls_meas_ctx_t::exercise_duration
uint16_t exercise_duration
Exercise Duration.
Definition: gls.h:321
GLS_MEAS_CTX_MED_RAPID
@ GLS_MEAS_CTX_MED_RAPID
Rapid acting insulin.
Definition: gls.h:245
GLS_MEAS_TYPE_CONTROL
@ GLS_MEAS_TYPE_CONTROL
Control solution.
Definition: gls.h:187
GLS_MEAS_TYPE_CAP_PLASMA
@ GLS_MEAS_TYPE_CAP_PLASMA
Capillary plasma.
Definition: gls.h:179
GLS_MEAS_LOC_CONTROL
@ GLS_MEAS_LOC_CONTROL
Control solution.
Definition: gls.h:196
GLS_MEAS_CTX_MEAL_CASUAL
@ GLS_MEAS_CTX_MEAL_CASUAL
Casual (snacks, drinks, etc.)
Definition: gls.h:218
GLS_EVT_CTX_NOTIFICATION_ENABLED
@ GLS_EVT_CTX_NOTIFICATION_ENABLED
Glucose Measurement Context notification enabled event.
Definition: gls.h:258
GLS_MEAS_CTX_MED_INTERMED
@ GLS_MEAS_CTX_MED_INTERMED
Intermediate acting insulin.
Definition: gls.h:247
gls_evt_t
Glucose Service event.
Definition: gls.h:279
gls_meas_ctx_t::exercise_intensity
uint8_t exercise_intensity
Exercise Intensity.
Definition: gls.h:322
GLS_MEAS_CTX_CARB_BRUNCH
@ GLS_MEAS_CTX_CARB_BRUNCH
Brunch.
Definition: gls.h:209
GLS_EVT_MEAS_NOTIFICATION_ENABLED
@ GLS_EVT_MEAS_NOTIFICATION_ENABLED
Glucose Measurement notification enabled event.
Definition: gls.h:256
GLS_MEAS_CTX_TESTER_PRO
@ GLS_MEAS_CTX_TESTER_PRO
Health care professional.
Definition: gls.h:226
gls_racp_rsp_send
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
@ GLS_MEAS_CTX_CARB_DINNER
Dinner.
Definition: gls.h:205
GLS_MEAS_TYPE_VEN_BLOOD
@ GLS_MEAS_TYPE_VEN_BLOOD
Venous whole blood.
Definition: gls.h:180
GLS_MEAS_TYPE_ART_BLOOD
@ GLS_MEAS_TYPE_ART_BLOOD
Arterial whole blood.
Definition: gls.h:182
GLS_MEAS_CTX_HEALTH_MINOR
@ GLS_MEAS_CTX_HEALTH_MINOR
Minor health issues.
Definition: gls.h:234
sdk_err_t
uint16_t sdk_err_t
SDK API result type.
Definition: ble_error.h:243
gls_meas_val_t::sample_location
uint8_t sample_location
Sample location.
Definition: gls.h:308
gls_service_init
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
@ GLS_MEAS_CTX_TESTER_NOT_AVAIL
Tester value not available.
Definition: gls.h:228
prf_date_time_t
The date and time structure.
Definition: ble_prf_types.h:101
GLS_MEAS_CTX_CARB_SNACK
@ GLS_MEAS_CTX_CARB_SNACK
Snack.
Definition: gls.h:206
GLS_MEAS_CTX_HEALTH_NOT_AVAIL
@ GLS_MEAS_CTX_HEALTH_NOT_AVAIL
Health value not available.
Definition: gls.h:239
GLS_MEAS_LOC_AST
@ GLS_MEAS_LOC_AST
Alternate Site Test (AST)
Definition: gls.h:194
GLS_MEAS_CTX_HEALTH_MENSES
@ GLS_MEAS_CTX_HEALTH_MENSES
During menses.
Definition: gls.h:236
gls_meas_val_t::flags
uint8_t flags
Flags.
Definition: gls.h:302
gls_meas_val_t::time_offset
int16_t time_offset
Time offset.
Definition: gls.h:305
gls_rec_t::meas_val
gls_meas_val_t meas_val
Glucose measurement value.
Definition: gls.h:331
GLS_MEAS_TYPE_ART_PLASMA
@ GLS_MEAS_TYPE_ART_PLASMA
Arterial plasma.
Definition: gls.h:183
GLS_MEAS_CTX_HEALTH_NONE
@ GLS_MEAS_CTX_HEALTH_NONE
No health issues.
Definition: gls.h:238
gls_meas_val_t::sensor_status_annunciation
uint16_t sensor_status_annunciation
Sensor status annunciation.
Definition: gls.h:309
GLS_EVT_CTX_NOTIFICATION_DISABLED
@ GLS_EVT_CTX_NOTIFICATION_DISABLED
Glucose Measurement Context notification disabled event.
Definition: gls.h:259
gls_meas_ctx_tester_t
gls_meas_ctx_tester_t
Glucose measurement context tester.
Definition: gls.h:224
GLS_MEAS_TYPE_CAP_BLOOD
@ GLS_MEAS_TYPE_CAP_BLOOD
Capillary whole blood.
Definition: gls.h:178
gls_meas_ctx_t::medication_id
uint8_t medication_id
Medication ID.
Definition: gls.h:323
gls_meas_ctx_t::hba1c
uint16_t hba1c
HbA1c.
Definition: gls.h:325
GLS_EVT_CTRL_WRITE
@ GLS_EVT_CTRL_WRITE
Record Access Control Point write.
Definition: gls.h:262
GLS_MEAS_CTX_MEAL_BEDTIME
@ GLS_MEAS_CTX_MEAL_BEDTIME
Bedtime.
Definition: gls.h:219
gls_meas_ctx_t::meal
uint8_t meal
Meal.
Definition: gls.h:319
GLS_MEAS_CTX_CARB_LUNCH
@ GLS_MEAS_CTX_CARB_LUNCH
Lunch.
Definition: gls.h:204
gls_init_t::char_mask
uint16_t char_mask
Initial mask of supported characteristics, and configured with Characteristics Mask.
Definition: gls.h:339
gls_init_t
Glucose Service init stucture.
Definition: gls.h:337
gls_meas_ctx_medic_id_t
gls_meas_ctx_medic_id_t
Glucose measurement context medication ID.
Definition: gls.h:244
gls_meas_ctx_t
Glucose measurement context structure.
Definition: gls.h:314
ble_prf_utils.h
Profile/Service Utilities API.
GLS_MEAS_CTX_MEAL_FASTING
@ GLS_MEAS_CTX_MEAL_FASTING
Fasting.
Definition: gls.h:217
GLS_EVT_INVALID
@ GLS_EVT_INVALID
Invalid event.
Definition: gls.h:255
gls_evt_type_t
gls_evt_type_t
Glucose Service event type.
Definition: gls.h:254
gls_meas_ctx_t::carbohydrate_id
uint8_t carbohydrate_id
Carbohydrate ID.
Definition: gls.h:317
GLS_MEAS_CTX_MEAL_POSTPRANDIAL
@ GLS_MEAS_CTX_MEAL_POSTPRANDIAL
Postprandial (after meal)
Definition: gls.h:216
ieee_float16_t
SFLOAT format (IEEE-11073 16-bit FLOAT, defined as a 16-bit value with 12-bit mantissa and 4-bit expo...
Definition: bps.h:139
gls_rec_t
Glucose measurement record.
Definition: gls.h:330
gls_init_t::feature
uint16_t feature
Initial value for features.
Definition: gls.h:340
GLS_MEAS_TYPE_FLUID
@ GLS_MEAS_TYPE_FLUID
Interstitial fluid (ISF)
Definition: gls.h:186
gls_evt_t::length
uint16_t length
Length of event data.
Definition: gls.h:283
GLS_MEAS_TYPE_VEN_PLASMA
@ GLS_MEAS_TYPE_VEN_PLASMA
Venous plasma.
Definition: gls.h:181
GLS_MEAS_CTX_MED_SHORT
@ GLS_MEAS_CTX_MED_SHORT
Short acting insulin.
Definition: gls.h:246
gls_rec_t::meas_ctx
gls_meas_ctx_t meas_ctx
Glucose measurement context.
Definition: gls.h:332
GLS_MEAS_CTX_HEALTH_STRESS
@ GLS_MEAS_CTX_HEALTH_STRESS
Under stress.
Definition: gls.h:237
GLS_MEAS_LOC_NOT_AVAIL
@ GLS_MEAS_LOC_NOT_AVAIL
Sample Location value not available.
Definition: gls.h:197
gls_evt_t::p_data
const uint8_t * p_data
Pointer to event data.
Definition: gls.h:282
gls_meas_ctx_meal_t
gls_meas_ctx_meal_t
Glucose measurement context meal.
Definition: gls.h:214
gls_meas_ctx_t::extended_flags
uint8_t extended_flags
Extended Flags.
Definition: gls.h:316