This service defines behavior when a link is lost between two devices. More...
#include <LinkLossService.h>
Public Member Functions | |
LinkLossService (BLE &bleIn, callback_t callbackIn, AlertLevel_t levelIn=NO_ALERT) | |
void | setCallback (callback_t newCallback) |
Update the callback. More... | |
void | setAlertLevel (AlertLevel_t newLevel) |
Update alertness level. More... | |
virtual void | onScanRequestReceived (const ScanRequestEvent &event) |
Called when an advertising device receive a scan response. More... | |
virtual void | onAdvertisingStart (const AdvertisingStartEvent &event) |
Called when advertising starts. More... | |
virtual void | onAdvertisingEnd (const AdvertisingEndEvent &event) |
Called when advertising ends. More... | |
virtual void | onAdvertisingReport (const AdvertisingReportEvent &event) |
Called when a scanner receives an advertising or a scan response packet. More... | |
virtual void | onScanTimeout (const ScanTimeoutEvent &event) |
Called when scan times out. More... | |
virtual void | onPeriodicAdvertisingSyncEstablished (const PeriodicAdvertisingSyncEstablishedEvent &event) |
Called when first advertising packet in periodic advertising is received. More... | |
virtual void | onPeriodicAdvertisingReport (const PeriodicAdvertisingReportEvent &event) |
Called when a periodic advertising packet is received. More... | |
virtual void | onPeriodicAdvertisingSyncLoss (const PeriodicAdvertisingSyncLoss &event) |
Called when a periodic advertising sync has been lost. More... | |
virtual void | onConnectionComplete (const ConnectionCompleteEvent &event) |
Called when connection attempt ends or an advertising device has been connected. More... | |
virtual void | onUpdateConnectionParametersRequest (const UpdateConnectionParametersRequestEvent &event) |
Called when the peer request connection parameters updates. More... | |
virtual void | onConnectionParametersUpdateComplete (const ConnectionParametersUpdateCompleteEvent &event) |
Called when connection parameters have been updated. More... | |
virtual void | onReadPhy (ble_error_t status, connection_handle_t connectionHandle, phy_t txPhy, phy_t rxPhy) |
Function invoked when the current transmitter and receiver PHY have been read for a given connection. More... | |
virtual void | onPhyUpdateComplete (ble_error_t status, connection_handle_t connectionHandle, phy_t txPhy, phy_t rxPhy) |
Function invoked when the update process of the PHY has been completed. More... | |
virtual void | onDataLengthChange (connection_handle_t connectionHandle, uint16_t txSize, uint16_t rxSize) |
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... | |
virtual void | onPrivacyEnabled () |
Function invoked when the privacy subsystem has been enabled and is ready to be used. More... | |
Protected Member Functions | |
virtual void | onDataWritten (const GattWriteCallbackParams *params) |
This callback allows receiving updates to the AlertLevel characteristic. More... | |
void | onDisconnectionComplete (const ble::DisconnectionCompleteEvent &) override |
Called when a connection has been disconnected. More... | |
This service defines behavior when a link is lost between two devices.
Service: https://developer.bluetooth.org/gatt/services/Pages/ServiceViewer.aspx?u=org.bluetooth.service.link_loss.xml Alertness Level Char: https://developer.bluetooth.org/gatt/characteristics/Pages/CharacteristicViewer.aspx?u=org.bluetooth.characteristic.alert_level.xml
Definition at line 37 of file LinkLossService.h.
LinkLossService | ( | BLE & | bleIn, |
callback_t | callbackIn, | ||
AlertLevel_t | levelIn = NO_ALERT |
||
) |
bleIn | BLE object for the underlying controller. |
callbackIn | Callback invoked upon disconnection. |
levelIn | Alert level. |
Definition at line 54 of file LinkLossService.h.
|
virtualinherited |
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.
event | Advertising end event. |
Reimplemented in ChainableGapEventHandler.
|
virtualinherited |
Called when a scanner receives an advertising or a scan response packet.
event | Advertising report. |
Reimplemented in ChainableGapEventHandler.
|
virtualinherited |
Called when advertising starts.
event | Advertising start event. |
Reimplemented in ChainableGapEventHandler.
|
virtualinherited |
Called when connection attempt ends or an advertising device has been connected.
event | Connection event. |
Reimplemented in ChainableGapEventHandler.
|
virtualinherited |
Called when connection parameters have been updated.
event | The new connection parameters. |
Reimplemented in ChainableGapEventHandler.
|
virtualinherited |
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.
connectionHandle | The handle of the connection that changed the size. |
txSize | Number of octets we can send on this connection in a single packet. |
rxSize | Number of octets we can receive on this connection in a single packet. |
Reimplemented in ChainableGapEventHandler.
|
protectedvirtual |
This callback allows receiving updates to the AlertLevel characteristic.
[in] | params | Information about the characteristic being updated. |
Definition at line 95 of file LinkLossService.h.
|
overrideprotectedvirtual |
Called when a connection has been disconnected.
event | Details of the event. |
Reimplemented from Gap::EventHandler.
Definition at line 101 of file LinkLossService.h.
|
virtualinherited |
Called when a periodic advertising packet is received.
event | Periodic advertisement event. |
Reimplemented in ChainableGapEventHandler.
|
virtualinherited |
Called when first advertising packet in periodic advertising is received.
event | Periodic advertising sync event. |
Reimplemented in ChainableGapEventHandler.
|
virtualinherited |
Called when a periodic advertising sync has been lost.
event | Details of the event. |
Reimplemented in ChainableGapEventHandler.
|
virtualinherited |
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.
status | Status of the operation: BLE_ERROR_NONE in case of success or an appropriate error code. |
connectionHandle | The handle of the connection on which the operation was made. |
txPhy | PHY used by the transmitter. |
rxPhy | PHY used by the receiver. |
Reimplemented in ChainableGapEventHandler.
|
virtualinherited |
Function invoked when the privacy subsystem has been enabled and is ready to be used.
Reimplemented in ChainableGapEventHandler.
|
virtualinherited |
Function invoked when the current transmitter and receiver PHY have been read for a given connection.
status | Status of the operation: BLE_ERROR_NONE in case of success or an appropriate error code. |
connectionHandle | The handle of the connection for which the PHYs have been read. |
txPhy | PHY used by the transmitter. |
rxPhy | PHY used by the receiver. |
Reimplemented in ChainableGapEventHandler.
|
virtualinherited |
Called when an advertising device receive a scan response.
event | Scan request event. |
Reimplemented in ChainableGapEventHandler.
|
virtualinherited |
Called when scan times out.
event | Associated event. |
Reimplemented in ChainableGapEventHandler.
|
virtualinherited |
Called when the peer request connection parameters updates.
Application must accept the update with acceptConnectionParametersUpdate() or reject it with rejectConnectionParametersUpdate().
event | The connection parameters requested by the peer. |
Reimplemented in ChainableGapEventHandler.
void setAlertLevel | ( | AlertLevel_t | newLevel | ) |
Update alertness level.
Definition at line 84 of file LinkLossService.h.
void setCallback | ( | callback_t | newCallback | ) |
Update the callback.
Definition at line 77 of file LinkLossService.h.