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