HAN-FUN API  1.5.3
This project provides the common implementation of ULE Alliance's HAN-FUN application protocol.
SimpleLight Struct Reference

Unit implementing a Simple Light. More...

#include <node.h>

+ Inheritance diagram for SimpleLight:
+ Collaboration diagram for SimpleLight:

Public Member Functions

 SimpleLight (uint8_t index, HF::IDevice &device)
 Constructor. More...
 
void on (HF::Protocol::Address &source)
 Callback that is called when a ON_CMD message is received. More...
 
void off (HF::Protocol::Address &source)
 Callback that is called when a OFF_CMD message is received. More...
 
void toggle (HF::Protocol::Address &source)
 Callback that is called when a TOGGLE_CMD message is received. More...
 
- Public Member Functions inherited from HF::Units::Unit< HF::Profiles::SimpleLight >
 Unit (uint8_t id, IDevice &device)
 Constructor. More...
 
uint8_t id () const
 Get the id number of this unit on the device. More...
 
uint16_t uid () const
 Return this profile HAN-FUN UID. More...
 
Common::Result handle (Protocol::Packet &packet, Common::ByteArray &payload, uint16_t offset)
 Handle incoming messages from the network. More...
 
HF::Attributes::List attributes (Common::Interface itf, uint8_t pack_id, const HF::Attributes::UIDS &uids) const
 Return a list of all the attributes for a given interface, pack id and list of attributes UID's. More...
 
void send (const Protocol::Address &addr, Protocol::Message &message)
 Send message msg to the network address given by addr. More...
 
void notify (const HF::Attributes::IAttribute &old_value, const HF::Attributes::IAttribute &new_value) const
 Notify the attribute reporting service that the given attribute has changed value. More...
 
std::vector< Common::Interfaceinterfaces () const
 Return the list of optional interfaces implemented by this unit. More...
 
- Public Member Functions inherited from HF::Units::AbstractUnit
IDevicedevice () const
 Reference to the device this unit belongs to. More...
 
void send (const Protocol::Address &addr, Protocol::Message &message, Transport::Link *link)
 Create and send a new packet with the given message to the given address. More...
 
- Public Member Functions inherited from HF::Profiles::Profile< SIMPLE_LIGHT, Interfaces::OnOff::Server >
virtual HF::Attributes::UIDS attributes (uint8_t pack_id=HF::Attributes::Pack::MANDATORY) const =0
 Return a vector containing the attribute UIDs, for the given pack ID. More...
 
virtual Common::Result handle (Protocol::Packet &packet, Common::ByteArray &payload, uint16_t offset)=0
 Handle incoming messages from the network. More...
 
- Public Member Functions inherited from HF::Profiles::AbstractProfile< _uid >
Common::Result handle (Protocol::Packet &packet, Common::ByteArray &payload, uint16_t offset)
 Handle incoming messages from the network. More...
 
- Public Member Functions inherited from HF::Interfaces::OnOff::Server
 Server ()
 Constructor.
 
virtual ~Server ()
 Destructor.
 
void state (bool state)
 Setter : set the state attribute to given value. More...
 
bool state ()
 Getter : get the current state of the interface : More...
 
HF::Attributes::IAttributeattribute (uint8_t uid)
 Return a pointer to the interface attribute with the given uid. More...
 
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. More...
 
- Public Member Functions inherited from HF::Interfaces::InterfaceRole< OnOff::Base, HF::Interface::SERVER_ROLE >
HF::Interface::Role role () const
 Return the Interface::Role this interface implements. More...
 
- Public Member Functions inherited from HF::Interfaces::Container< HF::Units::Unit< HF::Profiles::SimpleLight, ITF... >, Proxy< ITF, HF::Units::Unit< HF::Profiles::SimpleLight, ITF... > >... >
 Container (HF::Units::Unit< HF::Profiles::SimpleLight, ITF... > &base)
 Constructor. More...
 
Common::Result handle (Protocol::Packet &packet, Common::ByteArray &payload, uint16_t offset)
 Handle incoming messages from the network. More...
 
void attributes (HF::Attributes::List &attr_list, Common::Interface itf, uint8_t pack_id, const HF::Attributes::UIDS &uids) const
 Return a list of all the attributes for a given interface, pack id and list of attributes UID's. More...
 
std::vector< Common::Interfaceinterfaces () const
 Return the list of interfaces present in the wrapper. More...
 
const std::tuple_element< N, interfaces_t >::type::base * get () const
 Retrieve a pointer to the N optional interface implemented by this unit. More...
 

Additional Inherited Members

- Public Types inherited from HF::Interface
enum  Role { CLIENT_ROLE = 0, SERVER_ROLE = 1 }
 Interface roles. More...
 
