Functions
Functions
BLE Services » Battery Service (BAS)
Collaboration diagram for Functions:

## 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. More...
uint16_t | bas_service_start_handle_get (void)
| Provide the interface for other modules to obtain the bas service start handle . 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.

## ◆ bas_service_start_handle_get()

uint16_t bas_service_start_handle_get | ( | void |  | ) |

Provide the interface for other modules to obtain the bas service start handle .

Returns
  The bas service start handle.