ble_gap_event struct Represents a GAP-related event. When such an event occurs, the host notifies the application by passing an instance of this structure to an application-specified callback.
Syntax
struct ble_gap_event
{
uint8_t type ;
union {
struct {
int status ;
uint16_t conn_handle ;
#if MYNEWT_VAL ( BLE_PERIODIC_ADV_WITH_RESPONSES )
uint8_t adv_handle ;
uint16_t sync_handle ;
#endif
} connect ;
struct {
int status ;
uint16_t conn_handle ;
#if MYNEWT_VAL ( BLE_PERIODIC_ADV_WITH_RESPONSES )
uint8_t adv_handle ;
uint16_t sync_handle ;
#endif
} link_estab ;
struct {
int reason ;
struct ble_gap_conn_desc conn ;
} disconnect ;
struct ble_gap_disc_desc disc ;
#if MYNEWT_VAL ( BLE_EXT_ADV )
struct ble_gap_ext_disc_desc ext_disc ;
#endif
struct {
int reason ;
} disc_complete ;
struct {
int reason ;
#if MYNEWT_VAL ( BLE_EXT_ADV )
uint8_t instance ;
uint16_t conn_handle ;
uint8_t num_ext_adv_events ;
#endif
} adv_complete ;
struct {
int status ;
uint16_t conn_handle ;
} conn_update ;
struct {
const struct ble_gap_upd_params * peer_params ;
struct ble_gap_upd_params * self_params ;
uint16_t conn_handle ;
} conn_update_req ;
struct {
int status ;
uint16_t conn_handle ;
} term_failure ;
struct {
int status ;
uint16_t conn_handle ;
} enc_change ;
struct {
struct ble_gap_passkey_params params ;
uint16_t conn_handle ;
} passkey ;
struct {
struct os_mbuf * om ;
uint16_t attr_handle ;
uint16_t conn_handle ;
uint8_t indication : 1 ;
} notify_rx ;
struct {
int status ;
uint16_t conn_handle ;
uint16_t attr_handle ;
uint8_t indication : 1 ;
} notify_tx ;
struct {
uint16_t conn_handle ;
uint16_t attr_handle ;
uint8_t reason ;
uint8_t prev_notify : 1 ;
uint8_t cur_notify : 1 ;
uint8_t prev_indicate : 1 ;
uint8_t cur_indicate : 1 ;
} subscribe ;
struct {
uint16_t conn_handle ;
uint16_t channel_id ;
uint16_t value ;
} mtu ;
struct {
uint16_t conn_handle ;
ble_addr_t peer_id_addr ;
} identity_resolved ;
struct ble_gap_repeat_pairing repeat_pairing ;
struct {
int status ;
uint16_t conn_handle ;
uint8_t tx_phy ;
uint8_t rx_phy ;
} phy_updated ;
#if MYNEWT_VAL ( BLE_PERIODIC_ADV )
struct {
uint8_t status ;
uint16_t sync_handle ;
uint8_t sid ;
ble_addr_t adv_addr ;
uint8_t adv_phy ;
uint16_t per_adv_ival ;
uint8_t adv_clk_accuracy ;
#if MYNEWT_VAL ( BLE_PERIODIC_ADV_WITH_RESPONSES )
uint8_t num_subevents ;
uint8_t subevent_interval ;
uint8_t response_slot_delay ;
uint8_t response_slot_spacing ;
#endif
} periodic_sync ;
struct {
uint16_t sync_handle ;
int8_t tx_power ;
int8_t rssi ;
#if MYNEWT_VAL ( BLE_PERIODIC_ADV_WITH_RESPONSES )
uint16_t event_counter ;
uint8_t subevent ;
#endif
uint8_t data_status ;
uint8_t data_length ;
const uint8_t * data ;
} periodic_report ;
struct {
uint16_t sync_handle ;
int reason ;
} periodic_sync_lost ;
#endif
#if MYNEWT_VAL ( BLE_EXT_ADV )
struct {
uint8_t instance ;
ble_addr_t scan_addr ;
} scan_req_rcvd ;
#endif
#if MYNEWT_VAL ( BLE_PERIODIC_ADV_SYNC_TRANSFER )
struct {
uint8_t status ;
uint16_t sync_handle ;
uint16_t conn_handle ;
uint16_t service_data ;
uint8_t sid ;
ble_addr_t adv_addr ;
uint8_t adv_phy ;
uint16_t per_adv_itvl ;
uint8_t adv_clk_accuracy ;
#if MYNEWT_VAL ( BLE_PERIODIC_ADV_WITH_RESPONSES )
uint8_t num_subevents ;
uint8_t subevent_interval ;
uint8_t response_slot_delay ;
uint8_t response_slot_spacing ;
#endif
} periodic_transfer ;
#endif
#if MYNEWT_VAL ( BLE_PERIODIC_ADV_SYNC_BIGINFO_REPORTS )
struct {
uint16_t sync_handle ;
uint8_t bis_cnt ;
uint8_t nse ;
uint16_t iso_interval ;
uint8_t bn ;
uint8_t pto ;
uint8_t irc ;
uint16_t max_pdu ;
uint16_t max_sdu ;
uint32_t sdu_interval ;
uint8_t phy ;
uint8_t framing : 1 ;
uint8_t encryption : 1 ;
} biginfo_report ;
#endif
#if MYNEWT_VAL ( BLE_POWER_CONTROL )
struct {
uint16_t conn_handle ;
uint8_t current_path_loss ;
uint8_t zone_entered ;
} pathloss_threshold ;
struct {
uint8_t status ;
uint16_t conn_handle ;
uint8_t reason ;
uint8_t phy ;
int8_t transmit_power_level ;
uint8_t transmit_power_level_flag ;
int8_t delta ;
} transmit_power ;
#endif
struct {
int status ;
uint16_t conn_handle ;
} pairing_complete ;
#if MYNEWT_VAL ( BLE_CONN_SUBRATING )
struct {
uint8_t status ;
uint16_t conn_handle ;
uint16_t subrate_factor ;
uint16_t periph_latency ;
uint16_t cont_num ;
uint16_t supervision_tmo ;
} subrate_change ;
#endif
#if MYNEWT_VAL ( BLE_PERIODIC_ADV_WITH_RESPONSES )
struct {
uint8_t adv_handle ;
uint8_t subevent_start ;
uint8_t subevent_data_count ;
} periodic_adv_subev_data_req ;
struct ble_gap_periodic_adv_response periodic_adv_response ;
#endif
#if MYNEWT_VAL ( BLE_HCI_VS )
struct {
const void * ev ;
uint8_t length ;
} vs_hci ;
#endif
struct {
uint16_t conn_handle ;
uint16_t attr_handle ;
int is_read ;
int out_response ;
} authorize ;
#if MYNEWT_VAL ( BLE_EATT_CHAN_NUM ) > 0
struct {
uint16_t conn_handle ;
uint8_t status ;
uint16_t cid ;
} eatt ;
#endif
#if MYNEWT_VAL ( BLE_ENABLE_CONN_REATTEMPT )
struct {
uint16_t conn_handle ;
uint8_t count ;
} reattempt_cnt ;
#endif
struct {
uint8_t status ;
uint8_t update_evt ;
uint16_t num_pkt ;
} dtm_state ;
struct {
uint16_t conn_handle ;
uint16_t max_tx_octets ;
uint16_t max_tx_time ;
uint16_t max_rx_octets ;
uint16_t max_rx_time ;
} data_len_chg ;
#if MYNEWT_VAL ( BLE_AOA_AOD )
struct {
uint16_t sync_handle ;
uint8_t channel_index ;
int16_t rssi ;
uint8_t rssi_antenna_id ;
uint8_t cte_type ;
uint8_t slot_durations ;
uint8_t packet_status ;
uint16_t periodic_event_counter ;
uint8_t sample_count ;
int8_t * i_samples ;
int8_t * q_samples ;
} connless_iq_report ;
struct {
uint16_t conn_handle ;
uint8_t rx_phy ;
uint8_t data_channel_index ;
int16_t rssi ;
uint8_t rssi_antenna_id ;
uint8_t cte_type ;
uint8_t slot_durations ;
uint8_t packet_status ;
uint16_t conn_event_counter ;
uint8_t sample_count ;
int8_t * i_samples ;
int8_t * q_samples ;
} conn_iq_report ;
struct {
uint8_t status ;
uint16_t conn_handle ;
} cte_req_fail ;
#endif
} ;
} ;
Fields Indicates the type of GAP event that occurred. This is one of the BLE_GAP_EVENT codes.
Examples ble_gap_event is referenced by 35 libraries and example projects: