SmartSnippets DA1459x SDK
Files | Data Structures | Enumerations | Functions
Body Composition Service

Body composition service sample implementation API. More...

Files

file  bcs.h
 Body Composition Service sample implementation API.
 

Data Structures

struct  bcs_callbacks_t
 BCS application callbacks. More...
 
struct  bcs_body_measurement_t
 

Enumerations

enum  bcs_unit_t { BCS_UNIT_SI, BCS_UNIT_IMPERIAL }
 BCS unit types. More...
 
enum  bcs_feat_t {
  BCS_FEAT_TIME_STAMP = 0x000001, BCS_FEAT_MULTIPLE_USERS = 0x000002, BCS_FEAT_BASAL_METABOLISM = 0x000004, BCS_FEAT_MUSCLE_PERCENTAGE = 0x000008,
  BCS_FEAT_MUSCLE_MASS = 0x000010, BCS_FEAT_FAT_FREE_MASS = 0x000020, BCS_FEAT_SOFT_LEAN_MASS = 0x000040, BCS_FEAT_BODY_WATER_MASS = 0x000080,
  BCS_FEAT_IMPEDANCE = 0x000100, BCS_FEAT_WEIGHT = 0x000200, BCS_FEAT_HEIGHT = 0x000400, BCS_FEAT_MASS_RES_05_KG = 0x000800,
  BCS_FEAT_MASS_RES_02_KG = 0x001000, BCS_FEAT_MASS_RES_01_KG = 0x001800, BCS_FEAT_MASS_RES_005_KG = 0x002000, BCS_FEAT_MASS_RES_002_KG = 0x002800,
  BCS_FEAT_MASS_RES_001_KG = 0x003000, BCS_FEAT_MASS_RES_0005_KG = 0x003800, BCS_FEAT_MASS_RES_05_LB = 0x000800, BCS_FEAT_MASS_RES_02_LB = 0x001000,
  BCS_FEAT_MASS_RES_01_LB = 0x001800, BCS_FEAT_MASS_RES_005_LB = 0x002000, BCS_FEAT_MASS_RES_002_LB = 0x002800, BCS_FEAT_MASS_RES_001_LB = 0x003000,
  BCS_FEAT_MASS_RES_0005_LB = 0x003800, BCS_FEAT_HEIGHT_RES_001_M = 0x008000, BCS_FEAT_HEIGHT_RES_005_M = 0x010000, BCS_FEAT_HEIGHT_RES_0001_M = 0x018000,
  BCS_FEAT_HEIGHT_RES_1_INCH = 0x008000, BCS_FEAT_HEIGHT_RES_05_INCH = 0x010000, BCS_FEAT_HEIGHT_RES_01_INCH = 0x018000
}
 BCS feature types. More...
 

Functions

ble_service_tbcs_init (const ble_service_config_t *config, bcs_feat_t feat, const bcs_callbacks_t *cb)
 
ble_error_t bcs_indicate (ble_service_t *svc, uint16_t conn_idx, bcs_body_measurement_t *meas)
 
void bcs_indicate_all (ble_service_t *svc, bcs_body_measurement_t *meas)
 
bool bcs_is_indication_enabled (ble_service_t *svc, uint16_t conn_idx)
 Check if indication is enabled. More...
 

Detailed Description

Body composition service sample implementation API.

Enumeration Type Documentation

◆ bcs_feat_t

enum bcs_feat_t

BCS feature types.

Enumerator
BCS_FEAT_TIME_STAMP 

Time stamp supported

BCS_FEAT_MULTIPLE_USERS 

Multiple users supported

BCS_FEAT_BASAL_METABOLISM 

Basal metabolism supported

BCS_FEAT_MUSCLE_PERCENTAGE 

Muscle percentage supported

BCS_FEAT_MUSCLE_MASS 

Muscle mass supported

BCS_FEAT_FAT_FREE_MASS 

Fat free mass supported

BCS_FEAT_SOFT_LEAN_MASS 

Soft lean mass supported

BCS_FEAT_BODY_WATER_MASS 

Body water mass supported

BCS_FEAT_IMPEDANCE 

Impedance supported

BCS_FEAT_WEIGHT 

Weight supported

BCS_FEAT_HEIGHT 

Height supported

BCS_FEAT_MASS_RES_05_KG 

Resolution of 0.5 kg

BCS_FEAT_MASS_RES_02_KG 

Resolution of 0.2 kg

BCS_FEAT_MASS_RES_01_KG 

Resolution of 0.1 kg

BCS_FEAT_MASS_RES_005_KG 

Resolution of 0.05 kg

BCS_FEAT_MASS_RES_002_KG 

Resolution of 0.02 kg

BCS_FEAT_MASS_RES_001_KG 

Resolution of 0.01 kg

BCS_FEAT_MASS_RES_0005_KG 

Resolution of 0.005 kg

BCS_FEAT_MASS_RES_05_LB 

Resolution of 1 lb

BCS_FEAT_MASS_RES_02_LB 

Resolution of 0.5 lb

BCS_FEAT_MASS_RES_01_LB 

Resolution of 0.2 lb

BCS_FEAT_MASS_RES_005_LB 

Resolution of 0.1 lb

BCS_FEAT_MASS_RES_002_LB 

Resolution of 0.05 lb

BCS_FEAT_MASS_RES_001_LB 

Resolution of 0.02 lb

BCS_FEAT_MASS_RES_0005_LB 

Resolution of 0.01 lb

BCS_FEAT_HEIGHT_RES_001_M 

Resolution of 0.01 meter

BCS_FEAT_HEIGHT_RES_005_M 

Resolution of 0.005 meter

BCS_FEAT_HEIGHT_RES_0001_M 

Resolution of 0.001 meter

BCS_FEAT_HEIGHT_RES_1_INCH 

Resolution of 1 inch

BCS_FEAT_HEIGHT_RES_05_INCH 

Resolution of 0.5 inch

BCS_FEAT_HEIGHT_RES_01_INCH 

Resolution of 0.1 inch

◆ bcs_unit_t

enum bcs_unit_t

BCS unit types.

Enumerator
BCS_UNIT_SI 

Weight and mass in kilograms and height in meters

BCS_UNIT_IMPERIAL 

Weight and mass in pounds and height in inches

Function Documentation

◆ bcs_indicate()

ble_error_t bcs_indicate ( ble_service_t svc,
uint16_t  conn_idx,
bcs_body_measurement_t meas 
)

Indicate body composition measurement to client

Indicate will only be sent if given client enabled indications before.

Parameters
[in]svcBCS instance
[in]conn_idxconnection index
[in]measbody composition measurement
Returns
0 (BLE_STATUS_OK) if indication was sent successfully, ble_error_t if error occured

◆ bcs_indicate_all()

void bcs_indicate_all ( ble_service_t svc,
bcs_body_measurement_t meas 
)

Indicate body composition measurement to all connected clients

This is roughly equivalent for calling bcs_indicate() for each connected client.

Parameters
[in]svcBCS instance
[in]measbody composition measurement

◆ bcs_init()

ble_service_t* bcs_init ( const ble_service_config_t config,
bcs_feat_t  feat,
const bcs_callbacks_t cb 
)

Register Body Composition Service instance

Parameters
[in]configservice configuration
[in]cbapplication callbacks
[in]featbody composition features
Returns
BCS instance

◆ bcs_is_indication_enabled()

bool bcs_is_indication_enabled ( ble_service_t svc,
uint16_t  conn_idx 
)

Check if indication is enabled.

Parameters
[in]svcservice instance
[in]conn_idxconnection index to sent indication to
Returns
true if indication is enabled, false otherwise