|
ELEC-C7222
Libraries for ELEC C7222 Course Work
|
#include <gap.hpp>


Public Member Functions | |
| virtual void | OnScanRequestReceived (uint8_t advertising_handle, const BleAddress &scanner_address) const |
| GAP event callback interface. | |
| virtual void | OnAdvertisingStart (uint8_t status) const |
| virtual void | OnAdvertisingEnd (uint8_t status, ConnectionHandle connection_handle) const |
| virtual void | OnAdvertisingReport (const AdvertisingReport &report) const |
| virtual void | OnExtendedAdvertisingReport (const ExtendedAdvertisingReport &report) const |
| virtual void | OnScanTimeout (uint8_t status) const |
| virtual void | OnPeriodicAdvertisingSyncEstablished (uint8_t status, ConnectionHandle sync_handle) const |
| virtual void | OnPeriodicAdvertisingReport (ConnectionHandle sync_handle, int8_t tx_power, int8_t rssi, uint8_t data_status, const uint8_t *data, uint8_t data_length) const |
| virtual void | OnPeriodicAdvertisingSyncLoss (ConnectionHandle sync_handle) const |
| virtual void | OnConnectionComplete (uint8_t status, ConnectionHandle con_handle, const BleAddress &address, uint16_t conn_interval, uint16_t conn_latency, uint16_t supervision_timeout) const |
| virtual void | OnUpdateConnectionParametersRequest (ConnectionHandle con_handle, uint16_t min_interval, uint16_t max_interval, uint16_t latency, uint16_t supervision_timeout) const |
| virtual void | OnConnectionParametersUpdateComplete (uint8_t status, ConnectionHandle con_handle, uint16_t conn_interval, uint16_t conn_latency, uint16_t supervision_timeout) const |
| virtual void | OnDisconnectionComplete (uint8_t status, ConnectionHandle con_handle, uint8_t reason) const |
| virtual void | OnReadPhy (uint8_t status, ConnectionHandle con_handle, Phy tx_phy, Phy rx_phy) const |
| virtual void | OnPhyUpdateComplete (uint8_t status, ConnectionHandle con_handle, Phy tx_phy, Phy rx_phy) const |
| virtual void | OnDataLengthChange (ConnectionHandle con_handle, uint16_t tx_size, uint16_t rx_size) const |
| virtual void | OnPrivacyEnabled () const |
| virtual void | OnSecurityLevel (ConnectionHandle con_handle, uint8_t security_level) const |
| virtual void | OnDedicatedBondingCompleted (uint8_t status, const BleAddress &address) const |
| virtual void | OnInquiryResult (const InquiryResult &result) const |
| virtual void | OnInquiryComplete (uint8_t status) const |
| virtual void | OnRssiMeasurement (ConnectionHandle con_handle, int8_t rssi) const |
| virtual void | OnLocalOobData (bool oob_data_present, const uint8_t *c_192, const uint8_t *r_192, const uint8_t *c_256, const uint8_t *r_256) const |
| virtual void | OnPairingStarted (ConnectionHandle con_handle, const BleAddress &address, bool ssp, bool initiator) const |
| virtual void | OnPairingComplete (ConnectionHandle con_handle, const BleAddress &address, uint8_t status) const |
Protected Member Functions | |
| ~EventHandler ()=default | |
|
protecteddefault |
Prevent polymorphic deletion and avoid unnecessary virtual destructor as the Gap class will never delete the instance it contains.
|
inlinevirtual |
Called when advertising is disabled or terminated by a connection.
| status | HCI status (0x00 for success). |
| connection_handle | Connection handle if ended due to connection, otherwise 0. |
BTstack events:
Reimplemented in GapEventHandler.
|
inlinevirtual |
Called when GAP_EVENT_ADVERTISING_REPORT is received.
| report | Advertising report payload. |
BTstack event: GAP_EVENT_ADVERTISING_REPORT.
Reimplemented in GapEventHandler.
|
inlinevirtual |
Called when advertising enable completes.
| status | HCI status (0x00 for success). |
BTstack event: HCI_EVENT_COMMAND_COMPLETE for HCI_LE_SET_ADVERTISING_ENABLE.
Reimplemented in GapEventHandler.
|
inlinevirtual |
Called when a LE connection completes.
| status | HCI status (0x00 for success). |
| con_handle | Connection handle. |
| address | Peer device address. |
| conn_interval | Connection interval (unit: 1.25 ms). |
| conn_latency | Peripheral latency (number of events to skip). |
| supervision_timeout | Supervision timeout (unit: 10 ms). |
BTstack events:
Reimplemented in GapEventHandler.
|
inlinevirtual |
Called when connection parameters have been updated.
| status | HCI status (0x00 for success). |
| con_handle | Connection handle. |
| conn_interval | Connection interval (unit: 1.25 ms). |
| conn_latency | Peripheral latency. |
| supervision_timeout | Supervision timeout (unit: 10 ms). |
BTstack event: HCI_EVENT_LE_META + HCI_SUBEVENT_LE_CONNECTION_UPDATE_COMPLETE.
Reimplemented in GapEventHandler.
|
inlinevirtual |
Called when data length changes for a connection.
| con_handle | Connection handle. |
| tx_size | Max TX payload size (octets). |
| rx_size | Max RX payload size (octets). |
BTstack event: HCI_EVENT_LE_META + HCI_SUBEVENT_LE_DATA_LENGTH_CHANGE.
Reimplemented in GapEventHandler.
|
inlinevirtual |
Called when GAP_EVENT_DEDICATED_BONDING_COMPLETED is received.
| status | Status of the bonding procedure. |
| address | Peer device address. |
BTstack event: GAP_EVENT_DEDICATED_BONDING_COMPLETED.
Reimplemented in GapEventHandler.
|
inlinevirtual |
Called when a connection is disconnected.
| status | HCI status (0x00 for success). |
| con_handle | Connection handle. |
| reason | HCI Disconnect reason. |
BTstack event: HCI_EVENT_DISCONNECTION_COMPLETE.
Reimplemented in GapEventHandler.
|
inlinevirtual |
Called when GAP_EVENT_EXTENDED_ADVERTISING_REPORT is received.
| report | Extended advertising report payload. |
BTstack event: GAP_EVENT_EXTENDED_ADVERTISING_REPORT.
Reimplemented in GapEventHandler.
|
inlinevirtual |
Called when GAP_EVENT_INQUIRY_COMPLETE is received.
| status | Status of the inquiry procedure. |
BTstack event: GAP_EVENT_INQUIRY_COMPLETE.
Reimplemented in GapEventHandler.
|
inlinevirtual |
Called when GAP_EVENT_INQUIRY_RESULT is received.
| result | Inquiry result payload. |
BTstack event: GAP_EVENT_INQUIRY_RESULT.
Reimplemented in GapEventHandler.
|
inlinevirtual |
Called when GAP_EVENT_LOCAL_OOB_DATA is received.
| oob_data_present | True if OOB data is available. |
| c_192 | 192-bit confirm value (16 bytes). |
| r_192 | 192-bit random value (16 bytes). |
| c_256 | 256-bit confirm value (16 bytes). |
| r_256 | 256-bit random value (16 bytes). |
BTstack event: GAP_EVENT_LOCAL_OOB_DATA.
Reimplemented in GapEventHandler.
|
inlinevirtual |
Called when GAP_EVENT_PAIRING_COMPLETE is received.
| con_handle | Connection handle. |
| address | Peer address. |
| status | Status of the pairing procedure. |
BTstack event: GAP_EVENT_PAIRING_COMPLETE.
Reimplemented in GapEventHandler.
|
inlinevirtual |
Called when GAP_EVENT_PAIRING_STARTED is received.
| con_handle | Connection handle. |
| address | Peer address. |
| ssp | True if SSP is used. |
| initiator | True if local device initiated pairing. |
BTstack event: GAP_EVENT_PAIRING_STARTED.
Reimplemented in GapEventHandler.
|
inlinevirtual |
Called when a periodic advertising report is received.
| sync_handle | Sync handle for the periodic advertiser. |
| tx_power | Transmit power in dBm (signed). |
| rssi | RSSI in dBm (signed). |
| data_status | Data status flag from the controller. |
| data | Periodic advertising data (valid during callback only). |
| data_length | Number of bytes in the data payload. |
BTstack event: HCI_EVENT_LE_META + HCI_SUBEVENT_LE_PERIODIC_ADVERTISING_REPORT.
Reimplemented in GapEventHandler.
|
inlinevirtual |
Called when periodic advertising sync is established.
| status | HCI status (0x00 for success). |
| sync_handle | Sync handle assigned by controller. |
BTstack event: HCI_EVENT_LE_META + HCI_SUBEVENT_LE_PERIODIC_ADVERTISING_SYNC_ESTABLISHMENT.
Reimplemented in GapEventHandler.
|
inlinevirtual |
Called when periodic advertising sync is lost.
| sync_handle | Sync handle that was lost. |
BTstack event: HCI_EVENT_LE_META + HCI_SUBEVENT_LE_PERIODIC_ADVERTISING_SYNC_LOST.
Reimplemented in GapEventHandler.
|
inlinevirtual |
Called when the PHY update process completes.
| status | HCI status (0x00 for success). |
| con_handle | Connection handle. |
| tx_phy | Updated transmit PHY. |
| rx_phy | Updated receive PHY. |
BTstack event: HCI_EVENT_LE_META + HCI_SUBEVENT_LE_PHY_UPDATE_COMPLETE.
Reimplemented in GapEventHandler.
|
inlinevirtual |
Called when privacy becomes enabled and ready.
BTstack: no dedicated event; call after successful privacy configuration.
Reimplemented in GapEventHandler.
|
inlinevirtual |
Called when LE PHYs have been read.
| status | HCI status (0x00 for success). |
| con_handle | Connection handle. |
| tx_phy | Transmit PHY. |
| rx_phy | Receive PHY. |
BTstack event: HCI_EVENT_COMMAND_COMPLETE for HCI_LE_READ_PHY.
Reimplemented in GapEventHandler.
|
inlinevirtual |
Called when GAP_EVENT_RSSI_MEASUREMENT is received.
| con_handle | Connection handle. |
| rssi | RSSI in dBm (signed). |
BTstack event: GAP_EVENT_RSSI_MEASUREMENT.
Reimplemented in GapEventHandler.
|
inlinevirtual |
GAP event callback interface.
Handlers are invoked from the BTstack event dispatch context. Event data references (pointers/arrays) are only valid during the callback; copy any data you need to retain beyond the call. Called when the controller reports a scan request to this advertiser.
| advertising_handle | Advertising set handle. |
| scanner_address | Address of the scanning device. |
BTstack event: HCI_EVENT_LE_META + HCI_SUBEVENT_LE_SCAN_REQUEST_RECEIVED.
Reimplemented in GapEventHandler.
|
inlinevirtual |
Called when a scan timeout is reported.
| status | HCI status (0x00 for success). |
BTstack event: HCI_EVENT_LE_META + HCI_SUBEVENT_LE_SCAN_TIMEOUT.
Reimplemented in GapEventHandler.
|
inlinevirtual |
Called when GAP_EVENT_SECURITY_LEVEL is received.
| con_handle | Connection handle for the link. |
| security_level | Negotiated security level. |
BTstack event: GAP_EVENT_SECURITY_LEVEL.
Reimplemented in GapEventHandler.
|
inlinevirtual |
Called when the peer requests connection parameter updates.
| con_handle | Connection handle. |
| min_interval | Minimum requested interval (unit: 1.25 ms). |
| max_interval | Maximum requested interval (unit: 1.25 ms). |
| latency | Requested slave latency. |
| supervision_timeout | Requested supervision timeout (unit: 10 ms). |
BTstack events:
Reimplemented in GapEventHandler.