To manage events coming from the ATBTLC1000 module, the host driver must provide a
ble_mgr_events_callback_handler
function that allows registration of application callback function
to be executed on each event reported by the ATBTLC1000 module.
Prototype
–
bool ble_mgr_events_callback_handler
(ble_mgr_event_cb_t event_cb_type,
ble_mgr_event_t event_type,
const void,
*ble_event_handler);
Description
– Used by Profile/Service/Application to register the Bluetooth Low Energy events’
callbacks.
Parameters
–
event_cb_type
– types of actions to perform on callbacks, can be either:
REGISTER_CALL_BACK
or
UNREGISTER_CALL_BACK
event_type
– Any one of the event types can be used:
BLE_GAP_EVENT_TYPE,
BLE_GATT_CLIENT_EVENT_TYPE,
BLE_GATT_SERVER_EVENT_TYPE,
BLE_L2CAP_EVENT_TYPE,
BLE_GATT_HTPT_EVENT_TYPE,
BLE_DTM_EVENT_TYPE,
BLE_CUSTOM_EVENT_TYPE
ble_event_handler
– pointer to handler list
Structure
ble_gap_event_cb_t
defines the GAP callbacks. Similarly structures
ble_gatt_client_event_cb_t
and
ble_gatt_server_event_cb_t
define the callbacks of GATT
events.
typedef struct ble_gap_event_cb {
/// BLE Undefined events received from ATBTLC1000, which is not handled in Library
ble_event_callback_t undefined;
/// BLE scan information contains the peer device scan information. Refer \ref
at_ble_scan_info_t
ble_event_callback_t scan_info;
/// Once the BLE scan timeout or scan stop triggers the scan report event. Refer \ref
at_ble_scan_report_t
ble_event_callback_t scan_report;
/// Advertisement complete event. Refer \ref at_ble_adv_cmp_evt_t
ble_event_callback_t advt_cmp;
/// Advertisement report in case of advertisement stopped due to advertisement timeout. Refer
\ref at_ble_adv_report_t
ble_event_callback_t adv_report;
/// BLE device own random address changed event. Refer \ref at_ble_rand_addr_changed_t
ble_event_callback_t rand_addr_changed;
/// BLE connected event, device connected to peer device. Refer \ref at_ble_connected_t
ble_event_callback_t connected;
/// BLE disconnected event, device disconnected from peer device. Refer \ref
at_ble_disconnected_t
ble_event_callback_t disconnected;
/// Connection parameter update done on peer device and own device. Refer \ref
at_ble_conn_param_update_done_t
ATBTLC1000
Establishing Connection with Central Device
©
2017 Microchip Technology Inc.
Training Manual
DS00002599A-page 26