テスト用です。

Dependencies:   mbed

Committer:
jksoft
Date:
Tue Oct 11 11:09:42 2016 +0000
Revision:
0:8468a4403fea
SB??ver;

Who changed what in which revision?

UserRevisionLine numberNew contents of line
jksoft 0:8468a4403fea 1 /* Copyright (c) 2012 Nordic Semiconductor. All Rights Reserved.
jksoft 0:8468a4403fea 2 *
jksoft 0:8468a4403fea 3 * The information contained herein is property of Nordic Semiconductor ASA.
jksoft 0:8468a4403fea 4 * Terms and conditions of usage are described in detail in NORDIC
jksoft 0:8468a4403fea 5 * SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT.
jksoft 0:8468a4403fea 6 *
jksoft 0:8468a4403fea 7 * Licensees are granted free, non-transferable use of the information. NO
jksoft 0:8468a4403fea 8 * WARRANTY of ANY KIND is provided. This heading must NOT be removed from
jksoft 0:8468a4403fea 9 * the file.
jksoft 0:8468a4403fea 10 */
jksoft 0:8468a4403fea 11
jksoft 0:8468a4403fea 12 /** @file
jksoft 0:8468a4403fea 13 *
jksoft 0:8468a4403fea 14 * @defgroup ble_sdk_srv_gls Glucose Service
jksoft 0:8468a4403fea 15 * @{
jksoft 0:8468a4403fea 16 * @ingroup ble_sdk_srv
jksoft 0:8468a4403fea 17 * @brief Glucose Service module.
jksoft 0:8468a4403fea 18 *
jksoft 0:8468a4403fea 19 * @details This module implements the Glucose Service.
jksoft 0:8468a4403fea 20 *
jksoft 0:8468a4403fea 21 * @note The application must propagate BLE stack events to the Glucose Service module by calling
jksoft 0:8468a4403fea 22 * ble_gls_on_ble_evt() from the from the @ref ble_stack_handler callback.
jksoft 0:8468a4403fea 23 *
jksoft 0:8468a4403fea 24 * @note Attention!
jksoft 0:8468a4403fea 25 * To maintain compliance with Nordic Semiconductor ASA Bluetooth profile
jksoft 0:8468a4403fea 26 * qualification listings, this section of source code must not be modified.
jksoft 0:8468a4403fea 27 */
jksoft 0:8468a4403fea 28
jksoft 0:8468a4403fea 29 #ifndef BLE_GLS_H__
jksoft 0:8468a4403fea 30 #define BLE_GLS_H__
jksoft 0:8468a4403fea 31
jksoft 0:8468a4403fea 32 #include <stdint.h>
jksoft 0:8468a4403fea 33 #include <stdbool.h>
jksoft 0:8468a4403fea 34 #include "ble.h"
jksoft 0:8468a4403fea 35 #include "ble_srv_common.h"
jksoft 0:8468a4403fea 36 #include "ble_date_time.h"
jksoft 0:8468a4403fea 37
jksoft 0:8468a4403fea 38 /**@brief Glucose feature */
jksoft 0:8468a4403fea 39 #define BLE_GLS_FEATURE_LOW_BATT 0x0001 /**< Low Battery Detection During Measurement Supported */
jksoft 0:8468a4403fea 40 #define BLE_GLS_FEATURE_MALFUNC 0x0002 /**< Sensor Malfunction Detection Supported */
jksoft 0:8468a4403fea 41 #define BLE_GLS_FEATURE_SAMPLE_SIZE 0x0004 /**< Sensor Sample Size Supported */
jksoft 0:8468a4403fea 42 #define BLE_GLS_FEATURE_INSERT_ERR 0x0008 /**< Sensor Strip Insertion Error Detection Supported */
jksoft 0:8468a4403fea 43 #define BLE_GLS_FEATURE_TYPE_ERR 0x0010 /**< Sensor Strip Type Error Detection Supported */
jksoft 0:8468a4403fea 44 #define BLE_GLS_FEATURE_RES_HIGH_LOW 0x0020 /**< Sensor Result High-Low Detection Supported */
jksoft 0:8468a4403fea 45 #define BLE_GLS_FEATURE_TEMP_HIGH_LOW 0x0040 /**< Sensor Temperature High-Low Detection Supported */
jksoft 0:8468a4403fea 46 #define BLE_GLS_FEATURE_READ_INT 0x0080 /**< Sensor Read Interrupt Detection Supported */
jksoft 0:8468a4403fea 47 #define BLE_GLS_FEATURE_GENERAL_FAULT 0x0100 /**< General Device Fault Supported */
jksoft 0:8468a4403fea 48 #define BLE_GLS_FEATURE_TIME_FAULT 0x0200 /**< Time Fault Supported */
jksoft 0:8468a4403fea 49 #define BLE_GLS_FEATURE_MULTI_BOND 0x0400 /**< Multiple Bond Supported */
jksoft 0:8468a4403fea 50
jksoft 0:8468a4403fea 51 /**@brief Glucose measurement flags */
jksoft 0:8468a4403fea 52 #define BLE_GLS_MEAS_FLAG_TIME_OFFSET 0x01 /**< Time Offset Present */
jksoft 0:8468a4403fea 53 #define BLE_GLS_MEAS_FLAG_CONC_TYPE_LOC 0x02 /**< Glucose Concentration, Type, and Sample Location Present */
jksoft 0:8468a4403fea 54 #define BLE_GLS_MEAS_FLAG_UNITS_KG_L 0x00 /**< Glucose Concentration Units kg/L */
jksoft 0:8468a4403fea 55 #define BLE_GLS_MEAS_FLAG_UNITS_MOL_L 0x04 /**< Glucose Concentration Units mol/L */
jksoft 0:8468a4403fea 56 #define BLE_GLS_MEAS_FLAG_SENSOR_STATUS 0x08 /**< Sensor Status Annunciation Present */
jksoft 0:8468a4403fea 57 #define BLE_GLS_MEAS_FLAG_CONTEXT_INFO 0x10 /**< Context Information Follows */
jksoft 0:8468a4403fea 58
jksoft 0:8468a4403fea 59 /**@brief Glucose measurement type */
jksoft 0:8468a4403fea 60 #define BLE_GLS_MEAS_TYPE_CAP_BLOOD 1 /**< Capillary whole blood */
jksoft 0:8468a4403fea 61 #define BLE_GLS_MEAS_TYPE_CAP_PLASMA 2 /**< Capillary plasma */
jksoft 0:8468a4403fea 62 #define BLE_GLS_MEAS_TYPE_VEN_BLOOD 3 /**< Venous whole blood */
jksoft 0:8468a4403fea 63 #define BLE_GLS_MEAS_TYPE_VEN_PLASMA 4 /**< Venous plasma */
jksoft 0:8468a4403fea 64 #define BLE_GLS_MEAS_TYPE_ART_BLOOD 5 /**< Arterial whole blood */
jksoft 0:8468a4403fea 65 #define BLE_GLS_MEAS_TYPE_ART_PLASMA 6 /**< Arterial plasma */
jksoft 0:8468a4403fea 66 #define BLE_GLS_MEAS_TYPE_UNDET_BLOOD 7 /**< Undetermined whole blood */
jksoft 0:8468a4403fea 67 #define BLE_GLS_MEAS_TYPE_UNDET_PLASMA 8 /**< Undetermined plasma */
jksoft 0:8468a4403fea 68 #define BLE_GLS_MEAS_TYPE_FLUID 9 /**< Interstitial fluid (ISF) */
jksoft 0:8468a4403fea 69 #define BLE_GLS_MEAS_TYPE_CONTROL 10 /**< Control solution */
jksoft 0:8468a4403fea 70
jksoft 0:8468a4403fea 71 /**@brief Glucose measurement location */
jksoft 0:8468a4403fea 72 #define BLE_GLS_MEAS_LOC_FINGER 1 /**< Finger */
jksoft 0:8468a4403fea 73 #define BLE_GLS_MEAS_LOC_AST 2 /**< Alternate Site Test (AST) */
jksoft 0:8468a4403fea 74 #define BLE_GLS_MEAS_LOC_EAR 3 /**< Earlobe */
jksoft 0:8468a4403fea 75 #define BLE_GLS_MEAS_LOC_CONTROL 4 /**< Control solution */
jksoft 0:8468a4403fea 76 #define BLE_GLS_MEAS_LOC_NOT_AVAIL 15 /**< Sample Location value not available */
jksoft 0:8468a4403fea 77
jksoft 0:8468a4403fea 78 /**@brief Glucose sensor status annunciation */
jksoft 0:8468a4403fea 79 #define BLE_GLS_MEAS_STATUS_BATT_LOW 0x0001 /**< Device battery low at time of measurement */
jksoft 0:8468a4403fea 80 #define BLE_GLS_MEAS_STATUS_SENSOR_FAULT 0x0002 /**< Sensor malfunction or faulting at time of measurement */
jksoft 0:8468a4403fea 81 #define BLE_GLS_MEAS_STATUS_SAMPLE_SIZE 0x0004 /**< Sample size for blood or control solution insufficient at time of measurement */
jksoft 0:8468a4403fea 82 #define BLE_GLS_MEAS_STATUS_STRIP_INSERT 0x0008 /**< Strip insertion error */
jksoft 0:8468a4403fea 83 #define BLE_GLS_MEAS_STATUS_STRIP_TYPE 0x0010 /**< Strip type incorrect for device */
jksoft 0:8468a4403fea 84 #define BLE_GLS_MEAS_STATUS_RESULT_HIGH 0x0020 /**< Sensor result higher than the device can process */
jksoft 0:8468a4403fea 85 #define BLE_GLS_MEAS_STATUS_RESULT_LOW 0x0040 /**< Sensor result lower than the device can process */
jksoft 0:8468a4403fea 86 #define BLE_GLS_MEAS_STATUS_TEMP_HIGH 0x0080 /**< Sensor temperature too high for valid test/result at time of measurement */
jksoft 0:8468a4403fea 87 #define BLE_GLS_MEAS_STATUS_TEMP_LOW 0x0100 /**< Sensor temperature too low for valid test/result at time of measurement */
jksoft 0:8468a4403fea 88 #define BLE_GLS_MEAS_STATUS_STRIP_PULL 0x0200 /**< Sensor read interrupted because strip was pulled too soon at time of measurement */
jksoft 0:8468a4403fea 89 #define BLE_GLS_MEAS_STATUS_GENERAL_FAULT 0x0400 /**< General device fault has occurred in the sensor */
jksoft 0:8468a4403fea 90 #define BLE_GLS_MEAS_STATUS_TIME_FAULT 0x0800 /**< Time fault has occurred in the sensor and time may be inaccurate */
jksoft 0:8468a4403fea 91
jksoft 0:8468a4403fea 92 /**@brief Glucose measurement context flags */
jksoft 0:8468a4403fea 93 #define BLE_GLS_CONTEXT_FLAG_CARB 0x01 /**< Carbohydrate id and carbohydrate present */
jksoft 0:8468a4403fea 94 #define BLE_GLS_CONTEXT_FLAG_MEAL 0x02 /**< Meal present */
jksoft 0:8468a4403fea 95 #define BLE_GLS_CONTEXT_FLAG_TESTER 0x04 /**< Tester-health present */
jksoft 0:8468a4403fea 96 #define BLE_GLS_CONTEXT_FLAG_EXERCISE 0x08 /**< Exercise duration and exercise intensity present */
jksoft 0:8468a4403fea 97 #define BLE_GLS_CONTEXT_FLAG_MED 0x10 /**< Medication ID and medication present */
jksoft 0:8468a4403fea 98 #define BLE_GLS_CONTEXT_FLAG_MED_KG 0x00 /**< Medication value units, kilograms */
jksoft 0:8468a4403fea 99 #define BLE_GLS_CONTEXT_FLAG_MED_L 0x20 /**< Medication value units, liters */
jksoft 0:8468a4403fea 100 #define BLE_GLS_CONTEXT_FLAG_HBA1C 0x40 /**< Hba1c present */
jksoft 0:8468a4403fea 101 #define BLE_GLS_CONTEXT_FLAG_EXT 0x80 /**< Extended flags present */
jksoft 0:8468a4403fea 102
jksoft 0:8468a4403fea 103 /**@brief Glucose measurement context carbohydrate ID */
jksoft 0:8468a4403fea 104 #define BLE_GLS_CONTEXT_CARB_BREAKFAST 1 /**< Breakfast */
jksoft 0:8468a4403fea 105 #define BLE_GLS_CONTEXT_CARB_LUNCH 2 /**< Lunch */
jksoft 0:8468a4403fea 106 #define BLE_GLS_CONTEXT_CARB_DINNER 3 /**< Dinner */
jksoft 0:8468a4403fea 107 #define BLE_GLS_CONTEXT_CARB_SNACK 4 /**< Snack */
jksoft 0:8468a4403fea 108 #define BLE_GLS_CONTEXT_CARB_DRINK 5 /**< Drink */
jksoft 0:8468a4403fea 109 #define BLE_GLS_CONTEXT_CARB_SUPPER 6 /**< Supper */
jksoft 0:8468a4403fea 110 #define BLE_GLS_CONTEXT_CARB_BRUNCH 7 /**< Brunch */
jksoft 0:8468a4403fea 111
jksoft 0:8468a4403fea 112 /**@brief Glucose measurement context meal */
jksoft 0:8468a4403fea 113 #define BLE_GLS_CONTEXT_MEAL_PREPRANDIAL 1 /**< Preprandial (before meal) */
jksoft 0:8468a4403fea 114 #define BLE_GLS_CONTEXT_MEAL_POSTPRANDIAL 2 /**< Postprandial (after meal) */
jksoft 0:8468a4403fea 115 #define BLE_GLS_CONTEXT_MEAL_FASTING 3 /**< Fasting */
jksoft 0:8468a4403fea 116 #define BLE_GLS_CONTEXT_MEAL_CASUAL 4 /**< Casual (snacks, drinks, etc.) */
jksoft 0:8468a4403fea 117 #define BLE_GLS_CONTEXT_MEAL_BEDTIME 5 /**< Bedtime */
jksoft 0:8468a4403fea 118
jksoft 0:8468a4403fea 119 /**@brief Glucose measurement context tester */
jksoft 0:8468a4403fea 120 #define BLE_GLS_CONTEXT_TESTER_SELF 1 /**< Self */
jksoft 0:8468a4403fea 121 #define BLE_GLS_CONTEXT_TESTER_PRO 2 /**< Health care professional */
jksoft 0:8468a4403fea 122 #define BLE_GLS_CONTEXT_TESTER_LAB 3 /**< Lab test */
jksoft 0:8468a4403fea 123 #define BLE_GLS_CONTEXT_TESTER_NOT_AVAIL 15 /**< Tester value not available */
jksoft 0:8468a4403fea 124
jksoft 0:8468a4403fea 125 /**@brief Glucose measurement context health */
jksoft 0:8468a4403fea 126 #define BLE_GLS_CONTEXT_HEALTH_MINOR 1 /**< Minor health issues */
jksoft 0:8468a4403fea 127 #define BLE_GLS_CONTEXT_HEALTH_MAJOR 2 /**< Major health issues */
jksoft 0:8468a4403fea 128 #define BLE_GLS_CONTEXT_HEALTH_MENSES 3 /**< During menses */
jksoft 0:8468a4403fea 129 #define BLE_GLS_CONTEXT_HEALTH_STRESS 4 /**< Under stress */
jksoft 0:8468a4403fea 130 #define BLE_GLS_CONTEXT_HEALTH_NONE 5 /**< No health issues */
jksoft 0:8468a4403fea 131 #define BLE_GLS_CONTEXT_HEALTH_NOT_AVAIL 15 /**< Health value not available */
jksoft 0:8468a4403fea 132
jksoft 0:8468a4403fea 133 /**@brief Glucose measurement context medication ID */
jksoft 0:8468a4403fea 134 #define BLE_GLS_CONTEXT_MED_RAPID 1 /**< Rapid acting insulin */
jksoft 0:8468a4403fea 135 #define BLE_GLS_CONTEXT_MED_SHORT 2 /**< Short acting insulin */
jksoft 0:8468a4403fea 136 #define BLE_GLS_CONTEXT_MED_INTERMED 3 /**< Intermediate acting insulin */
jksoft 0:8468a4403fea 137 #define BLE_GLS_CONTEXT_MED_LONG 4 /**< Long acting insulin */
jksoft 0:8468a4403fea 138 #define BLE_GLS_CONTEXT_MED_PREMIX 5 /**< Pre-mixed insulin */
jksoft 0:8468a4403fea 139
jksoft 0:8468a4403fea 140 /**@brief SFLOAT format (IEEE-11073 16-bit FLOAT, meaning 4 bits for exponent (base 10) and 12 bits mantissa) */
jksoft 0:8468a4403fea 141 typedef struct
jksoft 0:8468a4403fea 142 {
jksoft 0:8468a4403fea 143 int8_t exponent; /**< Base 10 exponent, should be using only 4 bits */
jksoft 0:8468a4403fea 144 int16_t mantissa; /**< Mantissa, should be using only 12 bits */
jksoft 0:8468a4403fea 145 } sfloat_t;
jksoft 0:8468a4403fea 146
jksoft 0:8468a4403fea 147 /**@brief Glucose Service event type. */
jksoft 0:8468a4403fea 148 typedef enum
jksoft 0:8468a4403fea 149 {
jksoft 0:8468a4403fea 150 BLE_GLS_EVT_NOTIFICATION_ENABLED, /**< Glucose value notification enabled event. */
jksoft 0:8468a4403fea 151 BLE_GLS_EVT_NOTIFICATION_DISABLED /**< Glucose value notification disabled event. */
jksoft 0:8468a4403fea 152 } ble_gls_evt_type_t;
jksoft 0:8468a4403fea 153
jksoft 0:8468a4403fea 154 /**@brief Glucose Service event. */
jksoft 0:8468a4403fea 155 typedef struct
jksoft 0:8468a4403fea 156 {
jksoft 0:8468a4403fea 157 ble_gls_evt_type_t evt_type; /**< Type of event. */
jksoft 0:8468a4403fea 158 } ble_gls_evt_t;
jksoft 0:8468a4403fea 159
jksoft 0:8468a4403fea 160 // Forward declaration of the ble_gls_t type.
jksoft 0:8468a4403fea 161 typedef struct ble_gls_s ble_gls_t;
jksoft 0:8468a4403fea 162
jksoft 0:8468a4403fea 163 /**@brief Glucose Service event handler type. */
jksoft 0:8468a4403fea 164 typedef void (*ble_gls_evt_handler_t) (ble_gls_t * p_gls, ble_gls_evt_t * p_evt);
jksoft 0:8468a4403fea 165
jksoft 0:8468a4403fea 166 /**@brief Glucose Measurement structure. This contains glucose measurement value. */
jksoft 0:8468a4403fea 167 typedef struct
jksoft 0:8468a4403fea 168 {
jksoft 0:8468a4403fea 169 uint8_t flags; /**< Flags */
jksoft 0:8468a4403fea 170 uint16_t sequence_number; /**< Sequence number */
jksoft 0:8468a4403fea 171 ble_date_time_t base_time; /**< Time stamp */
jksoft 0:8468a4403fea 172 int16_t time_offset; /**< Time offset */
jksoft 0:8468a4403fea 173 sfloat_t glucose_concentration; /**< Glucose concentration */
jksoft 0:8468a4403fea 174 uint8_t type; /**< Type */
jksoft 0:8468a4403fea 175 uint8_t sample_location; /**< Sample location */
jksoft 0:8468a4403fea 176 uint16_t sensor_status_annunciation; /**< Sensor status annunciation */
jksoft 0:8468a4403fea 177 } ble_gls_meas_t;
jksoft 0:8468a4403fea 178
jksoft 0:8468a4403fea 179 /**@brief Glucose measurement context structure */
jksoft 0:8468a4403fea 180 typedef struct
jksoft 0:8468a4403fea 181 {
jksoft 0:8468a4403fea 182 uint8_t flags; /**< Flags */
jksoft 0:8468a4403fea 183 uint8_t extended_flags; /**< Extended Flags */
jksoft 0:8468a4403fea 184 uint8_t carbohydrate_id; /**< Carbohydrate ID */
jksoft 0:8468a4403fea 185 sfloat_t carbohydrate; /**< Carbohydrate */
jksoft 0:8468a4403fea 186 uint8_t meal; /**< Meal */
jksoft 0:8468a4403fea 187 uint8_t tester_and_health; /**< Tester and health */
jksoft 0:8468a4403fea 188 uint16_t exercise_duration; /**< Exercise Duration */
jksoft 0:8468a4403fea 189 uint8_t exercise_intensity; /**< Exercise Intensity */
jksoft 0:8468a4403fea 190 uint8_t medication_id; /**< Medication ID */
jksoft 0:8468a4403fea 191 sfloat_t medication; /**< Medication */
jksoft 0:8468a4403fea 192 uint16_t hba1c; /**< HbA1c */
jksoft 0:8468a4403fea 193 } ble_gls_meas_context_t;
jksoft 0:8468a4403fea 194
jksoft 0:8468a4403fea 195 /**@brief Glucose measurement record */
jksoft 0:8468a4403fea 196 typedef struct
jksoft 0:8468a4403fea 197 {
jksoft 0:8468a4403fea 198 ble_gls_meas_t meas; /**< Glucose measurement */
jksoft 0:8468a4403fea 199 ble_gls_meas_context_t context; /**< Glucose measurement context */
jksoft 0:8468a4403fea 200 } ble_gls_rec_t;
jksoft 0:8468a4403fea 201
jksoft 0:8468a4403fea 202 /**@brief Glucose Service init structure. This contains all options and data needed for
jksoft 0:8468a4403fea 203 * initialization of the service. */
jksoft 0:8468a4403fea 204 typedef struct
jksoft 0:8468a4403fea 205 {
jksoft 0:8468a4403fea 206 ble_gls_evt_handler_t evt_handler; /**< Event handler to be called for handling events in the Glucose Service. */
jksoft 0:8468a4403fea 207 ble_srv_error_handler_t error_handler; /**< Function to be called in case of an error. */
jksoft 0:8468a4403fea 208 uint16_t feature; /**< Glucose Feature value indicating supported features. */
jksoft 0:8468a4403fea 209 bool is_context_supported; /**< Determines if optional Glucose Measurement Context is to be supported. */
jksoft 0:8468a4403fea 210 } ble_gls_init_t;
jksoft 0:8468a4403fea 211
jksoft 0:8468a4403fea 212 /**@brief Glucose Service structure. This contains various status information for the service. */
jksoft 0:8468a4403fea 213 typedef struct ble_gls_s
jksoft 0:8468a4403fea 214 {
jksoft 0:8468a4403fea 215 ble_gls_evt_handler_t evt_handler; /**< Event handler to be called for handling events in the Glucose Service. */
jksoft 0:8468a4403fea 216 ble_srv_error_handler_t error_handler; /**< Function to be called in case of an error. */
jksoft 0:8468a4403fea 217 uint16_t service_handle; /**< Handle of Glucose Service (as provided by the BLE stack). */
jksoft 0:8468a4403fea 218 ble_gatts_char_handles_t glm_handles; /**< Handles related to the Glucose Measurement characteristic. */
jksoft 0:8468a4403fea 219 ble_gatts_char_handles_t glm_context_handles; /**< Handles related to the Glucose Measurement Context characteristic. */
jksoft 0:8468a4403fea 220 ble_gatts_char_handles_t glf_handles; /**< Handles related to the Glucose Feature characteristic. */
jksoft 0:8468a4403fea 221 ble_gatts_char_handles_t racp_handles; /**< Handles related to the Record Access Control Point characteristic. */
jksoft 0:8468a4403fea 222 uint16_t conn_handle; /**< Handle of the current connection (as provided by the BLE stack, is BLE_CONN_HANDLE_INVALID if not in a connection). */
jksoft 0:8468a4403fea 223 uint16_t feature;
jksoft 0:8468a4403fea 224 bool is_context_supported;
jksoft 0:8468a4403fea 225 } ble_gls_t;
jksoft 0:8468a4403fea 226
jksoft 0:8468a4403fea 227 /**@brief Function for initializing the Glucose Service.
jksoft 0:8468a4403fea 228 *
jksoft 0:8468a4403fea 229 * @details This call allows the application to initialize the Glucose Service.
jksoft 0:8468a4403fea 230 *
jksoft 0:8468a4403fea 231 * @param[out] p_gls Glucose Service structure. This structure will have to be supplied by
jksoft 0:8468a4403fea 232 * the application. It will be initialized by this function, and will later
jksoft 0:8468a4403fea 233 * be used to identify this particular service instance.
jksoft 0:8468a4403fea 234 * @param[in] p_gls_init Information needed to initialize the service.
jksoft 0:8468a4403fea 235 *
jksoft 0:8468a4403fea 236 * @return NRF_SUCCESS on successful initialization of service, otherwise an error code.
jksoft 0:8468a4403fea 237 */
jksoft 0:8468a4403fea 238 uint32_t ble_gls_init(ble_gls_t * p_gls, const ble_gls_init_t * p_gls_init);
jksoft 0:8468a4403fea 239
jksoft 0:8468a4403fea 240 /**@brief Function for handling the Application's BLE Stack events.
jksoft 0:8468a4403fea 241 *
jksoft 0:8468a4403fea 242 * @details Handles all events from the BLE stack of interest to the Glucose Service.
jksoft 0:8468a4403fea 243 *
jksoft 0:8468a4403fea 244 * @param[in] p_gls Glucose Service structure.
jksoft 0:8468a4403fea 245 * @param[in] p_ble_evt Event received from the BLE stack.
jksoft 0:8468a4403fea 246 */
jksoft 0:8468a4403fea 247 void ble_gls_on_ble_evt(ble_gls_t * p_gls, ble_evt_t * p_ble_evt);
jksoft 0:8468a4403fea 248
jksoft 0:8468a4403fea 249 /**@brief Function for reporting a new glucose measurement to the glucose service module.
jksoft 0:8468a4403fea 250 *
jksoft 0:8468a4403fea 251 * @details The application calls this function after having performed a new glucose measurement.
jksoft 0:8468a4403fea 252 * The new measurement is recorded in the RACP database.
jksoft 0:8468a4403fea 253 *
jksoft 0:8468a4403fea 254 * @param[in] p_gls Glucose Service structure.
jksoft 0:8468a4403fea 255 * @param[in] p_rec Pointer to glucose record (measurement plus context).
jksoft 0:8468a4403fea 256 *
jksoft 0:8468a4403fea 257 * @return NRF_SUCCESS on success, otherwise an error code.
jksoft 0:8468a4403fea 258 */
jksoft 0:8468a4403fea 259 uint32_t ble_gls_glucose_new_meas(ble_gls_t * p_gls, ble_gls_rec_t * p_rec);
jksoft 0:8468a4403fea 260
jksoft 0:8468a4403fea 261 #endif // BLE_GLS_H__
jksoft 0:8468a4403fea 262
jksoft 0:8468a4403fea 263 /** @} */
jksoft 0:8468a4403fea 264
jksoft 0:8468a4403fea 265 /** @endcond */