ELEC-C7222
Libraries for ELEC C7222 Course Work
Loading...
Searching...
No Matches
characteristic_event_handler.hpp
Go to the documentation of this file.
1
9#ifndef PICOBLEGATTTEST_CHARACTERISTIC_EVENT_HANDLER_HPP
10#define PICOBLEGATTTEST_CHARACTERISTIC_EVENT_HANDLER_HPP
11
12#include <cstdint>
13
14#include "characteristic.hpp"
15
23public:
25 void OnUpdatesEnabled(bool is_indication) override;
27 void OnUpdatesDisabled() override;
29 void OnIndicationComplete(uint8_t status) override;
31 void OnBroadcastEnabled() override;
33 void OnBroadcastDisabled() override;
35 void OnRead() override;
37 void OnWrite(const std::vector<uint8_t>& data) override;
39 void OnConfirmationReceived(bool status) override;
40
46 void SetCharacteristicName(const std::string& name) {
47 characteristic_name_ = name;
48 }
49
53 std::string GetCharacteristicName() const {
54 return characteristic_name_;
55 }
56
57private:
58 std::string characteristic_name_;
59};
60
61
62#endif // PICOBLEGATTTEST_CHARACTERISTIC_EVENT_HANDLER_HPP
Minimal characteristic event handler for examples.
Definition characteristic_event_handler.hpp:22
void SetCharacteristicName(const std::string &name)
Set a label used in log output.
Definition characteristic_event_handler.hpp:46
void OnConfirmationReceived(bool status) override
Called when a confirmation is received.
Definition characteristic_event_handler.cpp:66
void OnUpdatesEnabled(bool is_indication) override
Called when notifications or indications are enabled.
Definition characteristic_event_handler.cpp:10
void OnBroadcastDisabled() override
Called when broadcast is disabled on the characteristic.
Definition characteristic_event_handler.cpp:38
void OnIndicationComplete(uint8_t status) override
Called after an indication is confirmed by the client.
Definition characteristic_event_handler.cpp:24
std::string GetCharacteristicName() const
Get the current log label for the handler.
Definition characteristic_event_handler.hpp:53
void OnRead() override
Called when the characteristic value is read.
Definition characteristic_event_handler.cpp:45
void OnUpdatesDisabled() override
Called when notifications or indications are disabled.
Definition characteristic_event_handler.cpp:17
void OnBroadcastEnabled() override
Called when broadcast is enabled on the characteristic.
Definition characteristic_event_handler.cpp:31
void OnWrite(const std::vector< uint8_t > &data) override
Called when the characteristic value is written.
Definition characteristic_event_handler.cpp:52
Characteristic event handler structure.
Definition characteristic.hpp:378