![]() |
Bluetooth LE Profile API document
Bluetooth LE Profile API document Rev.1.00 [May 22, 2020]
|
This is the client for the Weight Scale Service. More...
This is the client for the Weight Scale Service.
Data Structures | |
struct | st_ble_wsc_evt_data_t |
Weight Scale Service Client event data. More... | |
struct | st_ble_wsc_hdls_t |
Weight Scale Service attribute handles. More... | |
struct | st_ble_wsc_init_param_t |
Weight Scale Service initialization parameters. More... | |
struct | st_ble_wsc_connect_param_t |
Weight Scale Service Client connection parameters. More... | |
struct | st_ble_wsc_disconnect_param_t |
Weight Scale Service disconnection parameters. More... | |
struct | st_ble_wsc_weight_scale_feature_t |
Weight Scale Feature characteristic parameters. More... | |
struct | st_ble_wsc_weight_measurement_t |
Weight Measurement characteristic parameters. More... | |
Typedefs | |
typedef void(* | ble_wsc_app_cb_t) (uint16_t type, ble_status_t result, st_ble_wsc_evt_data_t *p_data) |
Weight Scale Service Client event callback. More... | |
Enumerations | |
enum | e_ble_wsc_event_t { BLE_WSC_EVENT_WEIGHT_SCALE_FEATURE_READ_RSP, BLE_WSC_EVENT_WEIGHT_MEASUREMENT_HDL_VAL_IND, BLE_WSC_EVENT_CLI_CNFG_WRITE_RSP, BLE_WSC_EVENT_ERROR_RSP } |
Weight Scale Service Client event type. More... | |
enum | e_ble_wsc_weight_measurement_t { BLE_WSC_WEIGHT_MEASUREMENT_USER_ID_UNKNOWN_USER = 255 } |
User ID enumeration. More... | |
Functions | |
ble_status_t | R_BLE_WSC_Init (const st_ble_wsc_init_param_t *p_param) |
Initialize Weight Scale Service Client. More... | |
ble_status_t | R_BLE_WSC_Connect (uint16_t conn_hdl, const st_ble_wsc_connect_param_t *p_param) |
Perform Weight Scale Service Client connection settings. More... | |
ble_status_t | R_BLE_WSC_Disconnect (uint16_t conn_hdl, st_ble_wsc_disconnect_param_t *p_param) |
Retrieve Weight Scale Service Client connection specific settings before disconnection. More... | |
ble_status_t | R_BLE_WSC_ReadWeightScaleFeature (uint16_t conn_hdl) |
Read Weight Scale Feature characteristic value from remote GATT database. More... | |
ble_status_t | R_BLE_WSC_SetWeightMeasurementCliCnfg (uint16_t conn_hdl, uint16_t cli_cnfg) |
Set Weight Measurement characteristic cli cnfg. More... | |
void | R_BLE_WSC_ServDiscCb (uint16_t conn_hdl, uint8_t idx, uint16_t type, void *p_param) |
Callback function for the Weight Scale Discovery events. More... | |
uint32_t | R_BLE_WSC_GetVersion (void) |
Return version of the WSC service client. More... | |
Variables | |
const uint8_t | BLE_WSC_UUID [BLE_GATT_16_BIT_UUID_SIZE] |
Weight Scale Service UUID. More... | |
const uint8_t | BLE_WSC_WEIGHT_SCALE_FEATURE_UUID [BLE_GATT_16_BIT_UUID_SIZE] |
Weight Scale Feature characteristic UUID. More... | |
const uint8_t | BLE_WSC_WEIGHT_MEASUREMENT_UUID [BLE_GATT_16_BIT_UUID_SIZE] |
Weight Measurement characteristic UUID. More... | |
#define BLE_WSC_WEIGHT_SCALE_FEATURE_LEN (4) |
Weight Scale Feature characteristic value length.
#define BLE_WSC_WEIGHT_MEASUREMENT_LEN (20) |
Weight Measurement characteristic value length.
#define BLE_WSC_WEIGHT_SCALE_FEATURE_TIME_STAMP_SUPPORTED (1 << 0) |
Time Stamp Supported bit.
#define BLE_WSC_WEIGHT_SCALE_FEATURE_MULTIPLE_USERS_SUPPORTED (1 << 1) |
Multiple Users Supported bit.
#define BLE_WSC_WEIGHT_SCALE_FEATURE_BMI_SUPPORTED (1 << 2) |
BMI Supported bit.
#define BLE_WSC_WEIGHT_SCALE_FEATURE_WEIGHT_MEASUREMENT_RESOLUTION (((1 << 4) - 1) << 3) |
Weight Measurement Resolution bits.
#define BLE_WSC_WEIGHT_SCALE_FEATURE_HEIGHT_MEASUREMENT_RESOLUTION (((1 << 3) - 1) << 7) |
Height Measurement Resolution bits.
#define BLE_WSC_WEIGHT_SCALE_FEATURE_RESERVED_FOR_FUTURE_USE (((1 << 22) - 1) << 10) |
Reserved for future use bits.
#define BLE_WSC_WEIGHT_MEASUREMENT_FLAGS_MEASUREMENT_UNITS (1 << 0) |
Measurement Units bit.
#define BLE_WSC_WEIGHT_MEASUREMENT_FLAGS_TIME_STAMP_PRESENT (1 << 1) |
Time stamp present bit.
#define BLE_WSC_WEIGHT_MEASUREMENT_FLAGS_USER_ID_PRESENT (1 << 2) |
User ID present bit.
#define BLE_WSC_WEIGHT_MEASUREMENT_FLAGS_BMI_AND_HEIGHT_PRESENT (1 << 3) |
BMI and Height present bit.
typedef void(* ble_wsc_app_cb_t) (uint16_t type, ble_status_t result, st_ble_wsc_evt_data_t *p_data) |
Weight Scale Service Client event callback.
enum e_ble_wsc_event_t |
Weight Scale Service Client event type.
ble_status_t R_BLE_WSC_Init | ( | const st_ble_wsc_init_param_t * | p_param | ) |
Initialize Weight Scale Service Client.
This function shall be called once at startup.
[in] | p_param | Pointer to Weight Scale Service Client initialization parameters. |
ble_status_t R_BLE_WSC_Connect | ( | uint16_t | conn_hdl, |
const st_ble_wsc_connect_param_t * | p_param | ||
) |
Perform Weight Scale Service Client connection settings.
This function shall be called on each connection establishment.
[in] | conn_hdl | Connection handle. |
[in] | p_param | Pointer to Connection parameters. |
ble_status_t R_BLE_WSC_Disconnect | ( | uint16_t | conn_hdl, |
st_ble_wsc_disconnect_param_t * | p_param | ||
) |
Retrieve Weight Scale Service Client connection specific settings before disconnection.
This function shall be called on each disconnection.
[in] | conn_hdl | Connection handle. |
[in] | p_param | Pointer to Disconnection parameters. |
ble_status_t R_BLE_WSC_ReadWeightScaleFeature | ( | uint16_t | conn_hdl | ) |
Read Weight Scale Feature characteristic value from remote GATT database.
[in] | conn_hdl | Connection handle. |
ble_status_t R_BLE_WSC_SetWeightMeasurementCliCnfg | ( | uint16_t | conn_hdl, |
uint16_t | cli_cnfg | ||
) |
Set Weight Measurement characteristic cli cnfg.
[in] | conn_hdl | Connection handle. |
[in] | cli_cnfg | Weight Measurement characteristic cli cnfg to set. |
void R_BLE_WSC_ServDiscCb | ( | uint16_t | conn_hdl, |
uint8_t | idx, | ||
uint16_t | type, | ||
void * | p_param | ||
) |
Callback function for the Weight Scale Discovery events.
[in] | conn_hdl | Connection handle. |
[in] | idx | Service index used to distiguish the multiple same UUID service. |
[in] | type | Discovery event type |
[out] | p_param | Pointer to GATTC event data. |
uint32_t R_BLE_WSC_GetVersion | ( | void | ) |
Return version of the WSC service client.
const uint8_t BLE_WSC_UUID[BLE_GATT_16_BIT_UUID_SIZE] |
Weight Scale Service UUID.
const uint8_t BLE_WSC_WEIGHT_SCALE_FEATURE_UUID[BLE_GATT_16_BIT_UUID_SIZE] |
Weight Scale Feature characteristic UUID.
const uint8_t BLE_WSC_WEIGHT_MEASUREMENT_UUID[BLE_GATT_16_BIT_UUID_SIZE] |
Weight Measurement characteristic UUID.