Mbed OS Reference
Loading...
Searching...
No Matches
ChainableGattServerEventHandler Class Reference

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

#include <ChainableGattServerEventHandler.h>

Inheritance diagram for ChainableGattServerEventHandler:
GattServer::EventHandler ChainableEventHandler< ble::GattServer::EventHandler >

Public Member Functions

void onAttMtuChange (ble::connection_handle_t connectionHandle, uint16_t attMtuSize) override
 Function invoked when the connections changes the ATT_MTU which controls the maximum size of an attribute that can be read in a single L2CAP packet which might be fragmented across multiple packets. More...
 
void onDataSent (const GattDataSentCallbackParams &params) override
 Function invoked when the server has sent data to a client. More...
 
void onDataWritten (const GattWriteCallbackParams &params) override
 Function invoked when a client writes an attribute. More...
 
void onDataRead (const GattReadCallbackParams &params) override
 Function invoked when a client reads an attribute. More...
 
void onShutdown (const GattServer &server) override
 Function invoked when the GattServer instance is about to be shut down. More...
 
void onUpdatesEnabled (const GattUpdatesEnabledCallbackParams &params) override
 Function invoked when the client has subscribed to characteristic updates. More...
 
void onUpdatesDisabled (const GattUpdatesDisabledCallbackParams &params) override
 Function invoked when the client has unsubscribed from characteristic updates. More...
 
void onConfirmationReceived (const GattConfirmationReceivedCallbackParams &params) override
 Event not used. More...
 
bool addEventHandler (ble::GattServer::EventHandler *event_handler)
 Add an EventHandler to be notified of events sent to this ChainableEventHandler. More...
 
void removeEventHandler (ble::GattServer::EventHandler *event_handler)
 Remove an EventHandler previously added with addEventHandler. More...
 
bool isEventHandlerPresent (ble::GattServer::EventHandler *event_handler)
 Test if an event handler is present in the chain or not. More...
 

Detailed Description

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

Definition at line 30 of file ChainableGattServerEventHandler.h.

Member Function Documentation

◆ onAttMtuChange()

void onAttMtuChange ( ble::connection_handle_t  connectionHandle,
uint16_t  attMtuSize 
)
overridevirtual

Function invoked when the connections changes the ATT_MTU which controls the maximum size of an attribute that can be read in a single L2CAP packet which might be fragmented across multiple packets.

Parameters
connectionHandleThe handle of the connection that changed the size.
attMtuSize
See also
negotiateAttMtu()

Reimplemented from GattServer::EventHandler.

Definition at line 40 of file ChainableGattServerEventHandler.h.

◆ onDataSent()

void onDataSent ( const GattDataSentCallbackParams params)
overridevirtual

Function invoked when the server has sent data to a client.

For notifications this is triggered when data is sent, for indications it's only triggered when the confirmation has been received.

Note
params has a temporary scope and should be copied by the application if needed later

Reimplemented from GattServer::EventHandler.

Definition at line 45 of file ChainableGattServerEventHandler.h.

◆ onDataWritten()

void onDataWritten ( const GattWriteCallbackParams params)
overridevirtual

Function invoked when a client writes an attribute.

Note
params has a temporary scope and should be copied by the application if needed later

Reimplemented from GattServer::EventHandler.

Definition at line 49 of file ChainableGattServerEventHandler.h.

◆ onDataRead()

void onDataRead ( const GattReadCallbackParams params)
overridevirtual

Function invoked when a client reads an attribute.

Note
This functionality may not be available on all underlying stacks. Application code may work around that limitation by monitoring read requests instead of read events.
params has a temporary scope and should be copied by the application if needed later
See also
GattCharacteristic::setReadAuthorizationCallback()
isOnDataReadAvailable().

Reimplemented from GattServer::EventHandler.

Definition at line 53 of file ChainableGattServerEventHandler.h.

◆ onShutdown()

void onShutdown ( const GattServer server)
overridevirtual

Function invoked when the GattServer instance is about to be shut down.

This can be the result of a call to reset() or BLE::reset().

Reimplemented from GattServer::EventHandler.

Definition at line 57 of file ChainableGattServerEventHandler.h.

◆ onUpdatesEnabled()

void onUpdatesEnabled ( const GattUpdatesEnabledCallbackParams params)
overridevirtual

Function invoked when the client has subscribed to characteristic updates.

Note
params has a temporary scope and should be copied by the application if needed later

Reimplemented from GattServer::EventHandler.

Definition at line 61 of file ChainableGattServerEventHandler.h.

◆ onUpdatesDisabled()

void onUpdatesDisabled ( const GattUpdatesDisabledCallbackParams params)
overridevirtual

Function invoked when the client has unsubscribed from characteristic updates.

Note
params has a temporary scope and should be copied by the application if needed later

Reimplemented from GattServer::EventHandler.

Definition at line 65 of file ChainableGattServerEventHandler.h.

◆ onConfirmationReceived()

void onConfirmationReceived ( const GattConfirmationReceivedCallbackParams params)
overridevirtual

Event not used.

Note
params has a temporary scope and should be copied by the application if needed later

Reimplemented from GattServer::EventHandler.

Definition at line 69 of file ChainableGattServerEventHandler.h.

◆ addEventHandler()

bool addEventHandler ( ble::GattServer::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.

◆ removeEventHandler()

void removeEventHandler ( ble::GattServer::EventHandler event_handler)
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.

◆ isEventHandlerPresent()

bool isEventHandlerPresent ( ble::GattServer::EventHandler event_handler)
inherited

Test if an event handler is present in the chain or not.

Parameters
[in]event_handlerPointer to event handler to check

Definition at line 102 of file ChainableEventHandler.h.