Functions
Functions
BLE Services » Battery Service (BAS)

## Functions
sdk_err_t | bas_service_init (bas_init_t bas_init[], uint8_t ins_num)
| Initialize Battery Service instances and add to the DB. More...
sdk_err_t | bas_batt_lvl_update (uint8_t conn_idx, uint8_t ins_idx, uint8_t batt_lvl)
| Update a Battery Level value. If notification is enabled, send it. More...

## Detailed Description

## Function Documentation

## ◆ bas_batt_lvl_update()

sdk_err_t bas_batt_lvl_update | ( | uint8_t | conn_idx,
|  | uint8_t | ins_idx,
|  | uint8_t | batt_lvl
| ) |  |

Update a Battery Level value. If notification is enabled, send it.

Parameters

  [in] | conn_idx | Connection index.
  [in] | ins_idx | Battery Service instance index.
  [in] | batt_lvl | Battery Level value.

Returns
  Result of battery level updating.

## ◆ bas_service_init()

sdk_err_t bas_service_init | ( | bas_init_t | bas_init[],
|  | uint8_t | ins_num
| ) |  |

Initialize Battery Service instances and add to the DB.

Parameters

  [in] | ins_num | The number of Battery Service instances.
  [in] | bas_init | The array of Battery Service initialization variables.

Returns
  Result of service initialization.