Go to the documentation of this file.
73 #include "custom_config.h"
81 #define BAS_INSTANCE_MAX 1
82 #define BAS_CONNECTION_MAX (10 < CFG_MAX_CONNECTIONS ?\
83 10 : CFG_MAX_CONNECTIONS)
85 #define BAS_LVL_MAX_LEN 1
92 #define BAS_CHAR_MANDATORY 0x07
93 #define BAS_CHAR_LVL_NTF_SUP 0x08
94 #define BAS_CHAR_FORMAT_SUP 0x10
95 #define BAS_CHAR_FULL 0x1f
@ BAS_EVT_NOTIFICATION_DISABLED
Definition: bas.h:108
uint8_t batt_lvl
Definition: bas.h:141
Battery Service event.
Definition: bas.h:118
uint8_t conn_idx
Definition: bas.h:120
@ BAS_EVT_INVALID
Definition: bas.h:106
void(* bas_evt_handler_t)(bas_evt_t *p_evt)
Battery Service event handler type.
Definition: bas.h:129
bas_evt_type_t evt_type
Definition: bas.h:119
@ BAS_EVT_NOTIFICATION_ENABLED
Definition: bas.h:107
sdk_err_t bas_service_init(bas_init_t bas_init[], uint8_t ins_num)
Initialize Battery Service instances and add to the DB.
Battery Service init structure. This contains all options and data needed for initialization of the s...
Definition: bas.h:138
uint16_t sdk_err_t
SDK API result type.
Definition: ble_error.h:243
bas_evt_handler_t evt_handler
Definition: bas.h:139
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.
uint8_t char_mask
Definition: bas.h:140
bas_evt_type_t
Battery Service event types.
Definition: bas.h:105