NimBLE-Arduino 2.1.2
|
#include <ble_gap.h>
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.
union { ... } ble_gap_event |
A discriminated union containing additional details concerning the GAP event. The 'type' field indicates which member of the union is valid.
struct { ... } ble_gap_event::adv_complete |
Represents a completed advertise procedure. Valid for the following event types: o BLE_GAP_EVENT_ADV_COMPLETE
uint16_t ble_gap_event::attr_handle |
The handle of the relevant ATT attribute.
The handle of the relevant characteristic value.
The value handle of the relevant characteristic.
struct { ... } ble_gap_event::authorize |
GATT Authorization Event. Ask the user to authorize a GATT read/write operation.
Valid for the following event types: o BLE_GAP_EVENT_AUTHORIZE
Valid responses from user: o BLE_GAP_AUTHORIZE_ACCEPT o BLE_GAP_AUTHORIZE_REJECT
uint16_t ble_gap_event::channel_id |
Indicates the channel whose MTU has been updated; either BLE_L2CAP_CID_ATT or the ID of a connection-oriented channel.
struct ble_gap_conn_desc ble_gap_event::conn |
Information about the connection prior to termination.
uint16_t ble_gap_event::conn_handle |
The handle of the relevant connection.
struct { ... } ble_gap_event::conn_update |
Represents an attempt to update a connection's parameters. If the attempt was successful, the connection's descriptor reflects the updated parameters.
Valid for the following event types: o BLE_GAP_EVENT_CONN_UPDATE
struct { ... } ble_gap_event::conn_update_req |
Represents a peer's request to update the connection parameters. This event is generated when a peer performs any of the following procedures: o L2CAP Connection Parameter Update Procedure o Link-Layer Connection Parameters Request Procedure
To reject the request, return a non-zero HCI error code. The value returned is the reject reason given to the controller.
Valid for the following event types: o BLE_GAP_EVENT_L2CAP_UPDATE_REQ o BLE_GAP_EVENT_CONN_UPDATE_REQ
struct { ... } ble_gap_event::connect |
Represents a connection attempt. Valid for the following event types: o BLE_GAP_EVENT_CONNECT
uint8_t ble_gap_event::cur_indicate |
Whether the peer is currently subscribed to indications.
uint8_t ble_gap_event::cur_notify |
Whether the peer is currently subscribed to notifications.
struct { ... } ble_gap_event::data_len_chg |
Represent an event for LE Data length change
Valid for the following event types: o BLE_GAP_EVENT_DATA_LEN_CHG
struct ble_gap_disc_desc ble_gap_event::disc |
Represents an advertising report received during a discovery procedure. Valid for the following event types: o BLE_GAP_EVENT_DISC
struct { ... } ble_gap_event::disc_complete |
Represents a completed discovery procedure. Valid for the following event types: o BLE_GAP_EVENT_DISC_COMPLETE
struct { ... } ble_gap_event::disconnect |
Represents a terminated connection. Valid for the following event types: o BLE_GAP_EVENT_DISCONNECT
struct { ... } ble_gap_event::dtm_state |
Represent a event for DTM test results
Valid for the following event types: o BLE_GAP_EVENT_TEST_UPDATE
struct { ... } ble_gap_event::enc_change |
Represents an attempt to change the encrypted state of a connection. If the attempt was successful, the connection descriptor reflects the updated encrypted state.
Valid for the following event types: o BLE_GAP_EVENT_ENC_CHANGE
struct { ... } ble_gap_event::identity_resolved |
Represents a change in peer's identity. This is issued after successful pairing when Identity Address Information was received.
Valid for the following event types: o BLE_GAP_EVENT_IDENTITY_RESOLVED
uint8_t ble_gap_event::indication |
Whether the received command is a notification or an indication; o 0: Notification; o 1: Indication.
Whether the transmitted command is a notification or an indication; o 0: Notification; o 1: Indication.
struct { ... } ble_gap_event::mtu |
Represents a change in an L2CAP channel's MTU.
Valid for the following event types: o BLE_GAP_EVENT_MTU
struct { ... } ble_gap_event::notify_rx |
Represents a received ATT notification or indication.
Valid for the following event types: o BLE_GAP_EVENT_NOTIFY_RX
struct { ... } ble_gap_event::notify_tx |
Represents a transmitted ATT notification or indication, or a completed indication transaction.
Valid for the following event types: o BLE_GAP_EVENT_NOTIFY_TX
struct os_mbuf* ble_gap_event::om |
The contents of the notification or indication. If the application wishes to retain this mbuf for later use, it must set this pointer to NULL to prevent the stack from freeing it.
struct ble_gap_passkey_params ble_gap_event::params |
Contains details about the passkey query.
struct { ... } ble_gap_event::passkey |
Represents a passkey query needed to complete a pairing procedure.
Valid for the following event types: o BLE_GAP_EVENT_PASSKEY_ACTION
const struct ble_gap_upd_params* ble_gap_event::peer_params |
Indicates the connection parameters that the peer would like to use.
struct { ... } ble_gap_event::phy_updated |
Represents a change of PHY. This is issue after successful change on PHY.
uint8_t ble_gap_event::prev_indicate |
Whether the peer was previously subscribed to indications.
uint8_t ble_gap_event::prev_notify |
Whether the peer was previously subscribed to notifications.
int ble_gap_event::reason |
A BLE host return code indicating the reason for the disconnect.
The reason the discovery procedure stopped. Typical reason codes are: o 0: Duration expired. o BLE_HS_EPREEMPTED: Host aborted procedure to configure a peer's identity.
The reason the advertise procedure stopped. Typical reason codes are: o 0: Terminated due to connection. o BLE_HS_ETIMEOUT: Duration expired. o BLE_HS_EPREEMPTED: Host aborted procedure to configure a peer's identity.
uint8_t ble_gap_event::reason |
One of the BLE_GAP_SUBSCRIBE_REASON codes.
struct ble_gap_repeat_pairing ble_gap_event::repeat_pairing |
Represents a peer's attempt to pair despite a bond already existing. The application has two options for handling this event type: o Retry: Return BLE_GAP_REPEAT_PAIRING_RETRY after deleting the conflicting bond. The stack will verify the bond has been deleted and continue the pairing procedure. If the bond is still present, this event will be reported again. o Ignore: Return BLE_GAP_REPEAT_PAIRING_IGNORE. The stack will silently ignore the pairing request.
Valid for the following event types: o BLE_GAP_EVENT_REPEAT_PAIRING
struct ble_gap_upd_params* ble_gap_event::self_params |
Indicates the connection parameters that the local device would like to use. The application callback should fill this in. By default, this struct contains the requested parameters (i.e., it is a copy of 'peer_params').
int ble_gap_event::status |
The status of the connection attempt; o 0: the connection was successfully established. o BLE host error code: the connection attempt failed for the specified reason.
The result of the connection update attempt; o 0: the connection was successfully updated. o BLE host error code: the connection update attempt failed for the specified reason.
A BLE host return code indicating the reason for the failure.
Indicates the result of the encryption state change attempt; o 0: the encrypted state was successfully updated; o BLE host error code: the encryption state change attempt failed for the specified reason.
The status of the notification or indication transaction; o 0: Command successfully sent; o BLE_HS_EDONE: Confirmation (indication ack) received; o BLE_HS_ETIMEOUT: Confirmation (indication ack) never received; o Other return code: Error.
struct { ... } ble_gap_event::subscribe |
Represents a state change in a peer's subscription status. In this comment, the term "update" is used to refer to either a notification or an indication. This event is triggered by any of the following occurrences: o Peer enables or disables updates via a CCCD write. o Connection is about to be terminated and the peer is subscribed to updates. o Peer is now subscribed to updates after its state was restored from persistence. This happens when bonding is restored.
Valid for the following event types: o BLE_GAP_EVENT_SUBSCRIBE
struct { ... } ble_gap_event::term_failure |
Represents a failed attempt to terminate an established connection. Valid for the following event types: o BLE_GAP_EVENT_TERM_FAILURE
uint8_t ble_gap_event::tx_phy |
Indicates enabled TX/RX PHY. Possible values: o BLE_GAP_LE_PHY_1M o BLE_GAP_LE_PHY_2M o BLE_GAP_LE_PHY_CODED
uint8_t ble_gap_event::type |
Indicates the type of GAP event that occurred. This is one of the BLE_GAP_EVENT codes.