BLE Battery Service.
More...
|
int | in_ble_basc_add (void *hdl, ble_bas_prf_t *p_prf, comp_cb callback) |
| Add Battery Client Service. More...
|
|
int | in_ble_basc_enable (void *hdl, int conidx, int con_type, uint8_t bas_nb, ble_basc_content_t content[], comp_cb callback) |
| Enable BAS client service. More...
|
|
int | in_ble_basc_read_info_req (void *hdl, int conidx, int bas_nb, int basc_info, ble_basc_read_info_rsp_t *rsp, comp_cb callback) |
| Read peer info. More...
|
|
int | in_ble_basc_ntf_req (void *hdl, uint8_t conidx, uint8_t bas_nb, uint16_t ntf_cfg, comp_cb callback) |
| Configure notification. More...
|
|
int | in_ble_bass_add (void *hdl, ble_bas_prf_t *p_prf, comp_cb callback) |
| Add Battery Server Service. More...
|
|
int | in_ble_bass_enable (void *hdl, int conidx, ble_bass_enable_req_t *p_req, comp_cb callback) |
| Enable BAS server service. More...
|
|
int | in_ble_bass_batt_level_upd_req (void *hdl, int conidx, uint8_t instance, uint8_t batt_lvl, comp_cb callback) |
| Update battery level request. More...
|
|
BLE Battery Service.
◆ ble_bas_evt
Events defines for Battery Services.
Enumerator |
---|
BASC_EVT_BATT_LEVEL_IND | Indicate that the Battery Level value has been received,.
- See also
- in_ble_evt_basc_batt_level_ind_t
|
BASS_EVT_BATT_LEVEL_NTF_CFG_IND | Inform that Battery Level Notification Configuration has been changed - use to update bond data,.
- See also
- in_ble_evt_bass_level_ntf_cfg_ind_t
|
◆ ble_basc_info
Peer battery info that can be read.
Enumerator |
---|
BLE_BASC_BATT_LVL_VAL | Battery Level value.
|
BLE_BASC_NTF_CFG | Battery Level Client Characteristic Configuration.
|
BLE_BASC_BATT_LVL_PRES_FORMAT | Battery Level Characteristic Presentation Format.
|
◆ ble_bass_char_type
Battery Service Characteristics.
Enumerator |
---|
BLE_BAS_CHAR_BATT_LEVEL | Battery Level.
|
◆ ble_bass_desc_type
Battery Service Descriptors.
Enumerator |
---|
BLE_BAS_DESC_BATT_LEVEL_PRES_FORMAT | Battery Level Characteristic Presentation Format.
|
BLE_BAS_DESC_BATT_LEVEL_CFG | Battery Level Client Characteristic Configuration.
|
◆ ble_bass_features
Features Flag Masks.
Enumerator |
---|
BLE_BAS_BATT_LVL_NTF_NOT_SUP | Battery Level Characteristic doesn't support notifications.
|
BLE_BAS_BATT_LVL_NTF_SUP | Battery Level Characteristic support notifications.
|
◆ in_ble_basc_add()
int in_ble_basc_add |
( |
void * |
hdl, |
|
|
ble_bas_prf_t * |
p_prf, |
|
|
comp_cb |
callback |
|
) |
| |
Add Battery Client Service.
- Note
- Add it after device configuration, but before any activity starts
- Parameters
-
[in] | p_prf | Pointer to profile attributes, |
- See also
- ble_bas_prf_t
- Returns
- IN_BLE_ERR_NO_ERROR if successful, otherwise failed.
- See also
- enum in_ble_err_t
◆ in_ble_basc_enable()
int in_ble_basc_enable |
( |
void * |
hdl, |
|
|
int |
conidx, |
|
|
int |
con_type, |
|
|
uint8_t |
bas_nb, |
|
|
ble_basc_content_t |
content[], |
|
|
comp_cb |
callback |
|
) |
| |
Enable BAS client service.
- Note
- First function to call after connection
- Parameters
-
[in] | conidx | Connection index |
[in] | con_type | Connnetion type, |
- See also
- enum in_ble_con_type
- Parameters
-
[in] | bas_nb | Number of instances |
[in,out] | content | Contents of service
- Discover connection type: Stack will fill it
- Normal connection type: Application needs to fill it.
|
- Returns
- IN_BLE_ERR_NO_ERROR if successful, otherwise failed.
- See also
- enum in_ble_err_t
◆ in_ble_basc_ntf_req()
int in_ble_basc_ntf_req |
( |
void * |
hdl, |
|
|
uint8_t |
conidx, |
|
|
uint8_t |
bas_nb, |
|
|
uint16_t |
ntf_cfg, |
|
|
comp_cb |
callback |
|
) |
| |
Configure notification.
- Parameters
-
[in] | conidx | Connection index |
[in] | bas_nb | Instance index
|
[in] | ntf_cfg | notification config |
- Returns
- IN_BLE_ERR_NO_ERROR if successful, otherwise failed.
- See also
- enum in_ble_err_t
◆ in_ble_basc_read_info_req()
int in_ble_basc_read_info_req |
( |
void * |
hdl, |
|
|
int |
conidx, |
|
|
int |
bas_nb, |
|
|
int |
basc_info, |
|
|
ble_basc_read_info_rsp_t * |
rsp, |
|
|
comp_cb |
callback |
|
) |
| |
Read peer info.
- Parameters
-
[in] | conidx | Connection index |
[in] | bas_nb | Instance index
|
[in] | basc_info | Information to read, |
- See also
- enum ble_basc_info
- Parameters
-
[out] | rsp | Response from the peer |
- Returns
- IN_BLE_ERR_NO_ERROR if successful, otherwise failed.
- See also
- enum in_ble_err_t
◆ in_ble_bass_add()
int in_ble_bass_add |
( |
void * |
hdl, |
|
|
ble_bas_prf_t * |
p_prf, |
|
|
comp_cb |
callback |
|
) |
| |
Add Battery Server Service.
- Note
- Add it after device configuration, but before any activity starts
- Parameters
-
[in] | p_prf | Pointer to profile attributes, |
- See also
- in_ble_bas_prf_t
- Returns
- IN_BLE_ERR_NO_ERROR if successful, otherwise failed.
- See also
- enum in_ble_err_t
◆ in_ble_bass_batt_level_upd_req()
int in_ble_bass_batt_level_upd_req |
( |
void * |
hdl, |
|
|
int |
conidx, |
|
|
uint8_t |
instance, |
|
|
uint8_t |
batt_lvl, |
|
|
comp_cb |
callback |
|
) |
| |
Update battery level request.
- Parameters
-
[in] | conidx | Connection index |
[in] | instance | Instance index
|
[in] | batt_lvl | Battery level |
- Returns
- IN_BLE_ERR_NO_ERROR if successful, otherwise failed.
- See also
- enum in_ble_err_t
◆ in_ble_bass_enable()
Enable BAS server service.
- Note
- First function to call after connection
- Parameters
-
[in] | conidx | Connection index |
[in] | p_req | Pointer to the request structure |
- Returns
- IN_BLE_ERR_NO_ERROR if successful, otherwise failed.
- See also
- enum in_ble_err_t