ELEC-C7222
Libraries for ELEC C7222 Course Work
Loading...
Searching...
No Matches
CharacteristicEventHandler Class Reference

Minimal characteristic event handler for examples. More...

#include <characteristic_event_handler.hpp>

Inheritance diagram for CharacteristicEventHandler:
Inheritance graph
Collaboration diagram for CharacteristicEventHandler:
Collaboration graph

Public Member Functions

void OnUpdatesEnabled (bool is_indication) override
 Called when notifications or indications are enabled.
 
void OnUpdatesDisabled () override
 Called when notifications or indications are disabled.
 
void OnIndicationComplete (uint8_t status) override
 Called after an indication is confirmed by the client.
 
void OnBroadcastEnabled () override
 Called when broadcast is enabled on the characteristic.
 
void OnBroadcastDisabled () override
 Called when broadcast is disabled on the characteristic.
 
void OnRead () override
 Called when the characteristic value is read.
 
void OnWrite (const std::vector< uint8_t > &data) override
 Called when the characteristic value is written.
 
void OnConfirmationReceived (bool status) override
 Called when a confirmation is received.
 
void SetCharacteristicName (const std::string &name)
 Set a label used in log output.
 
std::string GetCharacteristicName () const
 Get the current log label for the handler.
 

Additional Inherited Members

- Protected Member Functions inherited from c7222::Characteristic::EventHandler
virtual ~EventHandler ()=default
 Virtual destructor for the EventHandlers interface.
 

Detailed Description

Minimal characteristic event handler for examples.

Prints events (read/write/notify/indicate) to the console. The handler is intentionally minimal so students can observe event flow without extra logic.

Member Function Documentation

◆ GetCharacteristicName()

std::string CharacteristicEventHandler::GetCharacteristicName ( ) const
inline

Get the current log label for the handler.

◆ OnBroadcastDisabled()

void CharacteristicEventHandler::OnBroadcastDisabled ( )
overridevirtual

Called when broadcast is disabled on the characteristic.

Reimplemented from c7222::Characteristic::EventHandler.

◆ OnBroadcastEnabled()

void CharacteristicEventHandler::OnBroadcastEnabled ( )
overridevirtual

Called when broadcast is enabled on the characteristic.

Reimplemented from c7222::Characteristic::EventHandler.

◆ OnConfirmationReceived()

void CharacteristicEventHandler::OnConfirmationReceived ( bool  status)
overridevirtual

Called when a confirmation is received.

Reimplemented from c7222::Characteristic::EventHandler.

◆ OnIndicationComplete()

void CharacteristicEventHandler::OnIndicationComplete ( uint8_t  status)
overridevirtual

Called after an indication is confirmed by the client.

Reimplemented from c7222::Characteristic::EventHandler.

◆ OnRead()

void CharacteristicEventHandler::OnRead ( )
overridevirtual

Called when the characteristic value is read.

Reimplemented from c7222::Characteristic::EventHandler.

◆ OnUpdatesDisabled()

void CharacteristicEventHandler::OnUpdatesDisabled ( )
overridevirtual

Called when notifications or indications are disabled.

Reimplemented from c7222::Characteristic::EventHandler.

◆ OnUpdatesEnabled()

void CharacteristicEventHandler::OnUpdatesEnabled ( bool  is_indication)
overridevirtual

Called when notifications or indications are enabled.

Reimplemented from c7222::Characteristic::EventHandler.

◆ OnWrite()

void CharacteristicEventHandler::OnWrite ( const std::vector< uint8_t > &  data)
overridevirtual

Called when the characteristic value is written.

Reimplemented from c7222::Characteristic::EventHandler.

◆ SetCharacteristicName()

void CharacteristicEventHandler::SetCharacteristicName ( const std::string &  name)
inline

Set a label used in log output.

This makes example logs easier to read when multiple characteristics exist.

Here is the caller graph for this function:

The documentation for this class was generated from the following files: