17 #ifndef HF_ITF_SIMPLE_THERMOSTAT_H 18 #define HF_ITF_SIMPLE_THERMOSTAT_H 28 namespace SimpleThermostat
52 namespace SimpleThermostat
64 BOOST_START_CMD = 0x01,
65 BOOST_STOP_CMD = 0x02,
70 typedef enum _Attributes
86 typedef enum _SupportedModesMasks
144 template<u
int8_t _ID>
147 static constexpr uint8_t
ID = _ID;
224 #if HF_ITF_STS_FAN_MODE 227 #if HF_ITF_STS_HEAT_MODE 228 int16_t _heat_mode_temperature;
230 #if HF_ITF_STS_COOL_MODE 231 int16_t _cool_mode_temperature;
233 #if HF_ITF_STS_AUTO_MODE 234 int16_t _auto_mode_heat_temperature;
235 int16_t _auto_mode_cool_temperature;
237 #if HF_ITF_STS_HEAT_MODE && HF_ITF_STS_HEAT_OFFSET_ATTR 238 int16_t _heat_mode_temperature_offset;
240 #if HF_ITF_STS_COOL_MODE && HF_ITF_STS_COOL_OFFSET_ATTR 241 int16_t _cool_mode_temperature_offset;
243 #if HF_ITF_STS_BOOST_CMD 244 uint8_t _boost_duration;
249 Server(
const uint8_t __supported_modes = ALL_MODES_MASK):
261 #if HF_ITF_STS_BOOST_CMD 315 uint8_t
mode()
const;
324 virtual void mode(uint8_t __mode);
326 #if HF_ITF_STS_FAN_MODE 334 uint8_t fan_mode()
const;
343 virtual void fan_mode(uint8_t __fan_mode);
346 #if HF_ITF_STS_HEAT_MODE 352 int16_t heat_mode_temperature()
const;
359 virtual void heat_mode_temperature(int16_t __temperature);
362 #if HF_ITF_STS_COOL_MODE 368 int16_t cool_mode_temperature()
const;
375 virtual void cool_mode_temperature(int16_t __temperature);
378 #if HF_ITF_STS_AUTO_MODE 384 int16_t auto_mode_heat_temperature()
const;
391 virtual void auto_mode_heat_temperature(int16_t __temperature);
398 int16_t auto_mode_cool_temperature()
const;
405 virtual void auto_mode_cool_temperature(int16_t __temperature);
408 #if HF_ITF_STS_HEAT_MODE && HF_ITF_STS_HEAT_OFFSET_ATTR 414 int16_t heat_mode_temperature_offset()
const;
421 virtual void heat_mode_temperature_offset(int16_t __offset);
424 #if HF_ITF_STS_COOL_MODE && HF_ITF_STS_COOL_OFFSET_ATTR 430 int16_t cool_mode_temperature_offset()
const;
437 virtual void cool_mode_temperature_offset(int16_t __offset);
440 #if HF_ITF_STS_BOOST_CMD 446 uint8_t boost_duration()
const;
453 virtual void boost_duration(uint8_t __duration);
467 #if HF_ITF_STS_BOOST_CMD 487 #if HF_ITF_STS_BOOST_CMD 514 #if HF_ITF_STS_BOOST_CMD 542 #if HF_ITF_STS_BOOST_CMD 585 std::ostream &
operator<<(std::ostream &stream,
Attribute< COOL_MODE_TEMP_OFFSET_ATTR > CoolModeTemperatureOffset
Helper class to handle the Cool Mode temperature offset attribute for the Simple Thermostat interface...
Attribute< HEAT_MODE_TEMP_ATTR > HeatModeTemperature
Helper class to handle the Heat Mode temperature attribute for the Simple Thermostat interface...
Helper class to handle the Heat/Cool Mode attribute for the Simple Thermostat interface.
static constexpr uint8_t ID
Attribute UID.
Helper class to handle the Boost Duration attribute for the Simple Thermostat interface.
Heat Mode Temperature Offset.
Attribute< COOL_MODE_TEMP_ATTR > CoolModeTemperature
Helper class to handle the Cool Mode temperature attribute for the Simple Thermostat interface...
Attribute< AUTO_MODE_HEAT_TEMP_ATTR > AutoModeHeatTemperature
Helper class to handle the Heat/Cool Mode heat temperature attribute for the Simple Thermostat interf...
HF::Attributes::IAttribute * attribute(uint8_t uid)
Return a pointer to the interface attribute with the given uid.
virtual Common::Result handle_command(Protocol::Packet &packet, Common::ByteArray &payload, uint16_t offset)
Handle incoming messages from the network.
Helper class to handle the Supported Modes attribute for the Simple Thermostat interface.
Heat/Cool Mode Cool Temperature.
Attribute< AUTO_MODE_COOL_TEMP_ATTR > AutoModeCoolTemperature
Helper class to handle the Heat/Cool Mode cool temperature attribute for the Simple Thermostat interf...
Return all mandatory attributes for the interface.
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.
static constexpr bool WRITABLE
Attribute Read/Write.
Helper class template for parent class implementation of the interfaces.
Simple Thermostat Interface : Server side implementation.
This file contains the definitions for the HAN-FUN protocol messages.
HF::Attributes::IAttribute * create_attribute(uint8_t uid)
Create an attribute object that can hold the attribute with the given uid. (HF::Interfaces::SimpleThe...
uint8_t supported_modes() const
Get the supported modes for the Simple Thermostat server.
static constexpr uint8_t ID
Attribute UID.
Simple Thermostat Interface : Parent.
This file contains the definitions common to all interfaces.
static constexpr uint8_t ID
Attribute UID.
Simple Thermostat Interface : Client side implementation.
static constexpr bool WRITABLE
Attribute Read/Write.
Helper template class to handle attributes for the Simple Thermostat interface.
Helper class to handle the Fan Mode attribute for the Simple Thermostat interface.
HF::Interface const * owner() const
This class represents a byte array.
Fan has/is in automatic mode.
Heat/Cool Mode Heat Temperature.
Attribute< HEAT_MODE_TEMP_OFFSET_ATTR > HeatModeTemperatureOffset
Helper class to handle the Heat Mode temperature offset attribute for the Simple Thermostat interface...
uint16_t uid() const
This method returns the interface UID.
std::ostream & operator<<(std::ostream &stream, const HF::Interfaces::SimpleThermostat::CMD command)
Convert the given command into a string and write it to the given stream.
uint8_t mode() const
Get the current Heat/Cool mode for the Simple Thermostat server.
static constexpr uint8_t ID
Attribute UID.
static constexpr bool WRITABLE
Attribute Read/Write.
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.
SupportedModesMasks
Masks for the Simple Thermostat supported modes.
Server(const uint8_t __supported_modes=ALL_MODES_MASK)
Constructor.
uint8_t _supported_modes
Supported modes.
static constexpr bool WRITABLE
Attribute Read/Write.
Helper class template for implementing a given interface role.
#define UNUSED(x)
Helper macro to remove warning about unused function/method argument.
virtual ~Server()
Destructor.
Helper template class to declare an attribute with the given T type.
Cool Mode Temperature Offset.
static constexpr bool WRITABLE
Attribute Read/Write.
Common interface for all Interfaces.
uint8_t _mode
Current mode.
Result
Commands result codes.
static constexpr uint8_t ID
Attribute UID.
Top-level namespace for the HAN-FUN library.