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 "gr_includes.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 /**< Maximum number of Glucose Profile connections. */
78 #define GLS_MEAS_VAL_LEN_MAX 20 /**< Maximum length of GLS measurement value. */
79 #define GLS_MEAS_CTX_LEN_MAX 20 /**< Maximum length of GLS measurement context value. */
80 #define GLS_REC_ACCESS_CTRL_LEN_MIN 2 /**< Minimum length of Record Access Control Point packet. */
81 #define GLS_REC_ACCESS_CTRL_LEN_MAX 21 /**< Maximum length of Record Access Control Point packet. */
82
83
84 #define GLS_NTF_OF_NULL 0x00 /**< Mask for no notify. */
85 #define GLS_NTF_OF_MEAS 0x01 /**< Mask for measurement notify. */
86 #define GLS_NTF_OF_MEAS_CTX 0x10 /**< Mask for measurement context notify. */
87
88 #define GLS_ERROR_PROC_IN_PROCESS 0x80 /**< Error code: A previously triggered SC Control Point operation is still in progress. */
89 #define GLS_ERROR_CCCD_INVALID 0x81 /**< Error code: The Client Characteristic Configuration descriptor is not configured. */
90
91 /**
92 * @defgroup GLS_CHAR_MASK Characteristics Mask
93 * @{
94 * @brief Bit masks for the initialization of \ref gls_init_t.char_mask.
95 */
96 #define GLS_CHAR_MANDATORY 0x0f8f /**< Bit mask for mandatory characteristic in GLS. */
97 #define GLS_CHAR_MEAS_CTX_SUP 0x0070 /**< Bit mask for Glucose Measurement Context characteristic that is optional. */
98 #define GLS_CHAR_FULL 0x0fff /**< Bit mask of the full characteristic. */
99 /** @} */
100
101 /**
102 * @defgroup GLS_FEAT Glucose Feature
103 * @{
104 * @brief Glucose Service feature.
105 */
106 #define GLS_FEAT_LOW_BATT (0x01 << 0) /**< Low Battery Detection During Measurement Supported */
107 #define GLS_FEAT_MALFUNC (0x01 << 1) /**< Sensor Malfunction Detection Supported */
108 #define GLS_FEAT_SAMPLE_SIZE (0x01 << 2) /**< Sensor Sample Size Supported */
109 #define GLS_FEAT_INSERT_ERR (0x01 << 3) /**< Sensor Strip Insertion Error Detection Supported */
110 #define GLS_FEAT_TYPE_ERR (0x01 << 4) /**< Sensor Strip Type Error Detection Supported */
111 #define GLS_FEAT_RES_HIGH_LOW (0x01 << 5) /**< Sensor Result High-Low Detection Supported */
112 #define GLS_FEAT_TEMP_HIGH_LOW (0x01 << 6) /**< Sensor Temperature High-Low Detection Supported */
113 #define GLS_FEAT_READ_INT (0x01 << 7) /**< Sensor Read Interrupt Detection Supported */
114 #define GLS_FEAT_GENERAL_FAULT (0x01 << 8) /**< General Device Fault Supported */
115 #define GLS_FEAT_TIME_FAULT (0x01 << 9) /**< Time Fault Supported */
116 #define GLS_FEAT_MULTI_BOND (0x01 << 10) /**< Multiple Bond Supported */
117 #define GLS_FEAT_FULL (0x07ff) /**< All feature Supported. */
118 /** @} */
119
120
121 /**
122 * @defgroup GLS_MEAS_FLAG Measurement Flag
123 * @{
124 * @brief Glucose Measurement Flags.
125 */
126 #define GLS_MEAS_FLAG_TIME_OFFSET 0x01 /**< Time Offset Present */
127 #define GLS_MEAS_FLAG_CONC_TYPE_LOC 0x02 /**< Glucose Concentration, Type, and Sample Location Present */
128 #define GLS_MEAS_FLAG_UNITS_KG_L 0x00 /**< Glucose Concentration Units kg/L */
129 #define GLS_MEAS_FLAG_UNITS_MOL_L 0x04 /**< Glucose Concentration Units mol/L */
130 #define GLS_MEAS_FLAG_SENSOR_STATUS 0x08 /**< Sensor Status Annunciation Present */
131 #define GLS_MEAS_FLAG_CONTEXT_INFO 0x10 /**< Context Information Follows */
132 /** @} */
133
134 /**
135 * @defgroup GLS_MEAS_CTX_FLAG Measurement Context Flag
136 * @{
137 * @brief Glucose measurement context flags
138 */
139 #define GLS_MEAS_CTX_FLAG_CARB (0x01 << 0) /**< Carbohydrate id and carbohydrate present */
140 #define GLS_MEAS_CTX_FLAG_MEAL (0x01 << 1) /**< Meal present */
141 #define GLS_MEAS_CTX_FLAG_TESTER (0x01 << 2) /**< Tester-health present */
142 #define GLS_MEAS_CTX_FLAG_EXERCISE (0x01 << 3) /**< Exercise duration and exercise intensity present */
143 #define GLS_MEAS_CTX_FLAG_MED (0x01 << 4) /**< Medication ID and medication present */
144 #define GLS_MEAS_CTX_FLAG_MED_KG (0x01 << 5) /**< Medication value units, kilograms */
145 #define GLS_MEAS_CTX_FLAG_MED_L (0x01 << 6) /**< Medication value units, liters */
146 #define GLS_MEAS_CTX_FLAG_HBA1C (0x01 << 7) /**< Hba1c present */
147 #define GLS_MEAS_CTX_FLAG_EXT (0x01 << 8) /**< Extended flags present */
148 /** @} */
149
150 /**
151 * @defgroup GLS_MEAS_STATUS Measurement Status
152 * @{
153 * @brief Glucose measurement status annunciation.
154 */
155 #define GLS_MEAS_STATUS_BATT_LOW (0x01 << 0) /**< Device battery low at time of measurement */
156 #define GLS_MEAS_STATUS_SENSOR_FAULT (0x01 << 1) /**< Sensor malfunction or faulting at time of measurement */
157 #define GLS_MEAS_STATUS_SAMPLE_SIZE (0x01 << 2) /**< Sample size for blood or control solution insufficient at time of measurement */
158 #define GLS_MEAS_STATUS_STRIP_INSERT (0x01 << 3) /**< Strip insertion error */
159 #define GLS_MEAS_STATUS_STRIP_TYPE (0x01 << 4) /**< Strip type incorrect for device */
160 #define GLS_MEAS_STATUS_RESULT_HIGH (0x01 << 5) /**< Sensor result higher than the device can process */
161 #define GLS_MEAS_STATUS_RESULT_LOW (0x01 << 6) /**< Sensor result lower than the device can process */
162 #define GLS_MEAS_STATUS_TEMP_HIGH (0x01 << 7) /**< Sensor temperature too high for valid test/result at time of measurement */
163 #define GLS_MEAS_STATUS_TEMP_LOW (0x01 << 8) /**< Sensor temperature too low for valid test/result at time of measurement */
164 #define GLS_MEAS_STATUS_STRIP_PULL (0x01 << 9) /**< Sensor read interrupted because strip was pulled too soon at time of measurement */
165 #define GLS_MEAS_STATUS_GENERAL_FAULT (0x01 << 10) /**< General device fault has occurred in the sensor */
166 #define GLS_MEAS_STATUS_TIME_FAULT (0x01 << 11) /**< Time fault has occurred in the sensor and time may be inaccurate */
167 /** @} */
168 /** @} */
169
170 /**
171 * @defgroup GLS_ENUM Enumerations
172 * @{
173 */
174 /**@brief Glucose measurement type */
175 typedef enum
176 {
177 GLS_MEAS_TYPE_CAP_BLOOD = 0x01, /**< Capillary whole blood */
178 GLS_MEAS_TYPE_CAP_PLASMA, /**< Capillary plasma */
179 GLS_MEAS_TYPE_VEN_BLOOD, /**< Venous whole blood */
180 GLS_MEAS_TYPE_VEN_PLASMA, /**< Venous plasma */
181 GLS_MEAS_TYPE_ART_BLOOD, /**< Arterial whole blood */
182 GLS_MEAS_TYPE_ART_PLASMA, /**< Arterial plasma */
183 GLS_MEAS_TYPE_UNDET_BLOOD, /**< Undetermined whole blood */
184 GLS_MEAS_TYPE_UNDET_PLASMA, /**< Undetermined plasma */
185 GLS_MEAS_TYPE_FLUID, /**< Interstitial fluid (ISF) */
186 GLS_MEAS_TYPE_CONTROL, /**< Control solution */
187 } gls_meas_type_t;
188
189 /**@brief Glucose measurement location */
190 typedef enum
191 {
192 GLS_MEAS_LOC_FINGER = 0x01, /**< Finger */
193 GLS_MEAS_LOC_AST, /**< Alternate Site Test (AST) */
194 GLS_MEAS_LOC_EAR, /**< Earlobe */
195 GLS_MEAS_LOC_CONTROL, /**< Control solution */
196 GLS_MEAS_LOC_NOT_AVAIL = 0x0f, /**< Sample Location value not available */
197 } gls_meas_loc_t;
198
199 /**@brief Glucose measurement context carbohydrate ID */
200 typedef enum
201 {
202 GLS_MEAS_CTX_CARB_BREAKFAST = 0x01, /**< Breakfast */
203 GLS_MEAS_CTX_CARB_LUNCH, /**< Lunch */
204 GLS_MEAS_CTX_CARB_DINNER, /**< Dinner */
205 GLS_MEAS_CTX_CARB_SNACK, /**< Snack */
206 GLS_MEAS_CTX_CARB_DRINK, /**< Drink */
207 GLS_MEAS_CTX_CARB_SUPPER, /**< Supper */
208 GLS_MEAS_CTX_CARB_BRUNCH, /**< Brunch */
209 } gls_meas_ctx_carb_id_t;
210
211 /**@brief Glucose measurement context meal */
212 typedef enum
213 {
214 GLS_MEAS_CTX_MEAL_PREPRANDIAL = 0x01, /**< Preprandial (before meal) */
215 GLS_MEAS_CTX_MEAL_POSTPRANDIAL, /**< Postprandial (after meal) */
216 GLS_MEAS_CTX_MEAL_FASTING, /**< Fasting */
217 GLS_MEAS_CTX_MEAL_CASUAL, /**< Casual (snacks, drinks, etc.) */
218 GLS_MEAS_CTX_MEAL_BEDTIME, /**< Bedtime */
219 } gls_meas_ctx_meal_t;
220
221 /**@brief Glucose measurement context tester */
222 typedef enum
223 {
224 GLS_MEAS_CTX_TESTER_SELF = 0x01, /**< Self */
225 GLS_MEAS_CTX_TESTER_PRO, /**< Health care professional */
226 GLS_MEAS_CTX_TESTER_LAB, /**< Lab test */
227 GLS_MEAS_CTX_TESTER_NOT_AVAIL = 0x0f, /**< Tester value not available */
228 } gls_meas_ctx_tester_t;
229
230 /**@brief Glucose measurement context health */
231 typedef enum
232 {
233 GLS_MEAS_CTX_HEALTH_MINOR = 0x01, /**< Minor health issues */
234 GLS_MEAS_CTX_HEALTH_MAJOR, /**< Major health issues */
235 GLS_MEAS_CTX_HEALTH_MENSES, /**< During menses */
236 GLS_MEAS_CTX_HEALTH_STRESS, /**< Under stress */
237 GLS_MEAS_CTX_HEALTH_NONE, /**< No health issues */
238 GLS_MEAS_CTX_HEALTH_NOT_AVAIL = 0x0f, /**< Health value not available */
239 } gls_meas_ctx_health_t;
240
241 /**@brief Glucose measurement context medication ID */
242 typedef enum
243 {
244 GLS_MEAS_CTX_MED_RAPID = 0x01, /**< Rapid acting insulin */
245 GLS_MEAS_CTX_MED_SHORT, /**< Short acting insulin */
246 GLS_MEAS_CTX_MED_INTERMED, /**< Intermediate acting insulin */
247 GLS_MEAS_CTX_MED_LONG, /**< Long acting insulin */
248 GLS_MEAS_CTX_MED_PREMIX, /**< Pre-mixed insulin */
249 } gls_meas_ctx_medic_id_t;
250
251 /**@brief Glucose Service event type. */
252 typedef enum
253 {
254 GLS_EVT_INVALID = 0x00, /**< Invalid event. */
255 GLS_EVT_MEAS_NOTIFICATION_ENABLED, /**< Glucose Measurement notification enabled event. */
256 GLS_EVT_MEAS_NOTIFICATION_DISABLED, /**< Glucose Measurement notification disabled event. */
257 GLS_EVT_CTX_NOTIFICATION_ENABLED, /**< Glucose Measurement Context notification enabled event. */
258 GLS_EVT_CTX_NOTIFICATION_DISABLED, /**< Glucose Measurement Context notification disabled event. */
259 GLS_EVT_CTRL_INDICATION_ENABLED, /**< Record Access Control Point indication enabled event. */
260 GLS_EVT_CTRL_INDICATION_DISABLED, /**< Record Access Control Point indication disabled event. */
261 GLS_EVT_CTRL_WRITE, /**< Record Access Control Point write. */
262 } gls_evt_type_t;
263 /** @} */
264
265 /**
266 * @defgroup GLS_STRUCT Structures
267 * @{
268 */
269 /**@brief SFLOAT format (IEEE-11073 16-bit FLOAT, defined as a 16-bit value with 12-bit mantissa and 4-bit exponent). */
270 typedef struct
271 {
272 int8_t exponent; /**< Base 10 exponent, only 4 bits. */
273 int16_t mantissa; /**< Mantissa, only 12 bits. */
274 } gls_ieee_float16_t;
275
276 /**@brief Glucose Service event. */
277 typedef struct
278 {
279 gls_evt_type_t evt_type; /**< The GLS event type. */
280 uint8_t conn_idx; /**< The index of the connection. */
281 const uint8_t *p_data; /**< Pointer to event data. */
282 uint16_t length; /**< Length of event data. */
283 } gls_evt_t;
284 /** @} */
285
286 /**
287 * @defgroup GLS_TYPEDEF Typedefs
288 * @{
289 */
290 /**@brief Glucose Service event handler type.*/
291 typedef void (*gls_evt_handler_t)(gls_evt_t *p_evt);
292 /** @} */
293
294 /**
295 * @defgroup GLS_STRUCT Structures
296 * @{
297 */
298 /**@brief Glucose Measurement structure. This contains glucose measurement value. */
299 typedef struct
300 {
301 uint8_t flags; /**< Flags. */
302 uint16_t sequence_number; /**< Sequence number. */
303 prf_date_time_t base_time; /**< Time stamp. */
304 int16_t time_offset; /**< Time offset. */
305 gls_ieee_float16_t glucose_concentration; /**< Glucose concentration. */
306 uint8_t type; /**< Type. */
307 uint8_t sample_location; /**< Sample location. */
308 uint16_t sensor_status_annunciation; /**< Sensor status annunciation. */
309 } gls_meas_val_t;
310
311 /**@brief Glucose measurement context structure */
312 typedef struct
313 {
314 uint8_t flags; /**< Flags. */
315 uint8_t extended_flags; /**< Extended Flags. */
316 uint8_t carbohydrate_id; /**< Carbohydrate ID. */
317 gls_ieee_float16_t carbohydrate; /**< Carbohydrate. */
318 uint8_t meal; /**< Meal. */
319 uint8_t tester_and_health; /**< Tester and health. */
320 uint16_t exercise_duration; /**< Exercise Duration. */
321 uint8_t exercise_intensity; /**< Exercise Intensity. */
322 uint8_t medication_id; /**< Medication ID. */
323 gls_ieee_float16_t medication; /**< Medication. */
324 uint16_t hba1c; /**< HbA1c. */
325 } gls_meas_ctx_t;
326
327 /**@brief Glucose measurement record */
328 typedef struct
329 {
330 gls_meas_val_t meas_val; /**< Glucose measurement value. */
331 gls_meas_ctx_t meas_ctx; /**< Glucose measurement context. */
332 } gls_rec_t;
333
334 /**@brief Glucose Service init stucture. This contains all option and data needed for initialization of the service. */
335 typedef struct
336 {
337 gls_evt_handler_t evt_handler; /**< Glucose Service event handler. */
338 uint16_t char_mask; /**< Initial mask of supported characteristics, and configured with \ref GLS_CHAR_MASK. */
339 uint16_t feature; /**< Initial value for features. */
340 } gls_init_t;
341 /** @} */
342
343 /**
344 * @defgroup GLS_FUNCTION Functions
345 * @{
346 */
347 /**
348 *****************************************************************************************
349 * @brief Initialize a Glucose Service instance and add in the DB.
350 *
351 * @param[in] p_gls_init: Pointer to gls_init_t Service initialization variable
352 *
353 * @return Result of service initialization.
354 *****************************************************************************************
355 */
356 sdk_err_t gls_service_init(gls_init_t *p_gls_init);
357
358 /**
359 *****************************************************************************************
360 * @brief Record a new glucose measurement.
361 *
362 * @param[in] p_rec: Pointer to glucose record (measurement plus context).
363 *
364 * @return If record successfully or not.
365 *****************************************************************************************
366 */
367 bool gls_new_meas_record(gls_rec_t *p_rec);
368
369 /**
370 *****************************************************************************************
371 * @brief Send RACP responce if indication has been enabled.
372 *
373 * @param[in] conn_idx: Connnection index.
374 * @param[in] p_data: Pointer to data.
375 * @param[in] length: Length of data.
376 *
377 * @return Result of indicate value
378 *****************************************************************************************
379 */
380 sdk_err_t gls_racp_rsp_send(uint8_t conn_idx, uint8_t *p_data, uint16_t length);
381 /** @} */
382
383 #endif
384 /** @} */
385 /** @} */
386
gls_ieee_float16_t::exponent
int8_t exponent
Base 10 exponent, only 4 bits.
Definition: gls.h:272
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:226
GLS_MEAS_CTX_CARB_SUPPER
@ GLS_MEAS_CTX_CARB_SUPPER
Supper.
Definition: gls.h:207
GLS_MEAS_CTX_CARB_BREAKFAST
@ GLS_MEAS_CTX_CARB_BREAKFAST
Breakfast.
Definition: gls.h:202
gls_meas_val_t
Glucose Measurement structure.
Definition: gls.h:300
GLS_MEAS_LOC_EAR
@ GLS_MEAS_LOC_EAR
Earlobe.
Definition: gls.h:194
gls_meas_loc_t
gls_meas_loc_t
Glucose measurement location.
Definition: gls.h:191
gls_meas_val_t::base_time
prf_date_time_t base_time
Time stamp.
Definition: gls.h:303
gls_meas_val_t::glucose_concentration
gls_ieee_float16_t glucose_concentration
Glucose concentration.
Definition: gls.h:305
GLS_MEAS_CTX_MED_LONG
@ GLS_MEAS_CTX_MED_LONG
Long acting insulin.
Definition: gls.h:247
gls_evt_t::conn_idx
uint8_t conn_idx
The index of the connection.
Definition: gls.h:280
GLS_MEAS_TYPE_UNDET_BLOOD
@ GLS_MEAS_TYPE_UNDET_BLOOD
Undetermined whole blood.
Definition: gls.h:183
gls_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: gls.h:271
gls_meas_ctx_t::medication
gls_ieee_float16_t medication
Medication.
Definition: gls.h:323
gls_evt_t::evt_type
gls_evt_type_t evt_type
The GLS event type.
Definition: gls.h:279
GLS_EVT_CTRL_INDICATION_ENABLED
@ GLS_EVT_CTRL_INDICATION_ENABLED
Record Access Control Point indication enabled event.
Definition: gls.h:259
gls_evt_handler_t
void(* gls_evt_handler_t)(gls_evt_t *p_evt)
Glucose Service event handler type.
Definition: gls.h:291
gr_includes.h
Include Files API.
gls_meas_val_t::sequence_number
uint16_t sequence_number
Sequence number.
Definition: gls.h:302
gls_meas_type_t
gls_meas_type_t
Glucose measurement type.
Definition: gls.h:176
GLS_MEAS_CTX_CARB_DRINK
@ GLS_MEAS_CTX_CARB_DRINK
Drink.
Definition: gls.h:206
gls_meas_val_t::type
uint8_t type
Type.
Definition: gls.h:306
GLS_EVT_CTRL_INDICATION_DISABLED
@ GLS_EVT_CTRL_INDICATION_DISABLED
Record Access Control Point indication disabled event.
Definition: gls.h:260
gls_init_t::evt_handler
gls_evt_handler_t evt_handler
Glucose Service event handler.
Definition: gls.h:337
gls_meas_ctx_health_t
gls_meas_ctx_health_t
Glucose measurement context health.
Definition: gls.h:232
GLS_MEAS_CTX_MED_PREMIX
@ GLS_MEAS_CTX_MED_PREMIX
Pre-mixed insulin.
Definition: gls.h:248
GLS_MEAS_TYPE_UNDET_PLASMA
@ GLS_MEAS_TYPE_UNDET_PLASMA
Undetermined plasma.
Definition: gls.h:184
GLS_EVT_MEAS_NOTIFICATION_DISABLED
@ GLS_EVT_MEAS_NOTIFICATION_DISABLED
Glucose Measurement notification disabled event.
Definition: gls.h:256
GLS_MEAS_CTX_MEAL_PREPRANDIAL
@ GLS_MEAS_CTX_MEAL_PREPRANDIAL
Preprandial (before meal)
Definition: gls.h:214
GLS_MEAS_CTX_HEALTH_MAJOR
@ GLS_MEAS_CTX_HEALTH_MAJOR
Major health issues.
Definition: gls.h:234
gls_meas_ctx_carb_id_t
gls_meas_ctx_carb_id_t
Glucose measurement context carbohydrate ID.
Definition: gls.h:201
gls_meas_ctx_t::flags
uint8_t flags
Flags.
Definition: gls.h:314
GLS_MEAS_CTX_TESTER_SELF
@ GLS_MEAS_CTX_TESTER_SELF
Self.
Definition: gls.h:224
GLS_MEAS_LOC_FINGER
@ GLS_MEAS_LOC_FINGER
Finger.
Definition: gls.h:192
gls_meas_ctx_t::tester_and_health
uint8_t tester_and_health
Tester and health.
Definition: gls.h:319
gls_meas_ctx_t::exercise_duration
uint16_t exercise_duration
Exercise Duration.
Definition: gls.h:320
GLS_MEAS_CTX_MED_RAPID
@ GLS_MEAS_CTX_MED_RAPID
Rapid acting insulin.
Definition: gls.h:244
GLS_MEAS_TYPE_CONTROL
@ GLS_MEAS_TYPE_CONTROL
Control solution.
Definition: gls.h:186
GLS_MEAS_TYPE_CAP_PLASMA
@ GLS_MEAS_TYPE_CAP_PLASMA
Capillary plasma.
Definition: gls.h:178
GLS_MEAS_LOC_CONTROL
@ GLS_MEAS_LOC_CONTROL
Control solution.
Definition: gls.h:195
GLS_MEAS_CTX_MEAL_CASUAL
@ GLS_MEAS_CTX_MEAL_CASUAL
Casual (snacks, drinks, etc.)
Definition: gls.h:217
GLS_EVT_CTX_NOTIFICATION_ENABLED
@ GLS_EVT_CTX_NOTIFICATION_ENABLED
Glucose Measurement Context notification enabled event.
Definition: gls.h:257
gls_ieee_float16_t::mantissa
int16_t mantissa
Mantissa, only 12 bits.
Definition: gls.h:273
GLS_MEAS_CTX_MED_INTERMED
@ GLS_MEAS_CTX_MED_INTERMED
Intermediate acting insulin.
Definition: gls.h:246
gls_evt_t
Glucose Service event.
Definition: gls.h:278
gls_meas_ctx_t::exercise_intensity
uint8_t exercise_intensity
Exercise Intensity.
Definition: gls.h:321
GLS_MEAS_CTX_CARB_BRUNCH
@ GLS_MEAS_CTX_CARB_BRUNCH
Brunch.
Definition: gls.h:208
GLS_EVT_MEAS_NOTIFICATION_ENABLED
@ GLS_EVT_MEAS_NOTIFICATION_ENABLED
Glucose Measurement notification enabled event.
Definition: gls.h:255
GLS_MEAS_CTX_TESTER_PRO
@ GLS_MEAS_CTX_TESTER_PRO
Health care professional.
Definition: gls.h:225
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:204
GLS_MEAS_TYPE_VEN_BLOOD
@ GLS_MEAS_TYPE_VEN_BLOOD
Venous whole blood.
Definition: gls.h:179
GLS_MEAS_TYPE_ART_BLOOD
@ GLS_MEAS_TYPE_ART_BLOOD
Arterial whole blood.
Definition: gls.h:181
GLS_MEAS_CTX_HEALTH_MINOR
@ GLS_MEAS_CTX_HEALTH_MINOR
Minor health issues.
Definition: gls.h:233
sdk_err_t
uint16_t sdk_err_t
SDK API result type.
Definition: ble_error.h:273
gls_meas_val_t::sample_location
uint8_t sample_location
Sample location.
Definition: gls.h:307
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:227
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:205
GLS_MEAS_CTX_HEALTH_NOT_AVAIL
@ GLS_MEAS_CTX_HEALTH_NOT_AVAIL
Health value not available.
Definition: gls.h:238
GLS_MEAS_LOC_AST
@ GLS_MEAS_LOC_AST
Alternate Site Test (AST)
Definition: gls.h:193
GLS_MEAS_CTX_HEALTH_MENSES
@ GLS_MEAS_CTX_HEALTH_MENSES
During menses.
Definition: gls.h:235
gls_meas_ctx_t::carbohydrate
gls_ieee_float16_t carbohydrate
Carbohydrate.
Definition: gls.h:317
gls_meas_val_t::flags
uint8_t flags
Flags.
Definition: gls.h:301
gls_meas_val_t::time_offset
int16_t time_offset
Time offset.
Definition: gls.h:304
gls_rec_t::meas_val
gls_meas_val_t meas_val
Glucose measurement value.
Definition: gls.h:330
GLS_MEAS_TYPE_ART_PLASMA
@ GLS_MEAS_TYPE_ART_PLASMA
Arterial plasma.
Definition: gls.h:182
GLS_MEAS_CTX_HEALTH_NONE
@ GLS_MEAS_CTX_HEALTH_NONE
No health issues.
Definition: gls.h:237
gls_meas_val_t::sensor_status_annunciation
uint16_t sensor_status_annunciation
Sensor status annunciation.
Definition: gls.h:308
GLS_EVT_CTX_NOTIFICATION_DISABLED
@ GLS_EVT_CTX_NOTIFICATION_DISABLED
Glucose Measurement Context notification disabled event.
Definition: gls.h:258
gls_meas_ctx_tester_t
gls_meas_ctx_tester_t
Glucose measurement context tester.
Definition: gls.h:223
GLS_MEAS_TYPE_CAP_BLOOD
@ GLS_MEAS_TYPE_CAP_BLOOD
Capillary whole blood.
Definition: gls.h:177
gls_meas_ctx_t::medication_id
uint8_t medication_id
Medication ID.
Definition: gls.h:322
gls_meas_ctx_t::hba1c
uint16_t hba1c
HbA1c.
Definition: gls.h:324
GLS_EVT_CTRL_WRITE
@ GLS_EVT_CTRL_WRITE
Record Access Control Point write.
Definition: gls.h:261
GLS_MEAS_CTX_MEAL_BEDTIME
@ GLS_MEAS_CTX_MEAL_BEDTIME
Bedtime.
Definition: gls.h:218
gls_meas_ctx_t::meal
uint8_t meal
Meal.
Definition: gls.h:318
GLS_MEAS_CTX_CARB_LUNCH
@ GLS_MEAS_CTX_CARB_LUNCH
Lunch.
Definition: gls.h:203
gls_init_t::char_mask
uint16_t char_mask
Initial mask of supported characteristics, and configured with Characteristics Mask.
Definition: gls.h:338
gls_init_t
Glucose Service init stucture.
Definition: gls.h:336
gls_meas_ctx_medic_id_t
gls_meas_ctx_medic_id_t
Glucose measurement context medication ID.
Definition: gls.h:243
gls_meas_ctx_t
Glucose measurement context structure.
Definition: gls.h:313
ble_prf_utils.h
Profile/Service Utilities API.
GLS_MEAS_CTX_MEAL_FASTING
@ GLS_MEAS_CTX_MEAL_FASTING
Fasting.
Definition: gls.h:216
GLS_EVT_INVALID
@ GLS_EVT_INVALID
Invalid event.
Definition: gls.h:254
gls_evt_type_t
gls_evt_type_t
Glucose Service event type.
Definition: gls.h:253
gls_meas_ctx_t::carbohydrate_id
uint8_t carbohydrate_id
Carbohydrate ID.
Definition: gls.h:316
GLS_MEAS_CTX_MEAL_POSTPRANDIAL
@ GLS_MEAS_CTX_MEAL_POSTPRANDIAL
Postprandial (after meal)
Definition: gls.h:215
gls_rec_t
Glucose measurement record.
Definition: gls.h:329
gls_init_t::feature
uint16_t feature
Initial value for features.
Definition: gls.h:339
GLS_MEAS_TYPE_FLUID
@ GLS_MEAS_TYPE_FLUID
Interstitial fluid (ISF)
Definition: gls.h:185
gls_evt_t::length
uint16_t length
Length of event data.
Definition: gls.h:282
GLS_MEAS_TYPE_VEN_PLASMA
@ GLS_MEAS_TYPE_VEN_PLASMA
Venous plasma.
Definition: gls.h:180
GLS_MEAS_CTX_MED_SHORT
@ GLS_MEAS_CTX_MED_SHORT
Short acting insulin.
Definition: gls.h:245
gls_rec_t::meas_ctx
gls_meas_ctx_t meas_ctx
Glucose measurement context.
Definition: gls.h:331
GLS_MEAS_CTX_HEALTH_STRESS
@ GLS_MEAS_CTX_HEALTH_STRESS
Under stress.
Definition: gls.h:236
GLS_MEAS_LOC_NOT_AVAIL
@ GLS_MEAS_LOC_NOT_AVAIL
Sample Location value not available.
Definition: gls.h:196
gls_evt_t::p_data
const uint8_t * p_data
Pointer to event data.
Definition: gls.h:281
gls_meas_ctx_meal_t
gls_meas_ctx_meal_t
Glucose measurement context meal.
Definition: gls.h:213
gls_meas_ctx_t::extended_flags
uint8_t extended_flags
Extended Flags.
Definition: gls.h:315