Battery service sample implementation API.
More...
|
| file | bas.h |
| | Battery Service sample implementation API.
|
| |
Battery service sample implementation API.
◆ bas_init()
Register Battery Service instance
For application with single instance of BAS, info parameter is optional. Otherwise info is mandatory as per BAS 1.0 specification since this will add Content Presentation Format descriptor to Battery Level characteristic.
- Parameters
-
| [in] | config | service configuration |
| [in] | info | battery instance information |
- Returns
- service instance
◆ bas_notify_level()
Notify client with battery level
- Parameters
-
| [in] | svc | service instance |
| [in] | conn_idx | connection index |
◆ bas_set_level()
| void bas_set_level |
( |
ble_service_t * |
svc, |
|
|
uint8_t |
level, |
|
|
bool |
notify |
|
) |
| |
Set reported battery level
- Parameters
-
| [in] | svc | service instance |
| [in] | level | new battery level |
| [in] | notify | true if clients shall be notified, false otherwise |