Go to the documentation of this file.
80 #define BAS_INSTANCE_MAX 1
81 #define BAS_CONNECTION_MAX 10
82 #define BAS_LVL_MAX_LEN 1
89 #define BAS_CHAR_MANDATORY 0x07
90 #define BAS_CHAR_LVL_NTF_SUP 0x08
91 #define BAS_CHAR_FORMAT_SUP 0x10
92 #define BAS_CHAR_FULL 0x1f
@ BAS_EVT_NOTIFICATION_DISABLED
Indicate that notification has been disabled.
uint8_t batt_lvl
Initial value of Battery Level characteristic.
uint8_t conn_idx
The index of the connection.
@ BAS_EVT_INVALID
Indicate that it's an invalid event.
void(* bas_evt_handler_t)(bas_evt_t *p_evt)
Battery Service event handler type.
bas_evt_type_t evt_type
The BAS event type.
@ BAS_EVT_NOTIFICATION_ENABLED
Indicate that notification has been enabled.
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.
uint16_t bas_service_start_handle_get(void)
Provide the interface for other modules to obtain the bas service start handle .
uint16_t sdk_err_t
SDK API result type.
bas_evt_handler_t evt_handler
Battery Service event handler.
sdk_err_t bas_batt_lvl_update(uint8_t conn_idx, uint8_t ins_idx, uint8_t batt_lvl)
Update a Battery Level value.
uint8_t char_mask
Initial mask of supported characteristics, and configured with Characteristics Mask.
bas_evt_type_t
Battery Service event types.