enum  UID {
  DEVICE_MANAGEMENT = 0x0001, BIND_MANAGEMENT = 0x0002, GROUP_MANAGEMENT = 0x0003, IDENTIFY = 0x0004,
  DEVICE_INFORMATION = 0x0005, ATTRIBUTE_REPORTING = 0x0006, BATCH_PROGRAM_MANAGEMENT = 0x0007, EVENT_SCHEDULING = 0x0008,
  WEEKLY_SCHEDULING = 0x0009, GROUP_TABLE = 0x000A, TAMPER_ALERT = 0x0101, TIME = 0x0102,
  POWER = 0x0110, KEEP_ALIVE = 0x0115, RSSI = 0x0111, SUOTA = 0x0400,
  ALERT = 0x0100, ON_OFF = 0x0200, LEVEL_CONTROL = 0x0201, COLOUR_CONTROL = 0x0202,
  SIMPLE_KEYPAD = 0x0203, SIMPLE_POWER_METER = 0x0300, SIMPLE_TEMPERATURE = 0x0301, SIMPLE_HUMIDITY = 0x0302,
  SIMPLE_THERMOSTAT = 0x0303, SIMPLE_BUTTON = 0x0304, SIMPLE_VISUAL_EFFECTS = 0x0305, SIMPLE_AIR_PRESSURE = 0x0306,
  SIMPLE_LIGHT_SENSOR = 0x0307, RESERVED = 0x7F00, MAX_UID = 0x7FFE, ANY_UID = 0x7FFF
}
 Interfaces Unique Identifiers (UID). More...
 
- Static Public Attributes inherited from HF::Interface
static constexpr uint8_t MAX_CMD_ID = 0xFF
 Maximum value for command IDs in interfaces.
 
- Protected Member Functions inherited from HF::Units::AbstractUnit
 AbstractUnit (IDevice &device)
 Constructor. More...
 
void notify (const HF::Attributes::IAttribute &old_value, const HF::Attributes::IAttribute &new_value) const
 Notify the attribute reporting service that the given attribute has changed value. More...
 
- Protected Member Functions inherited from HF::Interfaces::OnOff::Server
Common::Result handle_command (Protocol::Packet &packet, Common::ByteArray &payload, uint16_t offset)
 Handle incoming messages from the network. More...
 
- Protected Member Functions inherited from HF::Interfaces::Interface< HF::Interface::ON_OFF >
bool check_uid (uint16_t uid) const
 
- Protected Member Functions inherited from HF::Interfaces::AbstractInterface
Common::Result check (Protocol::Message &message, Common::ByteArray &payload, uint16_t offset)
 Check if message has correct attributes to be processed by the interface. More...
 
Common::Result check_payload_size (Protocol::Message &message, Common::ByteArray &payload, uint16_t offset)
 Check if payload data size if sufficient for processing the message. More...
 
virtual uint16_t payload_size (Protocol::Message &message) const
 Return the minimal payload size that should be present for the given message. More...
 
virtual uint16_t payload_size (Protocol::Message::Interface &itf) const
 Return the minimal payload size that a message should hold when addressed at the given interface. More...
 
template<typename _Message >
uint16_t payload_size_helper () const
 Helper function template to retrieve minimum size required for serializing/deserializing the class given. More...
 
virtual Common::Result handle_attribute (Protocol::Packet &packet, Common::ByteArray &payload, uint16_t offset)
 Handle incoming messages from the network. More...
 
- Protected Member Functions inherited from HF::Interfaces::Container< HF::Units::Unit< HF::Profiles::SimpleLight, ITF... >, Proxy< ITF, HF::Units::Unit< HF::Profiles::SimpleLight, ITF... > >... >
void for_each (std::function< void(HF::Interface &)> func) const
 Call the given function for all the interfaces. More...
 
void for_each (std::function< void(HF::Interface &)> func)
 Call the given function for all the interfaces. More...
 
void for_each (std::function< void(HF::Interface &)> func) const
 Helper template function to implement the HF::Units::Unit::for_each functionality. More...
 
void for_each (std::function< void(HF::Interface &)> func) const
 Helper template function to implement the HF::Units::Unit::for_each functionality. More...
 
HF::Interfacefind (uint16_t itf_uid) const
 Find the interface with the given UID. More...
 
HF::Interfacefind (uint16_t itf_uid) const
 Final template instantiation that finds the wrapped interface with the given UID. More...
 
void attributes_itf (HF::Attributes::List &attrs, Common::Interface itf, uint8_t pack_id, const HF::Attributes::UIDS &uids) const
 Helper function used to provide HF::Units::Unit::attributes functionality. More...
 
void attributes_itf (HF::Attributes::List &attrs, Common::Interface itf, uint8_t pack_id, const HF::Attributes::UIDS &uids) const
 Helper function used to provide HF::Units::Unit::attributes functionality. More...
 
- Protected Attributes inherited from HF::Units::AbstractUnit
uint8_t _id
 Unit ID used to identify a given unit in a given HAN-FUN device.
 
- Protected Attributes inherited from HF::Interfaces::OnOff::Server
bool _state
 Current server state. More...
 

Detailed Description

Unit implementing a Simple Light.

Definition at line 44 of file node.h.

Constructor & Destructor Documentation

◆ SimpleLight()

SimpleLight::SimpleLight ( uint8_t  index,
HF::IDevice device 
)
inline

Constructor.

Parameters
[in]indexunit id.
[in]devicereference to the device that holds this unit.

Definition at line 52 of file node.h.

References SimpleLight(), and HF::Units::Unit< HF::Profiles::SimpleLight >::Unit().

Referenced by SimpleLight().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

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