NimBLE-Arduino 2.1.2
Loading...
Searching...
No Matches

#include <ble_gap.h>

Public Attributes

uint8_t type
 
union { 
 
   struct { 
 
      int   status 
 
      uint16_t   conn_handle 
 
   }   connect 
 
   struct { 
 
      int   reason 
 
      struct ble_gap_conn_desc   conn 
 
   }   disconnect 
 
   struct ble_gap_disc_desc   disc 
 
   struct { 
 
      int   reason 
 
   }   disc_complete 
 
   struct { 
 
      int   reason 
 
   }   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 
 
   }   mtu 
 
   struct { 
 
      uint16_t   conn_handle 
 
   }   identity_resolved 
 
   struct ble_gap_repeat_pairing   repeat_pairing 
 
   struct { 
 
      uint8_t   tx_phy 
 
   }   phy_updated 
 
   struct { 
 
   }   authorize 
 
   struct { 
 
   }   dtm_state 
 
   struct { 
 
   }   data_len_chg 
 
};  
 

Detailed Description

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.

Member Data Documentation

◆ [union]

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]

struct { ... } ble_gap_event::adv_complete

Represents a completed advertise procedure. Valid for the following event types: o BLE_GAP_EVENT_ADV_COMPLETE

◆ attr_handle

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]

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

◆ channel_id

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.

◆ conn

struct ble_gap_conn_desc ble_gap_event::conn

Information about the connection prior to termination.

◆ conn_handle

uint16_t ble_gap_event::conn_handle

The handle of the relevant connection.

◆ [struct]

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]

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]

struct { ... } ble_gap_event::connect

Represents a connection attempt. Valid for the following event types: o BLE_GAP_EVENT_CONNECT

◆ cur_indicate

uint8_t ble_gap_event::cur_indicate

Whether the peer is currently subscribed to indications.

◆ cur_notify

uint8_t ble_gap_event::cur_notify

Whether the peer is currently subscribed to notifications.

◆ [struct]

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

◆ disc

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]

struct { ... } ble_gap_event::disc_complete

Represents a completed discovery procedure. Valid for the following event types: o BLE_GAP_EVENT_DISC_COMPLETE

◆ [struct]

struct { ... } ble_gap_event::disconnect

Represents a terminated connection. Valid for the following event types: o BLE_GAP_EVENT_DISCONNECT

◆ [struct]

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]

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]

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

◆ indication

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]

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]

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]

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

◆ om

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.

◆ params

struct ble_gap_passkey_params ble_gap_event::params

Contains details about the passkey query.

◆ [struct]

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

◆ peer_params

const struct ble_gap_upd_params* ble_gap_event::peer_params

Indicates the connection parameters that the peer would like to use.

◆ [struct]

struct { ... } ble_gap_event::phy_updated

Represents a change of PHY. This is issue after successful change on PHY.

◆ prev_indicate

uint8_t ble_gap_event::prev_indicate

Whether the peer was previously subscribed to indications.

◆ prev_notify

uint8_t ble_gap_event::prev_notify

Whether the peer was previously subscribed to notifications.

◆ reason [1/2]

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.

◆ reason [2/2]

uint8_t ble_gap_event::reason

One of the BLE_GAP_SUBSCRIBE_REASON codes.

◆ repeat_pairing

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

◆ self_params

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').

◆ status

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]

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]

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

◆ tx_phy

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

◆ type

uint8_t ble_gap_event::type

Indicates the type of GAP event that occurred. This is one of the BLE_GAP_EVENT codes.