Mistake on this page?
Report an issue in GitHub or email us
Public Member Functions
ChainableGapEventHandler Class Reference

Gap::EventHandler implementation that allows the application to register multiple separate EventHandlers to be called when Gap events happen. More...

#include <ChainableGapEventHandler.h>

Inheritance diagram for ChainableGapEventHandler:
Gap::EventHandler ChainableEventHandler< ble::Gap::EventHandler >

Public Member Functions

void onScanRequestReceived (const ble::ScanRequestEvent &event) override
 Called when an advertising device receive a scan response. More...
 
void onAdvertisingStart (const ble::AdvertisingStartEvent &event) override
 Called when advertising starts. More...
 
void onAdvertisingEnd (const ble::AdvertisingEndEvent &event) override
 Called when advertising ends. More...
 
void onAdvertisingReport (const ble::AdvertisingReportEvent &event) override
 Called when a scanner receives an advertising or a scan response packet. More...
 
void onScanTimeout (const ble::ScanTimeoutEvent &event) override
 Called when scan times out. More...
 
void onPeriodicAdvertisingSyncEstablished (const ble::PeriodicAdvertisingSyncEstablishedEvent &event) override
 Called when first advertising packet in periodic advertising is received. More...
 
void onPeriodicAdvertisingReport (const ble::PeriodicAdvertisingReportEvent &event) override
 Called when a periodic advertising packet is received. More...
 
void onPeriodicAdvertisingSyncLoss (const ble::PeriodicAdvertisingSyncLoss &event) override
 Called when a periodic advertising sync has been lost. More...
 
void onConnectionComplete (const ble::ConnectionCompleteEvent &event) override
 Called when connection attempt ends or an advertising device has been connected. More...
 
void onUpdateConnectionParametersRequest (const ble::UpdateConnectionParametersRequestEvent &event) override
 Called when the peer request connection parameters updates. More...
 
void onConnectionParametersUpdateComplete (const ble::ConnectionParametersUpdateCompleteEvent &event) override
 Called when connection parameters have been updated. More...
 
void onDisconnectionComplete (const ble::DisconnectionCompleteEvent &event) override
 Called when a connection has been disconnected. More...
 
void onReadPhy (ble_error_t status, ble::connection_handle_t connectionHandle, ble::phy_t txPhy, ble::phy_t rxPhy) override
 Function invoked when the current transmitter and receiver PHY have been read for a given connection. More...
 
void onPhyUpdateComplete (ble_error_t status, ble::connection_handle_t connectionHandle, ble::phy_t txPhy, ble::phy_t rxPhy) override
 Function invoked when the update process of the PHY has been completed. More...
 
void onDataLengthChange (ble::connection_handle_t connectionHandle, uint16_t txSize, uint16_t rxSize) override
 Function invoked when the connections changes the maximum number of octets that can be sent or received by the controller in a single packet. More...
 
void onPrivacyEnabled () override
 Function invoked when the privacy subsystem has been enabled and is ready to be used. More...
 
bool addEventHandler (ble::Gap::EventHandler *event_handler)
 Add an EventHandler to be notified of events sent to this ChainableEventHandler. More...
 
void removeEventHandler (ble::Gap::EventHandler *target)
 Remove an EventHandler previously added with addEventHandler. More...
 

Detailed Description

Gap::EventHandler implementation that allows the application to register multiple separate EventHandlers to be called when Gap events happen.

Definition at line 30 of file ChainableGapEventHandler.h.

Member Function Documentation

bool addEventHandler ( ble::Gap::EventHandler event_handler)
inherited

Add an EventHandler to be notified of events sent to this ChainableEventHandler.

Parameters
[in]event_handlerHandler to add to chain
Return values
trueif adding EventHandler was successful, false otherwise

Definition at line 54 of file ChainableEventHandler.h.

void onAdvertisingEnd ( const ble::AdvertisingEndEvent event)
overridevirtual

Called when advertising ends.

Advertising ends when the process timeout or if it is stopped by the application or if the local device accepts a connection request.

Parameters
eventAdvertising end event.
See also
startAdvertising()
stopAdvertising()
onConnectionComplete()

Reimplemented from Gap::EventHandler.

Definition at line 48 of file ChainableGapEventHandler.h.

void onAdvertisingReport ( const ble::AdvertisingReportEvent event)
overridevirtual

Called when a scanner receives an advertising or a scan response packet.

Parameters
eventAdvertising report.
See also
startScan()

Reimplemented from Gap::EventHandler.

Definition at line 52 of file ChainableGapEventHandler.h.

void onAdvertisingStart ( const ble::AdvertisingStartEvent event)
overridevirtual

Called when advertising starts.

Parameters
eventAdvertising start event.
See also
startAdvertising()

Reimplemented from Gap::EventHandler.

Definition at line 44 of file ChainableGapEventHandler.h.

void onConnectionComplete ( const ble::ConnectionCompleteEvent event)
overridevirtual

Called when connection attempt ends or an advertising device has been connected.

See also
startAdvertising()
connect()
Parameters
eventConnection event.

Reimplemented from Gap::EventHandler.

Definition at line 75 of file ChainableGapEventHandler.h.

void onConnectionParametersUpdateComplete ( const ble::ConnectionParametersUpdateCompleteEvent event)
overridevirtual

Called when connection parameters have been updated.

Parameters
eventThe new connection parameters.
See also
updateConnectionParameters()
acceptConnectionParametersUpdate()

Reimplemented from Gap::EventHandler.

Definition at line 84 of file ChainableGapEventHandler.h.

