bcs.h
Go to the documentation of this file.
1 /**
2 *****************************************************************************************
3 *
4 * @file bcs.h
5 *
6 * @brief Body Composition 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_BCS Body Composition Service (BCS)
46 * @{
47 * @brief Definitions and prototypes for the BCS interface.
48 *
49 * @details The Body Composition Service (BCS) exposes data related to body composition from a
50 * body composition analyzer (Server) intended for consumer healthcare as well as
51 * sports/fitness applications. This module implements the Body Compositon Service
52 * with the Body Composition Feature and Body Composition Measurement characteristics.
53 *
54 * After \ref bcs_init_t variable is initialized, the application must call \ref bcs_service_init()
55 * to optionally add the Body Compisition Service, Body Composition Meaturement characteristics to
56 * the BLE stack database according to \ref bcs_init_t.char_mask.
57 */
58
59 #ifndef _BCS_H_
60 #define _BCS_H_
61
62 #include "gr_includes.h"
63 #include "custom_config.h"
64 #include "ble_prf_utils.h"
65 #include <stdint.h>
66 #include <stdbool.h>
67
68
69 /**
70 * @defgroup BCS_MACRO Defines
71 * @{
72 */
73 #define BCS_CONNECTION_MAX 10 /**< Maximum number of Body Composition Service connections. */
74 #define BCS_MEAS_VAL_LEN_MAX 20 /**< Maximum length of BC Measurment value. */
75 #define BCS_FEAT_VAL_LEN_MAX 4 /**< Maximum length of BC Feature value. */
76
77 #define INDI_PAYLOAD_HEADER_LEN 3 /**< The length of indication payload header. */
78
79 /**
80 * @defgroup BCS_MEAS_PACKETS_INDEX Measurement packets index
81 * @{
82 * @brief BCS Measurement Packet Index.
83 * The least value of MTU is 23 octets. The size of Attribute Value is (23-3)
84 * octets which could be less than the size (30 octets) of all fields of Body
85 * Composition Measurement. If the required data exceeds the current size (MTU - 3)
86 * octets, the remaining optional fields shall be sent in the subsequent indication.
87 * So we need no more than 2 packets.
88 */
89 #define NUM_PACKETS 2 /**< Measurement Packet numbers. */
90 #define MEAS_PACKET_FIRST 0 /**< The first Measurement Packet. */
91 #define MEAS_PACKET_SUB 1 /**< The second Measurement Packet. */
92 /** @} */
93
94 #define BCS_CACHE_MEAS_NUM_MAX 25 /**< Maximum number of cache muasurements value for each user. */
95
96 #define BCS_MEAS_UNSUCCESS 0xFFFF /**< Measurement unsuccessful. */
97
98 #define BCS_MEAS_FLAG_DEFAULT 0x01FF /**< Measurement default flag. */
99
100 /**
101 * @defgroup BCS_CHAR_MASK Characteristics Mask
102 * @{
103 * @brief Bit masks for the initialization of \ref bcs_init_t.char_mask.
104 */
105 #define BCS_CHAR_FEAT_MANDATORY 0x3F /**< Bit mask for mandatory characteristic in BCS. */
106 /** @} */
107 /** @} */
108
109
110 /**
111 * @defgroup BCS_ENUM Enumerations
112 * @{
113 */
114 /**
115 * @defgroup BCS_MEAS_FLAG_BIT Measurement Flag Bits
116 * @{
117 */
118 /**@brief Body Composition Measurement Flags. */
119 enum bcs_meas_flag_bits
120 {
121 BCS_MEAS_FLAG_UNIT_SI = 0x0000, /**< Flag bit for SI Measurement Units Present. */
122 BCS_MEAS_FLAG_UNIT_IMPERIAL = 0x0001, /**< Flag bit for Imperial Measurement Units Present. */
123 BCS_MEAS_FLAG_DATE_TIME_PRESENT = 0x0002, /**< Flag bit for Time Stamp Present. */
124 BCS_MEAS_FLAG_USER_ID_PRESENT = 0x0004, /**< Flag bit for User ID Present. */
125 BCS_MEAS_FLAG_BASAL_METABOLISM = 0x0008, /**< Flag bit for Basal Metabolism Present. */
126 BCS_MEAS_FLAG_MUSCLE_PERCENTAGE = 0x0010, /**< Flag bit for Muscle Percentage Present. */
127 BCS_MEAS_FLAG_MUSCLE_MASS = 0x0020, /**< Flag bit for Muscle Mass Present. */
128 BCS_MEAS_FLAG_FAT_FREE_MASS = 0x0040, /**< Flag bit for Fat Free Mass Present. */
129 BCS_MEAS_FLAG_SOFT_LEAN_MASS = 0x0080, /**< Flag bit for Soft Lean Mass Present. */
130 BCS_MEAS_FLAG_BODY_WATER_MASS = 0x0100, /**< Flag bit for Body Water Mass Present. */
131 BCS_MEAS_FLAG_IMPEDANCE = 0x0200, /**< Flag bit for Impedance Present. */
132 BCS_MEAS_FLAG_WEIGHT = 0x0400, /**< Flag bit for Weight Present. */
133 BCS_MEAS_FLAG_HEIGHT = 0x0800, /**< Flag bit for Height Present. */
134 BCS_MEAS_FLAG_MUTI_PACKET = 0x1000, /**< Flag bit for Multiple Packet Measurement Present. */
135 };
136 /** @} */
137
138 /**@brief Body Composition Feature characteristic bit values. */
139 typedef enum
140 {
141 /* Supported Flags */
142 BCS_FEAT_TIME_STAMP = 0x00000001, /**< Time Stamp supported */
143 BCS_FEAT_MULTI_USER = 0x00000002, /**< Multiple Users supported */
144 BCS_FEAT_BASAL_METABOLISM = 0x00000004, /**< Basal metabolism supported */
145 BCS_FEAT_MUSCLE_PERCENTAGE = 0x00000008, /**< Muscle percentage supported */
146 BCS_FEAT_MUSCLE_MASS = 0x00000010, /**< Muscle mass supported */
147 BCS_FEAT_FAT_FREE_MASS = 0x00000020, /**< Fat free mass supported */
148 BCS_FEAT_SOFT_LEAN_MASS = 0x00000040, /**< Soft lean mass supported */
149 BCS_FEAT_BODY_WATER_MASS = 0x00000080, /**< Body water mass supported */
150 BCS_FEAT_IMPEDANCE = 0x00000100, /**< Impedance supported */
151 BCS_FEAT_WEIGHT = 0x00000200, /**< Weight supported */
152 BCS_FEAT_HEIGHT = 0x00000400, /**< Height supported */
153
154 /* Mass Resolution */
155 BCS_FEAT_MASS_RES_500G = 0x00000800, /**< Resolution of 0.5kg or 1lb */
156 BCS_FEAT_MASS_RES_200G = 0x00001000, /**< Resolution of 0.2kg or 0.5lb */
157 BCS_FEAT_MASS_RES_100G = 0x00001800, /**< Resolution of 0.1kg or 0.2lb */
158 BCS_FEAT_MASS_RES_50G = 0x00002000, /**< Resolution of 0.05kg or 0.1lb */
159 BCS_FEAT_MASS_RES_20G = 0x00002800, /**< Resolution of 0.02kg or 0.05lb */
160 BCS_FEAT_MASS_RES_10G = 0x00003000, /**< Resolution of 0.01kg or 0.02lb */
161 BCS_FEAT_MASS_RES_5G = 0x00003800, /**< Resolution of 0.005kg or 0.01lb */
162
163 /* Height Resolution */
164 BCS_FEAT_HEIGHT_RES_10MM = 0x00008000, /**< Resolution of 0.01m or 1in */
165 BCS_FEAT_HEIGHT_RES_5MM = 0x00010000, /**< Resolution of 0.005m or 0.5in */
166 BCS_FEAT_HEIGHT_RES_1MM = 0x00018000, /**< Resolution of 0.001m or 0.1in */
167
168 BCS_FEAT_FULL_BIT = 0x0001BFFF,
169 } bcs_feature_t;
170
171 /**@brief BCS Weight Measurement resolutions. */
172 typedef enum
173 {
174 BCS_MASS_RES_500G, /**< Resolution of 0.5kg or 1lb. */
175 BCS_MASS_RES_200G, /**< Resolution of 0.2kg or 0.5lb. */
176 BCS_MASS_RES_100G, /**< Resolution of 0.1kg or 0.2lb. */
177 BCS_MASS_RES_50G, /**< Resolution of 0.05kg or 0.1lb. */
178 BCS_MASS_RES_20G, /**< Resolution of 0.02kg or 0.05lb. */
179 BCS_MASS_RES_10G, /**< Resolution of 0.01kg or 0.02lb. */
180 BCS_MASS_RES_5G, /**< Resolution of 0.005kg or 0.01lb. */
181 } bcs_mass_res_t;
182
183 /**@brief BCS Height Measurement resolutions. */
184 typedef enum
185 {
186 BCS_HEIGHT_RES_10MM, /**< Resolution of 0.01m or 1in. */
187 BCS_HEIGHT_RES_5MM, /**< Resolution of 0.005m or 0.5in. */
188 BCS_HEIGHT_RES_1MM, /**< Resolution of 0.001m or 0.1in. */
189 } bcs_height_res_t;
190
191 /**@brief BCS unit types. */
192 typedef enum
193 {
194 BCS_UNIT_SI, /**< Weight in kilograms and height in meters */
195 BCS_UNIT_IMPERIAL, /**< Weight in pounds and height in inches */
196 } bcs_unit_t;
197
198 /**@brief Body Composition Service event type. */
199 typedef enum
200 {
201 BCS_EVT_INVALID, /**< Indicate that invalid event. */
202 BCS_EVT_MEAS_INDICATION_ENABLE, /**< Indicate that body composition measurement indication has been enabled. */
203 BCS_EVT_MEAS_INDICATION_DISABLE, /**< Indicate that body composition measurement indication has been disabled. */
204 BCS_EVT_MEAS_INDICATION_CPLT, /**< Indicate that BC Measurement has been indicated. */
205 BCS_EVT_MEAS_READ_CHARACTERISTIC, /**< The peer reads the characteristic. */
206 } bcs_evt_type_t;
207 /** @} */
208
209 /**
210 * @defgroup BCS_STRUCT Structures
211 * @{
212 */
213 /**@brief Body composition Measurement flag data. */
214 typedef struct
215 {
216 uint8_t time_stamp_present :1; /**< Time Stamp flag. */
217 uint8_t user_id_present :1; /**< User ID flag. */
218 uint8_t basal_metabolism_present :1; /**< Basal Metabolism flag. */
219 uint8_t muscle_percentage_present :1; /**< Muscle Percentage flag. */
220 uint8_t muscle_mass_present :1; /**< Muscle Mass flag. */
221 uint8_t fat_free_mass_present :1; /**< Fat Free Mass flag. */
222 uint8_t soft_lean_mass_present :1; /**< Soft Lean Mass flag. */
223 uint8_t body_water_mass_present :1; /**< Body Water Mass flag. */
224 uint8_t impedance_present :1; /**< Impedance flag. */
225 uint8_t weight_present :1; /**< Weight flag. */
226 uint8_t height_present :1; /**< Height flag. */
227 } bcs_meas_flag_t;
228
229 /**@brief Body composition Measurement data. */
230 typedef struct
231 {
232 uint16_t body_fat_percentage; /**< Body Fat Percentage data. */
233 prf_date_time_t time_stamp; /**< Time Stamp data. */
234 uint8_t user_id; /**< User Index data. */
235 uint16_t basal_metabolism; /**< Basal Metabolism data. */
236 uint16_t muscle_percentage; /**< Muscle Percentage data. */
237 uint16_t muscle_mass; /**< Muscle Mass data. */
238 uint16_t fat_free_mass; /**< Fat Free Mass data. */
239 uint16_t soft_lean_mass; /**< Soft Lean Mass data. */
240 uint16_t body_water_mass; /**< Body Water Mass data. */
241 uint16_t impedance; /**< Impedance data. */
242 uint16_t weight; /**< Weight data. */
243 uint16_t height; /**< Height data. */
244 } bcs_meas_val_t;
245
246 /**@brief Body Composition Service event. */
247 typedef struct
248 {
249 bcs_evt_type_t evt_type; /**< The BCS event type. */
250 uint8_t conn_idx; /**< The index of the connection. */
251 const uint8_t *p_data; /**< Pointer to event data. */
252 uint16_t length; /**< Length of event data. */
253 } bcs_evt_t;
254 /** @} */
255
256 /**
257 * @defgroup BCS_TYPEDEF Typedefs
258 * @{
259 */
260 /**@brief Body Composition Service event handler type. */
261 typedef void (*bcs_evt_handler_t)(bcs_evt_t *p_evt);
262 /** @} */
263
264 /**
265 * @defgroup BCS_STRUCT Structures
266 * @{
267 */
268 /**@brief Body Composition Service Init variable. */
269 typedef struct
270 {
271 bcs_evt_handler_t evt_handler; /**< Body Composition Service event handler. */
272 uint32_t feature; /**< Initial value for features. */
273 uint8_t char_mask; /**< Initial mask of Supported characteristics, and configured with \ref BCS_CHAR_MASK */
274 bcs_unit_t bcs_unit; /**< Initial unit system as SI or Imperial. */
275 bcs_meas_flag_t bcs_meas_flags; /**< Initial measurement flags. */
276 bcs_mass_res_t bcs_mass_res; /**< Initial resolution of mass value. */
277 bcs_height_res_t bcs_height_res; /**< Initial resolution of height value. */
278 } bcs_init_t;
279 /** @} */
280
281 /**
282 * @defgroup BCS_FUNCTION Functions
283 * @{
284 */
285 /**
286 *****************************************************************************************
287 * @brief Initialize a Body Composition Service instance and add in the DB.
288 *
289 * @param[in] p_bcs_init: Pointer to BC Service initialization variable.
290 *
291 * @return Result of service initialization.
292 *****************************************************************************************
293 */
294 sdk_err_t bcs_service_init(bcs_init_t *p_bcs_init);
295
296 /**
297 ******************************************************************************************
298 * @brief Send Body Composition Measurement indication.
299 *
300 * @param[in] conn_idx: Connection index.
301 * @param[in] p_meas: Pointer to body composition measurement data.
302 * @param[in] cache_num: The number of measurement caches.
303 *
304 * @return SDK_SUCCESS on success, otherwise an error code.
305 *****************************************************************************************
306 */
307 sdk_err_t bcs_measurement_send(uint8_t conn_idx, bcs_meas_val_t *p_meas, uint8_t cache_num);
308
309 /**
310 ******************************************************************************************
311 * @brief Get the pointer to the start handle of Body Composition Service.
312 *
313 *
314 * @return The pointer to the start handle.
315 *****************************************************************************************
316 */
317 uint16_t * bcs_start_handle_get(void);
318 /** @} */
319
320 #endif
321 /** @} */
322 /** @} */
323
bcs_meas_val_t::height
uint16_t height
Definition: bcs.h:243
BCS_MEAS_FLAG_SOFT_LEAN_MASS
@ BCS_MEAS_FLAG_SOFT_LEAN_MASS
Definition: bcs.h:129
bcs_meas_flag_t::basal_metabolism_present
uint8_t basal_metabolism_present
Definition: bcs.h:218
bcs_init_t::char_mask
uint8_t char_mask
Definition: bcs.h:273
BCS_MEAS_FLAG_HEIGHT
@ BCS_MEAS_FLAG_HEIGHT
Definition: bcs.h:133
bcs_feature_t
bcs_feature_t
Body Composition Feature characteristic bit values.
Definition: bcs.h:140
BCS_MASS_RES_500G
@ BCS_MASS_RES_500G
Definition: bcs.h:174
bcs_unit_t
bcs_unit_t
BCS unit types.
Definition: bcs.h:193
bcs_evt_t::p_data
const uint8_t * p_data
Definition: bcs.h:251
bcs_init_t::bcs_meas_flags
bcs_meas_flag_t bcs_meas_flags
Definition: bcs.h:275
BCS_MEAS_FLAG_FAT_FREE_MASS
@ BCS_MEAS_FLAG_FAT_FREE_MASS
Definition: bcs.h:128
bcs_mass_res_t
bcs_mass_res_t
BCS Weight Measurement resolutions.
Definition: bcs.h:173
BCS_MEAS_FLAG_MUSCLE_PERCENTAGE
@ BCS_MEAS_FLAG_MUSCLE_PERCENTAGE
Definition: bcs.h:126
bcs_meas_flag_t::time_stamp_present
uint8_t time_stamp_present
Definition: bcs.h:216
bcs_evt_type_t
bcs_evt_type_t
Body Composition Service event type.
Definition: bcs.h:200
bcs_evt_t
Body Composition Service event.
Definition: bcs.h:248
BCS_HEIGHT_RES_10MM
@ BCS_HEIGHT_RES_10MM
Definition: bcs.h:186
gr_includes.h
Include Files API.
BCS_MEAS_FLAG_UNIT_IMPERIAL
@ BCS_MEAS_FLAG_UNIT_IMPERIAL
Definition: bcs.h:122
bcs_init_t::bcs_mass_res
bcs_mass_res_t bcs_mass_res
Definition: bcs.h:276
bcs_evt_t::evt_type
bcs_evt_type_t evt_type
Definition: bcs.h:249
BCS_MASS_RES_5G
@ BCS_MASS_RES_5G
Definition: bcs.h:180
BCS_FEAT_HEIGHT_RES_1MM
@ BCS_FEAT_HEIGHT_RES_1MM
Definition: bcs.h:166
BCS_HEIGHT_RES_5MM
@ BCS_HEIGHT_RES_5MM
Definition: bcs.h:187
bcs_meas_val_t::impedance
uint16_t impedance
Definition: bcs.h:241
BCS_MEAS_FLAG_UNIT_SI
@ BCS_MEAS_FLAG_UNIT_SI
Definition: bcs.h:121
BCS_FEAT_MASS_RES_20G
@ BCS_FEAT_MASS_RES_20G
Definition: bcs.h:159
BCS_FEAT_MASS_RES_200G
@ BCS_FEAT_MASS_RES_200G
Definition: bcs.h:156
bcs_measurement_send
sdk_err_t bcs_measurement_send(uint8_t conn_idx, bcs_meas_val_t *p_meas, uint8_t cache_num)
Send Body Composition Measurement indication.
bcs_init_t::bcs_height_res
bcs_height_res_t bcs_height_res
Definition: bcs.h:277
BCS_EVT_MEAS_INDICATION_ENABLE
@ BCS_EVT_MEAS_INDICATION_ENABLE
Definition: bcs.h:202
bcs_init_t
Body Composition Service Init variable.
Definition: bcs.h:270
bcs_meas_flag_t::fat_free_mass_present
uint8_t fat_free_mass_present
Definition: bcs.h:221
BCS_FEAT_MUSCLE_MASS
@ BCS_FEAT_MUSCLE_MASS
Definition: bcs.h:146
BCS_FEAT_MASS_RES_10G
@ BCS_FEAT_MASS_RES_10G
Definition: bcs.h:160
bcs_meas_val_t::weight
uint16_t weight
Definition: bcs.h:242
bcs_start_handle_get
uint16_t * bcs_start_handle_get(void)
Get the pointer to the start handle of Body Composition Service.
BCS_MEAS_FLAG_USER_ID_PRESENT
@ BCS_MEAS_FLAG_USER_ID_PRESENT
Definition: bcs.h:124
bcs_meas_flag_t::soft_lean_mass_present
uint8_t soft_lean_mass_present
Definition: bcs.h:222
BCS_FEAT_HEIGHT_RES_10MM
@ BCS_FEAT_HEIGHT_RES_10MM
Definition: bcs.h:164
BCS_MEAS_FLAG_MUSCLE_MASS
@ BCS_MEAS_FLAG_MUSCLE_MASS
Definition: bcs.h:127
bcs_meas_val_t::time_stamp
prf_date_time_t time_stamp
Definition: bcs.h:233
BCS_FEAT_MASS_RES_100G
@ BCS_FEAT_MASS_RES_100G
Definition: bcs.h:157
bcs_meas_val_t::muscle_mass
uint16_t muscle_mass
Definition: bcs.h:237
bcs_meas_val_t::body_water_mass
uint16_t body_water_mass
Definition: bcs.h:240
BCS_FEAT_MASS_RES_50G
@ BCS_FEAT_MASS_RES_50G
Definition: bcs.h:158
BCS_MASS_RES_200G
@ BCS_MASS_RES_200G
Definition: bcs.h:175
sdk_err_t
uint16_t sdk_err_t
SDK API result type.
Definition: ble_error.h:273
BCS_FEAT_WEIGHT
@ BCS_FEAT_WEIGHT
Definition: bcs.h:151
bcs_meas_flag_t
Body composition Measurement flag data.
Definition: bcs.h:215
BCS_FEAT_TIME_STAMP
@ BCS_FEAT_TIME_STAMP
Definition: bcs.h:142
bcs_evt_handler_t
void(* bcs_evt_handler_t)(bcs_evt_t *p_evt)
Body Composition Service event handler type.
Definition: bcs.h:261
bcs_meas_flag_t::impedance_present
uint8_t impedance_present
Definition: bcs.h:224
prf_date_time_t
The date and time structure. The packed size is 7 bytes.
Definition: ble_prf_types.h:101
bcs_meas_flag_t::muscle_percentage_present
uint8_t muscle_percentage_present
Definition: bcs.h:219
BCS_MEAS_FLAG_BASAL_METABOLISM
@ BCS_MEAS_FLAG_BASAL_METABOLISM
Definition: bcs.h:125
bcs_evt_t::conn_idx
uint8_t conn_idx
Definition: bcs.h:250
BCS_MASS_RES_10G
@ BCS_MASS_RES_10G
Definition: bcs.h:179
bcs_meas_flag_bits
bcs_meas_flag_bits
Body Composition Measurement Flags.
Definition: bcs.h:120
BCS_UNIT_SI
@ BCS_UNIT_SI
Definition: bcs.h:194
bcs_meas_flag_t::body_water_mass_present
uint8_t body_water_mass_present
Definition: bcs.h:223
BCS_FEAT_MULTI_USER
@ BCS_FEAT_MULTI_USER
Definition: bcs.h:143
BCS_FEAT_MASS_RES_5G
@ BCS_FEAT_MASS_RES_5G
Definition: bcs.h:161
bcs_meas_val_t::user_id
uint8_t user_id
Definition: bcs.h:234
BCS_FEAT_SOFT_LEAN_MASS
@ BCS_FEAT_SOFT_LEAN_MASS
Definition: bcs.h:148
BCS_FEAT_MUSCLE_PERCENTAGE
@ BCS_FEAT_MUSCLE_PERCENTAGE
Definition: bcs.h:145
BCS_MEAS_FLAG_WEIGHT
@ BCS_MEAS_FLAG_WEIGHT
Definition: bcs.h:132
BCS_UNIT_IMPERIAL
@ BCS_UNIT_IMPERIAL
Definition: bcs.h:195
BCS_EVT_MEAS_READ_CHARACTERISTIC
@ BCS_EVT_MEAS_READ_CHARACTERISTIC
Definition: bcs.h:205
BCS_MEAS_FLAG_MUTI_PACKET
@ BCS_MEAS_FLAG_MUTI_PACKET
Definition: bcs.h:134
BCS_FEAT_BASAL_METABOLISM
@ BCS_FEAT_BASAL_METABOLISM
Definition: bcs.h:144
bcs_init_t::feature
uint32_t feature
Definition: bcs.h:272
BCS_FEAT_IMPEDANCE
@ BCS_FEAT_IMPEDANCE
Definition: bcs.h:150
bcs_height_res_t
bcs_height_res_t
BCS Height Measurement resolutions.
Definition: bcs.h:185
bcs_init_t::evt_handler
bcs_evt_handler_t evt_handler
Definition: bcs.h:271
BCS_MASS_RES_50G
@ BCS_MASS_RES_50G
Definition: bcs.h:177
bcs_meas_flag_t::weight_present
uint8_t weight_present
Definition: bcs.h:225
BCS_EVT_MEAS_INDICATION_DISABLE
@ BCS_EVT_MEAS_INDICATION_DISABLE
Definition: bcs.h:203
bcs_evt_t::length
uint16_t length
Definition: bcs.h:252
ble_prf_utils.h
Profile/Service Utilities API.
bcs_meas_val_t::muscle_percentage
uint16_t muscle_percentage
Definition: bcs.h:236
BCS_FEAT_HEIGHT_RES_5MM
@ BCS_FEAT_HEIGHT_RES_5MM
Definition: bcs.h:165
bcs_meas_val_t::fat_free_mass
uint16_t fat_free_mass
Definition: bcs.h:238
BCS_MEAS_FLAG_BODY_WATER_MASS
@ BCS_MEAS_FLAG_BODY_WATER_MASS
Definition: bcs.h:130
bcs_meas_flag_t::height_present
uint8_t height_present
Definition: bcs.h:226
bcs_meas_val_t
Body composition Measurement data.
Definition: bcs.h:231
bcs_meas_val_t::body_fat_percentage
uint16_t body_fat_percentage
Definition: bcs.h:232
BCS_FEAT_MASS_RES_500G
@ BCS_FEAT_MASS_RES_500G
Definition: bcs.h:155
bcs_meas_val_t::soft_lean_mass
uint16_t soft_lean_mass
Definition: bcs.h:239
BCS_MASS_RES_20G
@ BCS_MASS_RES_20G
Definition: bcs.h:178
bcs_meas_val_t::basal_metabolism
uint16_t basal_metabolism
Definition: bcs.h:235
BCS_MEAS_FLAG_IMPEDANCE
@ BCS_MEAS_FLAG_IMPEDANCE
Definition: bcs.h:131
bcs_init_t::bcs_unit
bcs_unit_t bcs_unit
Definition: bcs.h:274
BCS_FEAT_BODY_WATER_MASS
@ BCS_FEAT_BODY_WATER_MASS
Definition: bcs.h:149
BCS_FEAT_FAT_FREE_MASS
@ BCS_FEAT_FAT_FREE_MASS
Definition: bcs.h:147
BCS_FEAT_HEIGHT
@ BCS_FEAT_HEIGHT
Definition: bcs.h:152
BCS_MEAS_FLAG_DATE_TIME_PRESENT
@ BCS_MEAS_FLAG_DATE_TIME_PRESENT
Definition: bcs.h:123
bcs_service_init
sdk_err_t bcs_service_init(bcs_init_t *p_bcs_init)
Initialize a Body Composition Service instance and add in the DB.
bcs_meas_flag_t::muscle_mass_present
uint8_t muscle_mass_present
Definition: bcs.h:220
bcs_meas_flag_t::user_id_present
uint8_t user_id_present
Definition: bcs.h:217
BCS_HEIGHT_RES_1MM
@ BCS_HEIGHT_RES_1MM
Definition: bcs.h:188
BCS_EVT_INVALID
@ BCS_EVT_INVALID
Definition: bcs.h:201
BCS_FEAT_FULL_BIT
@ BCS_FEAT_FULL_BIT
Definition: bcs.h:168
BCS_EVT_MEAS_INDICATION_CPLT
@ BCS_EVT_MEAS_INDICATION_CPLT
Definition: bcs.h:204
BCS_MASS_RES_100G
@ BCS_MASS_RES_100G
Definition: bcs.h:176