249 virtual uint16_t
uid()
const = 0;
268 template<u
int16_t _u
id>
304 template<u
int16_t _u
id,
class Interface>
331 template<uint16_t _uid,
typename... _Interfaces>
334 HF::Interfaces::Proxy<_Interfaces,
335 ProfileN<_uid, _Interfaces...>>...>
383 template<u
int16_t _u
id,
typename Interface1,
typename Interface2>
400 return const_cast<Interface1 *
>(profile_t::template get<0>());
410 return const_cast<Interface2 *
>(profile_t::template get<1>());
420 return const_cast<Interface1 *
>(profile_t::template get<0>());
430 return const_cast<Interface2 *
>(profile_t::template get<1>());
437 template<Profiles::UID _u
id>
507 Interfaces::OnOff::Server>
528 public Profile<SIMPLE_LEVEL_CONTROLLABLE, Interfaces::LevelControl::Server>
539 Interfaces::LevelControl::Client>
552 public Profile2<SIMPLE_LEVEL_CONTROLLABLE_SWITCHABLE, OnOffServer, LevelControlServer>
554 static_assert(std::is_base_of<Interfaces::OnOff::Server, OnOffServer>::value,
555 "OnOff::Server MUST be of type Interfaces::OnOff::Server !");
558 LevelControlServer>::value,
559 "LevelControl::Server MUST be of type Interfaces::LevelControl::Server !");
565 OnOffServer *on_off()
567 return this->
first();
570 LevelControlServer *level_control()
582 public Profile2<SIMPLE_LEVEL_CONTROL_SWITCH, OnOffClient, LevelControlClient>
584 static_assert(std::is_base_of<Interfaces::OnOff::Client, OnOffClient>::value,
585 "OnOff::Client MUST be of type Interfaces::OnOff::Client !");
588 LevelControlClient>::value,
589 "LevelControl::Client MUST be of type Interfaces::LevelControl::Client !");
594 OnOffClient *on_off()
596 return this->
first();
599 LevelControlClient *level_control()
621 public Profile2<AC_OUTLET_WITH_POWER_METERING, OnOffServer, SimplePowerMeterServer>
623 static_assert(std::is_base_of<Interfaces::OnOff::Server, OnOffServer>::value,
624 "OnOff::Server MUST be of type Interfaces::OnOff::Server !");
627 SimplePowerMeterServer>::value,
628 "SimplePowerMeterServer MUST be of type Interfaces::SimplePowerMeter::Server !");
634 OnOffServer *on_off()
636 return this->
first();
639 SimplePowerMeterServer *power_meter()
662 static_assert(std::is_base_of<Interfaces::OnOff::Server, OnOffServer>::value,
663 "OnOff::Server MUST be of type Interfaces::OnOff::Server !");
666 LevelControlServer>::value,
667 "LevelControl::Client MUST be of type Interfaces::LevelControl::Server !");
673 OnOffServer *on_off()
675 return this->
first();
678 LevelControlServer *level_control()
691 static_assert(std::is_base_of<Interfaces::OnOff::Client, OnOffClient>::value,
692 "OnOff::Server MUST be of type Interfaces::OnOff::Client !");
695 LevelControlClient>::value,
696 "LevelControl::Server MUST be of type Interfaces::LevelControl::Client !");
702 OnOffClient *on_off()
704 return this->
first();
707 LevelControlClient *level_control()
737 Interfaces::SimplePowerMeter::Server>
748 Interfaces::SimpleTemperature::Server>
759 Interfaces::SimpleHumidity::Server>
772 SimpleThermostatServer>
774 static_assert(std::is_base_of<Interfaces::OnOff::Server, OnOffServer>::value,
775 "OnOffServer MUST be of type Interfaces::OnOff::Server !");
778 SimpleThermostatServer>::value,
779 "SimpleThermostatServer MUST be of type Interfaces::SimpleThermostat::Server !");
785 OnOffServer *on_off()
787 return this->
first();
790 SimpleThermostatServer *simple_thermostat()
800 Interfaces::SimpleAirPressure::Server>
831 Interfaces::SimpleTemperature::Server,
832 Interfaces::SimpleHumidity::Server,
833 Interfaces::SimpleAirPressure::Server>
846 public Profile2<COLOUR_BULB, OnOffServer, ColourControlServer>
848 static_assert(std::is_base_of<Interfaces::OnOff::Server, OnOffServer>::value,
849 "OnOffServer MUST be of type Interfaces::OnOff::Server !");
852 ColourControlServer>::value,
853 "ColourControlServer MUST be of type Interfaces::ColourControl::IServer !");
859 OnOffServer *on_off()
861 return this->
first();
864 ColourControlServer *colour_control()
877 public ProfileN<DIMMABLE_COLOUR_BULB, OnOffServer, ColourControlServer, LevelControlServer>
882 static_assert(std::is_base_of<Interfaces::OnOff::Server, OnOffServer>::value,
883 "OnOffServer MUST be of type Interfaces::OnOff::Server !");
886 ColourControlServer>::value,
887 "ColourControlServer MUST be of type Interfaces::ColourControl::IServer !");
890 LevelControlServer>::value,
891 "LevelControlServer MUST be of type Interfaces::LevelControl::Server !");
898 OnOffServer *on_off()
900 return const_cast<OnOffServer *
>(profile_t::template get<0>());
903 ColourControlServer *colour_control()
905 return const_cast<ColourControlServer *
>(profile_t::template get<1>());
908 LevelControlServer *level_control()
910 return const_cast<LevelControlServer *
>(profile_t::template get<2>());
934 Interfaces::SimpleKeypad::Server>
1047 Interfaces::SimpleLightSensor::Server>
Class template for profiles containing multiple interfaces.
This unit will be acting upon some physical AC switch.
Allows a unit to receive and interpret requests for adjustment of some quantity.
List get(const HF::Interface &itf, uint8_t pack_id, const UIDS &uids)
Get a list with the attributes for the given interface, pack id or the uids passed in...
Generic Application Logic profile implementation.
Use for a motion detector that senses and sends an alert.
Simple Air Pressure Sensor profile implementation.
On-Off Interface : Client side implementation.
AC Outlet profile implementation.
Simple Light Sensor profile implementation.
Use for a flood detector that senses and sends an alert.
Allows a unit to do and provide measurements over electric quantities.
Colour Control Interface : Server side implementation.
Simple Power Meter Interface : Server side implementation.
Colour Control Interface : Server side implementation.
virtual void notify(const HF::Attributes::IAttribute &old_value, const HF::Attributes::IAttribute &new_value) const =0
Notify that an attribute value as changed.
Allows a unit to receive and interpret on/off requests.
This file contains the definitions for the Simple Humidity interface.
This file contains the definitions for the Level Control interface.
Use for a carbon monoxide detector that senses and sends an alert.
This unit will be acting upon some physical siren that will sound an alert.
Dimmable Colour bulb profile implementation.
Allows a unit to provide light readings.
void alert(bool state)
Send an alert command to the broadcast address.
Simple Level Control profile implementation.
This unit will be acting upon some physical door bell.
User Interface profile implementation.
Smoke Detector profile implementation.
This file contains the definitions for the OnOff interface.
This file contains the common defines for the HAN-FUN library.
Common::Interface const * interfaces(uint16_t profile, uint16_t &count)
This function returns a pointer to a entry on a static const array, containing the interfaces the pro...
Vibration Detector profile implementation.
This file contains the definitions for the Simple Temperature interface.
uint16_t uid() const
Return this profile HAN-FUN UID.
virtual void periodic(uint32_t time)
Handle periodic processing.
Common::Result handle(Protocol::Packet &packet, Common::ByteArray &payload, uint16_t offset)
Handle incoming messages from the network.
This file contains the definitions for the Colour Control interface.
Helper class to add optional interfaces to other classes.
Simple Thermostat Interface : Server side implementation.
This file contains the definitions for the Alert interface.
Environment Monitoring profile implementation.
Simple On/Off Switchable profile implementation.
uint16_t id
Identifier of the interface.
Level Control Interface : Client side implementation.
This class has the same behavior has a list, however the list element access methods where overwritte...
Controllable thermostat profile implementation.
Use for an open/close window detector that senses and sends an alert.
Simple Detector profile implementation.
Simple Pendant profile implementation.
Common::Result handle(Protocol::Packet &packet, Common::ByteArray &payload, uint16_t offset)
Handle incoming messages from the network.
Motion Detector profile implementation.
Dimmer Switch profile implementation.
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...
Helper template class to allow interfaces implementation to be added as fields to other classes...
Siren profile implementation.
Allows a unit to send both on/off and level control requests.
This file contains the definitions common to all interfaces.
virtual void periodic(uint32_t time)
Handle periodic processing.
Simple Air Pressure Sensor.
uint32_t state()
Return the current state for all the alerts as a bitmask.
On-Off Interface : Server side implementation.
Use for an open/close door detector that senses and sends an alert.
User Interface unit (e.g. keypad, remote control)
Simple Temperature Sensor profile implementation.
Simple Level Controllable Switchable profile implementation.
Simple sensor to measure the relative humidity.
Class template for profiles containing only one interface.
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...
Logic Application logic unit, (e.g. can be at the concentrator, Portal, user controller) ...
virtual uint16_t uid() const =0
Return this profile HAN-FUN UID.
This file contains the definitions for the Simple Keypad interface.
This file contains the definitions for the Simple Light Sensor interface.
virtual HF::Attributes::List attributes(Common::Interface itf, uint8_t pack_id, const HF::Attributes::UIDS &uids) const =0
Return a list of all the attributes for a given interface, pack id and list of attributes UID's...
Use for a smoke detector that senses and sends an alert.
Colour bulb profile implementation.
Allows a unit to send on/off requests.
Simple Level Control Switch profile implementation.
void enable(uint8_t index)
Enable alert at index.
Flood Detector profile implementation.
Window Open Close Detector profile implementation.
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.
This unit will trigger an alert, much like a panic button.
This class represents a byte array.
virtual void periodic(uint32_t time)
Handle periodic processing.
Simple Door Lock profile implementation.
Common::Result handle(Protocol::Packet &packet, Common::ByteArray &payload, uint16_t offset)
Handle incoming messages from the network.
Gas Detector profile implementation.
Use for a glass break detector that senses and sends an alert.
Common::Result handle(Protocol::Packet &packet, Common::ByteArray &payload, uint16_t offset)
Handle incoming messages from the network.
Use for a generic detector that senses and sends an alert.
Proprietary profiles UID end value.
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...
Alertable profile implementation.
void disableAll()
Disable all alerts.
uint16_t uid() const
This method returns the interface UID.
AC Outlet profile implementation.
Simple LED profile implementation.
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...
Simple Humidity Sensor profile implementation.
This file contains the definitions for the Simple Thermostat interface.
Class template for all profile implementations.
Level Control Interface : Server side implementation.
Interface2 * second()
Pointer to the second interface instance.
Simple Power Meter profile implementation.
Proprietary profiles UID start value.
Alert Interface : Server side implementation.
This file contains the definitions for the Simple Air Pressure interface.
Simple Keypad profile implementation.
Simple On/Off Switch profile implementation.
Dimmable Light profile implementation.
Interface/Service Attribute API.
virtual void send(const Protocol::Address &addr, Protocol::Message &message)=0
Send message msg to the network address given by addr.
void status(Protocol::Address &addr, uint16_t unit_type)
Send a HAN-FUN message containing a Alert::STATUS_CMD, to the given network address.
Allows a unit to receive and interpret both on/off and level control requests.
Use for a vibration detector that senses and sends an alert.
void alert(Protocol::Address &addr, bool state)
Send an alert command to the remote device given by the address in addr.
const Interface2 * second() const
Pointer to the second interface instance.
Simple Level Controllable profile implementation.
Top level class representing a HAN-FUN profile.
#define UNUSED(x)
Helper macro to remove warning about unused function/method argument.
This unit will be acting upon some physical Light switch.
This unit will be acting upon some dimmable light.
User Interface Lock profile implementation.
virtual Common::Result handle(Protocol::Packet &packet, Common::ByteArray &payload, uint16_t offset)=0
Handle incoming messages from the network.
This unit will be acting upon some dimmable light switch.
Common interface for all Interfaces.
Tracker profile implementation.
Glass Break Detector profile implementation.
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.
This unit will be acting upon some physical AC switch and provides measurements over electric quantit...
Class template for profiles containing two interfaces.
This unit will be acting upon some physical door lock switch.
Simple sensor to measure the temperature.
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...
Interface1 * first()
Pointer to the first interface instance.
Allows a unit to send level adjustment requests.
virtual uint16_t uid() const =0
This method returns the interface UID.
Result
Commands result codes.
Door Bell profile implementation.
Class template for Detector type profiles.
Simple Light profile implementation.
const Interface1 * first() const
Pointer to the first interface instance.
Door Open Close Detector profile implementation.
This profile can be used to receive alerts.
This file contains the definitions for the Simple Visual Effects interface.
This file contains the definitions for the Simple Power Meter interface.
Top-level namespace for the HAN-FUN library.