void onDataLengthChange ( ble::connection_handle_t  connectionHandle,
uint16_t  txSize,
uint16_t  rxSize 
)
overridevirtual

Function invoked when the connections changes the maximum number of octets that can be sent or received by the controller in a single packet.

A single L2CAP packet can be fragmented across many such packets.

Note
This only triggers if controller supports data length extension and negotiated data length is longer than the default 23.
Parameters
connectionHandleThe handle of the connection that changed the size.
txSizeNumber of octets we can send on this connection in a single packet.
rxSizeNumber of octets we can receive on this connection in a single packet.

Reimplemented from Gap::EventHandler.

Definition at line 111 of file ChainableGapEventHandler.h.

void onDisconnectionComplete ( const ble::DisconnectionCompleteEvent event)
overridevirtual

Called when a connection has been disconnected.

Parameters
eventDetails of the event.
See also
disconnect()

Reimplemented from Gap::EventHandler.

Definition at line 89 of file ChainableGapEventHandler.h.

void onPeriodicAdvertisingReport ( const ble::PeriodicAdvertisingReportEvent event)
overridevirtual

Called when a periodic advertising packet is received.

Parameters
eventPeriodic advertisement event.
Version
: 5+.
See also
createSync()

Reimplemented from Gap::EventHandler.

Definition at line 65 of file ChainableGapEventHandler.h.

void onPeriodicAdvertisingSyncEstablished ( const ble::PeriodicAdvertisingSyncEstablishedEvent event)
overridevirtual

Called when first advertising packet in periodic advertising is received.

Parameters
eventPeriodic advertising sync event.
Version
: 5+.
See also
createSync()

Reimplemented from Gap::EventHandler.

Definition at line 60 of file ChainableGapEventHandler.h.

void onPeriodicAdvertisingSyncLoss ( const ble::PeriodicAdvertisingSyncLoss event)
overridevirtual

Called when a periodic advertising sync has been lost.

Parameters
eventDetails of the event.
Version
: 5+.
See also
createSync()

Reimplemented from Gap::EventHandler.

Definition at line 70 of file ChainableGapEventHandler.h.

void onPhyUpdateComplete ( ble_error_t  status,
ble::connection_handle_t  connectionHandle,
ble::phy_t  txPhy,
ble::phy_t  rxPhy 
)
overridevirtual

Function invoked when the update process of the PHY has been completed.

The process can be initiated by a call to the function setPhy, the local bluetooth subsystem or the peer.

Parameters
statusStatus of the operation: BLE_ERROR_NONE in case of success or an appropriate error code.
connectionHandleThe handle of the connection on which the operation was made.
txPhyPHY used by the transmitter.
rxPhyPHY used by the receiver.
Note
Success doesn't mean the PHY has been updated it means both ends have negotiated the best PHY according to their configuration and capabilities. The PHY currently used are present in the txPhy and rxPhy parameters.
See also
setPhy()
Version
: 5+.

Reimplemented from Gap::EventHandler.

Definition at line 102 of file ChainableGapEventHandler.h.

void onPrivacyEnabled ( )
overridevirtual

Function invoked when the privacy subsystem has been enabled and is ready to be used.

Reimplemented from Gap::EventHandler.

Definition at line 119 of file ChainableGapEventHandler.h.

void onReadPhy ( ble_error_t  status,
ble::connection_handle_t  connectionHandle,
ble::phy_t  txPhy,
ble::phy_t  rxPhy 
)
overridevirtual

Function invoked when the current transmitter and receiver PHY have been read for a given connection.

Parameters
statusStatus of the operation: BLE_ERROR_NONE in case of success or an appropriate error code.
connectionHandleThe handle of the connection for which the PHYs have been read.
txPhyPHY used by the transmitter.
rxPhyPHY used by the receiver.
See also
readPhy().
Version
: 5+.

Reimplemented from Gap::EventHandler.

Definition at line 93 of file ChainableGapEventHandler.h.

void onScanRequestReceived ( const ble::ScanRequestEvent event)
overridevirtual

Called when an advertising device receive a scan response.

Parameters
eventScan request event.
Version
: 5+.
See also
AdvertisingParameters::setScanRequestNotification().

Reimplemented from Gap::EventHandler.

Definition at line 40 of file ChainableGapEventHandler.h.

void onScanTimeout ( const ble::ScanTimeoutEvent event)
overridevirtual

Called when scan times out.

Parameters
eventAssociated event.
See also
startScan()

Reimplemented from Gap::EventHandler.

Definition at line 56 of file ChainableGapEventHandler.h.

void onUpdateConnectionParametersRequest ( const ble::UpdateConnectionParametersRequestEvent event)
overridevirtual

Called when the peer request connection parameters updates.

Application must accept the update with acceptConnectionParametersUpdate() or reject it with rejectConnectionParametersUpdate().

Parameters
eventThe connection parameters requested by the peer.
Version
4.1+.
Note
This event is not generated if connection parameters update is managed by the middleware.
See also
manageConnectionParametersUpdateRequest()
acceptConnectionParametersUpdate()
rejectConnectionParametersUpdate()

Reimplemented from Gap::EventHandler.

Definition at line 79 of file ChainableGapEventHandler.h.

void removeEventHandler ( ble::Gap::EventHandler target)
inherited

Remove an EventHandler previously added with addEventHandler.

Parameters
[in]event_handlerPointer to event handler to remove

Definition at line 74 of file ChainableEventHandler.h.

Important Information for this Arm website

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies. If you are not happy with the use of these cookies, please review our Cookie Policy to learn how they can be disabled. By disabling cookies, some features of the site will not work.