17 #ifndef HF_ITF_SIMPLE_KEYPAD_H 18 #define HF_ITF_SIMPLE_KEYPAD_H 28 namespace SimpleKeypad
52 namespace SimpleKeypad
75 KeyPressed(uint32_t _key_id = 0): key_id(_key_id)
79 static constexpr uint16_t
min_size =
sizeof(uint32_t);
static constexpr uint16_t min_size
Minimum pack/unpack required data size.
std::ostream & operator<<(std::ostream &stream, const HF::Interfaces::SimpleKeypad::CMD command)
Convert the given command into a string and write it to the given stream.
HF::Attributes::IAttribute * create_attribute(uint8_t uid)
Create an attribute object that can hold the attribute with the given uid. (HF::Interfaces::SimpleKey...
virtual ~Server()
Destructor.
Common::Result handle_command(Protocol::Packet &packet, Common::ByteArray &payload, uint16_t offset)
Handle incoming messages from the network.
Simple Keypad Interface : Server side implementation.
Helper class template for parent class implementation of the interfaces.
Simple Keypad interface UID.
This file contains the definitions for the HAN-FUN protocol messages.
Simple Keypad Interface : Parent.
void key_pressed(const Protocol::Address &addr, uint32_t key_id)
Send a HAN-FUN message containing a SimpleKeypad::KEYPRESSED_CMD, to the given network address...
uint16_t pack(Common::ByteArray &array, uint16_t offset=0) const
Write the object on to a ByteArray so it can be sent over the network.
This file contains the definitions common to all interfaces.
virtual void key_received(const uint32_t key_id)
Callback that informs the app that a key was pressed on the client.
This class represents a byte array.
uint16_t size() const
Number bytes needed to serialize the message.
Message payload for a HF::SimpleKeypad::KEYPRESED request.
HF::Attributes::IAttribute * create_attribute(HF::Interfaces::Alert::Server *server, uint8_t uid)
Create an attribute object that can hold the attribute with the given uid.
Interface/Service Attribute API.
Helper class template for implementing a given interface role.
#define UNUSED(x)
Helper macro to remove warning about unused function/method argument.
uint16_t unpack(const Common::ByteArray &array, uint16_t offset=0)
Read a message from a ByteArray.
Result
Commands result codes.
Simple Keypad Interface : Client side implementation.
virtual void key_pressed(const Protocol::Address &addr, KeyPressed &msg)
Callback that is called when a SimpleKeypad::KEYPRESSED_CMD, is received.
Top-level namespace for the HAN-FUN library.