![]() |
Bluetooth LE Profile API document
Bluetooth LE Profile API document Rev.1.00 [May 22, 2020]
|
The Battery Service exposes the state of a battery within a device. More...
The Battery Service exposes the state of a battery within a device.
Data Structures | |
struct | st_ble_bas_battery_level_presn_format_t |
Characteristic Presentation Format value structure. More... | |
Enumerations | |
enum | e_ble_bas_char_idx_t { BLE_BAS_BATTERY_LEVEL_IDX, BLE_BAS_BATTERY_LEVEL_PRESN_FORMAT_IDX, BLE_BAS_BATTERY_LEVEL_CLI_CNFG_IDX } |
Battery Service characteristic Index. More... | |
enum | e_ble_bas_event_t { BLE_BAS_EVENT_BATTERY_LEVEL_READ_REQ = BLE_SERVS_ATTR_EVENT(BLE_BAS_BATTERY_LEVEL_IDX, BLE_SERVS_READ_REQ), BLE_BAS_EVENT_BATTERY_LEVEL_PRESN_FORMAT_READ_REQ = BLE_SERVS_ATTR_EVENT(BLE_BAS_BATTERY_LEVEL_PRESN_FORMAT_IDX, BLE_SERVS_READ_REQ), BLE_BAS_EVENT_BATTERY_LEVEL_CLI_CNFG_WRITE_REQ = BLE_SERVS_ATTR_EVENT(BLE_BAS_BATTERY_LEVEL_CLI_CNFG_IDX, BLE_SERVS_WRITE_REQ), BLE_BAS_EVENT_BATTERY_LEVEL_CLI_CNFG_WRITE_COMP = BLE_SERVS_ATTR_EVENT(BLE_BAS_BATTERY_LEVEL_CLI_CNFG_IDX, BLE_SERVS_WRITE_COMP), BLE_BAS_EVENT_BATTERY_LEVEL_CLI_CNFG_READ_REQ = BLE_SERVS_ATTR_EVENT(BLE_BAS_BATTERY_LEVEL_CLI_CNFG_IDX, BLE_SERVS_READ_REQ) } |
Battery Service event type. More... | |
Functions | |
ble_status_t | R_BLE_BAS_SetBatteryLevel (const uint8_t *p_value) |
Set Battery Level characteristic value to the local GATT database. More... | |
ble_status_t | R_BLE_BAS_GetBatteryLevel (uint8_t *p_value) |
Get Battery Level characteristic value from the local GATT database. More... | |
ble_status_t | R_BLE_BAS_NotifyBatteryLevel (uint16_t conn_hdl, const uint8_t *p_value) |
Send notification of Battery Level characteristic value to the remote device. More... | |
ble_status_t | R_BLE_BAS_SetBatteryLevelPresnFormat (const st_ble_bas_battery_level_presn_format_t *p_value) |
Set Battery Level presn format descriptor value to the local GATT database. More... | |
ble_status_t | R_BLE_BAS_GetBatteryLevelPresnFormat (st_ble_bas_battery_level_presn_format_t *p_value) |
Get Battery Level presn format descriptor value from the local GATT database. More... | |
ble_status_t | R_BLE_BAS_SetBatteryLevelCliCnfg (const uint16_t *p_value) |
Set Battery Level cli cnfg descriptor value to the local GATT database. More... | |
ble_status_t | R_BLE_BAS_GetBatteryLevelCliCnfg (uint16_t *p_value) |
Get Battery Level cli cnfg descriptor value from the local GATT database. More... | |
ble_status_t | R_BLE_BAS_Init (ble_servs_app_cb_t cb) |
Initialize Battery Service service. More... | |
enum e_ble_bas_char_idx_t |
Battery Service characteristic Index.
enum e_ble_bas_event_t |
Battery Service event type.
ble_status_t R_BLE_BAS_SetBatteryLevel | ( | const uint8_t * | p_value | ) |
Set Battery Level characteristic value to the local GATT database.
[in] | p_value | Characteristic value to set. |
ble_status_t R_BLE_BAS_GetBatteryLevel | ( | uint8_t * | p_value | ) |
Get Battery Level characteristic value from the local GATT database.
[in] | p_value | Output location for the acquired descriptor value. |
ble_status_t R_BLE_BAS_NotifyBatteryLevel | ( | uint16_t | conn_hdl, |
const uint8_t * | p_value | ||
) |
Send notification of Battery Level characteristic value to the remote device.
[in] | conn_hdl | Connection handle. |
[in] | p_value | Characteristic value to send. |
ble_status_t R_BLE_BAS_SetBatteryLevelPresnFormat | ( | const st_ble_bas_battery_level_presn_format_t * | p_value | ) |
Set Battery Level presn format descriptor value to the local GATT database.
[in] | p_value | Descriptor value to set. |
ble_status_t R_BLE_BAS_GetBatteryLevelPresnFormat | ( | st_ble_bas_battery_level_presn_format_t * | p_value | ) |
Get Battery Level presn format descriptor value from the local GATT database.
[in] | p_value | Output location for the acquired descriptor value. |
ble_status_t R_BLE_BAS_SetBatteryLevelCliCnfg | ( | const uint16_t * | p_value | ) |
Set Battery Level cli cnfg descriptor value to the local GATT database.
[in] | p_value | Descriptor value to set. |
ble_status_t R_BLE_BAS_GetBatteryLevelCliCnfg | ( | uint16_t * | p_value | ) |
Get Battery Level cli cnfg descriptor value from the local GATT database.
[in] | p_value | Output location for the acquired descriptor value. |
ble_status_t R_BLE_BAS_Init | ( | ble_servs_app_cb_t | cb | ) |