16 #ifndef HF_ITF_SIMPLE_HUMIDITY_H 17 #define HF_ITF_SIMPLE_HUMIDITY_H 27 namespace SimpleHumidity
52 namespace SimpleHumidity
63 typedef enum _Attributes
78 static constexpr
bool WRITABBLE =
false;
91 static constexpr
bool WRITABBLE =
false;
138 const uint16_t _tolerance;
215 template<Attributes _Attribute>
HF::Attributes::UIDS attributes(uint8_t pack_id=HF::Attributes::Pack::MANDATORY) const
Return a vector containing the attribute UIDs, for the given pack ID.
HF::Attributes::IAttribute * create_attribute(uint8_t uid)
Create an attribute object that can hold the attribute with the given uid. (HF::Interfaces::SimpleHum...
void read(Protocol::Address &addr)
Send a GET_ATTR_REQ to the given address to get the current humidity.
Measured humidity attribute UID.
virtual void send(const Protocol::Address &addr, Protocol::Message &message)=0
Send message msg to the network address given by addr.
Server(uint16_t tolerance=0)
Constructor.
void read_all(Protocol::Address &addr)
Send a GET_ATTR_PACK_REQ to the given address to get the values for all the attributes in the server...
Return all mandatory attributes for the interface.
This file contains the common defines for the HAN-FUN library.
Simple Humidity Interface : Server side interface.
Helper class template for parent class implementation of the interfaces.
uint16_t tolerance()
Getter for the tolerance attribute.
uint16_t id
Identifier of the interface.
Simple Humidity Interface : Parent.
Common::Result handle_attribute(Protocol::Packet &packet, Common::ByteArray &payload, uint16_t offset)
Handle incoming messages from the network.
This file contains the definitions common to all interfaces.
HF::Attributes::IAttribute * attribute(uint8_t uid)
Return a pointer to the interface attribute with the given uid.
Level Control Interface : Client side implementation.
uint16_t role
Interface role : Server or Client.
HF::Interface const * owner() const
This class represents a byte array.
uint8_t member
Interface destination member.
uint16_t uid() const
This method returns the interface UID.
uint16_t _value
Current measured humidity.
Simple Humidity interface UID.
uint16_t humidity()
Getter for the current measured humidity.
Interface itf
Interface Address.
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 to handle the Measured Humidity attribute for the Simple Humidity interface.
Helper class template for implementing a given interface role.
#define UNUSED(x)
Helper macro to remove warning about unused function/method argument.
Helper template class to declare an attribute with the given T type.
Helper class to handle the Tolerance attribute for the Simple Humidity interface. ...
Common interface for all Interfaces.
Result
Commands result codes.
Top-level namespace for the HAN-FUN library.