HAN-FUN API  1.5.3
This project provides the common implementation of ULE Alliance's HAN-FUN application protocol.
profiles.h
Go to the documentation of this file.
1 // =============================================================================
15 // =============================================================================
16 #ifndef HF_PROFILES_H
17 #define HF_PROFILES_H
18 
19 #include "common.h"
20 
21 #include "hanfun/interface.h"
35 
36 // =============================================================================
37 // API
38 // =============================================================================
39 
40 namespace HF
41 {
45  namespace Profiles
46  {
59  enum UID
61  {
62  // =============================================================================
63  // Home Control Unit Types
64  // =============================================================================
65 
68 
71 
74 
77 
80 
83 
85  AC_OUTLET = 0x0106,
86 
92 
94  SIMPLE_LIGHT = 0x0108,
95 
97  DIMMABLE_LIGHT = 0x0109,
98 
100  DIMMER_SWITCH = 0x010A,
101 
104 
106  DOOR_BELL = 0x010C,
107 
110 
113 
116 
119 
121  SIMPLE_BUTTON = 0x0111,
122 
125 
127  SIMPLE_LED = 0x0113,
128 
131 
133  COLOUR_BULB = 0x0115,
134 
137 
139  TRACKER = 0x0117,
140 
142  SIMPLE_KEYPAD = 0x0118,
143 
144  // =============================================================================
145  // Security Unit Types
146  // =============================================================================
147 
149  SIMPLE_DETECTOR = 0x0200,
150 
153 
156 
158  MOTION_DETECTOR = 0x0203,
159 
161  SMOKE_DETECTOR = 0x0204,
162 
164  GAS_DETECTOR = 0x0205,
165 
167  FLOOD_DETECTOR = 0x0206,
168 
171 
174 
177 
179  SIREN = 0x0280,
180 
182  ALERTABLE = 0x0281,
183 
184  // =============================================================================
185  // Home care Unit Types
186  // =============================================================================
187 
189  SIMPLE_PENDANT = 0x0300,
190 
191  // =============================================================================
192  // Application Unit Types
193  // =============================================================================
194 
197 
199  USER_INTERFACE = 0x0410,
200 
203 
204  // =============================================================================
205  // Proprietary Unit Types
206  // =============================================================================
207 
208  // Use an ID from within the specified range to identify a proprietary unit type.
209 
212 
214  PROPRIETARY_END = 0xFFFF,
215  };
216 
233  Common::Interface const *interfaces(uint16_t profile, uint16_t &count);
234 
240  struct IProfile
241  {
242  virtual ~IProfile() {}
243 
249  virtual uint16_t uid() const = 0;
250 
261  virtual HF::Attributes::List attributes(Common::Interface itf, uint8_t pack_id,
262  const HF::Attributes::UIDS &uids) const = 0;
263  };
264 
268  template<uint16_t _uid>
269  struct AbstractProfile: public IProfile
270  {
271  virtual ~AbstractProfile()
272  {}
273 
274  uint16_t uid() const
275  {
276  return _uid;
277  }
278 
280  const HF::Attributes::UIDS &uids) const
281  {
282  UNUSED(itf);
283  UNUSED(pack_id);
284  UNUSED(uids);
285 
286  return HF::Attributes::List();
287  }
288 
291  uint16_t offset)
292  {
293  UNUSED(packet);
294  UNUSED(payload);
295  UNUSED(offset);
296 
298  }
299  };
300 
304  template<uint16_t _uid, class Interface>
305  struct Profile: public AbstractProfile<_uid>, public Interface
306  {
307  virtual ~Profile()
308  {}
309 
311  using Interface::handle;
312  using Interface::attributes;
313 
315  const HF::Attributes::UIDS &uids) const
316  {
317  if (Interface::uid() == itf.id)
318  {
319  return HF::Attributes::get(*this, pack_id, uids);
320  }
321  else
322  {
323  return HF::Attributes::List();
324  }
325  }
326  };
327 
331  template<uint16_t _uid, typename... _Interfaces>
332  class ProfileN: public AbstractProfile<_uid>,
333  public Interfaces::Container<ProfileN<_uid, _Interfaces...>,
334  HF::Interfaces::Proxy<_Interfaces,
335  ProfileN<_uid, _Interfaces...>>...>
336  {
337  typedef ProfileN<_uid, _Interfaces...> profile_t;
338  typedef Interfaces::Container<ProfileN<_uid, _Interfaces...>,
339  HF::Interfaces::Proxy<_Interfaces,
340  ProfileN<_uid,
341  _Interfaces...>>
342  ...> container_t;
343 
344  public:
345 
346  virtual ~ProfileN()
347  {}
348 
351  uint16_t offset)
352  {
353  return container_t::handle(packet, payload, offset);
354  }
355 
357  virtual void send(const Protocol::Address &addr, Protocol::Message &message) = 0;
358 
360  virtual void notify(const HF::Attributes::IAttribute &old_value,
361  const HF::Attributes::IAttribute &new_value) const = 0;
362 
365  const HF::Attributes::UIDS &uids) const
366  {
367  HF::Attributes::List result;
368 
369  container_t::attributes(result, itf, pack_id, uids);
370 
371  return result;
372  }
373 
374  protected:
375 
376  ProfileN(): container_t(*this)
377  {}
378  };
379 
383  template<uint16_t _uid, typename Interface1, typename Interface2>
384  struct Profile2: public ProfileN<_uid, Interface1, Interface2>
385  {
386  virtual ~Profile2()
387  {}
388 
392 
398  Interface1 *first()
399  {
400  return const_cast<Interface1 *>(profile_t::template get<0>());
401  }
402 
408  Interface2 *second()
409  {
410  return const_cast<Interface2 *>(profile_t::template get<1>());
411  }
412 
418  const Interface1 *first() const
419  {
420  return const_cast<Interface1 *>(profile_t::template get<0>());
421  }
422 
428  const Interface2 *second() const
429  {
430  return const_cast<Interface2 *>(profile_t::template get<1>());
431  }
432  };
433 
437  template<Profiles::UID _uid>
438  struct Detector: public AbstractProfile<_uid>, protected Interfaces::Alert::Server
439  {
440  Detector()
441  {
444  }
445 
446  virtual ~Detector()
447  {}
448 
451 
458  void alert(Protocol::Address &addr, bool state)
459  {
462  }
463 
469  void alert(bool state)
470  {
471  Protocol::Address addr;
472  this->alert(addr, state);
473  }
474 
476 
479  const HF::Attributes::UIDS &uids) const
480  {
481  if (Interfaces::Alert::Server::uid() == itf.id)
482  {
483  return HF::Attributes::get(*this, pack_id, uids);
484  }
485  else
486  {
487  return HF::Attributes::List();
488  }
489  }
490  };
491 
493  // =============================================================================
501  // =============================================================================
502 
506  class SimpleOnOffSwitchable: public Profile<SIMPLE_ONOFF_SWITCHABLE,
507  Interfaces::OnOff::Server>
508  {
509  public:
510 
511  virtual ~SimpleOnOffSwitchable() {}
512  };
513 
517  class SimpleOnOffSwitch: public Profile<SIMPLE_ONOFF_SWITCH, Interfaces::OnOff::Client>
518  {
519  public:
520 
521  virtual ~SimpleOnOffSwitch() {}
522  };
523 
528  public Profile<SIMPLE_LEVEL_CONTROLLABLE, Interfaces::LevelControl::Server>
529  {
530  public:
531 
532  virtual ~SimpleLevelControllable() {}
533  };
534 
538  class SimpleLevelControl: public Profile<SIMPLE_LEVEL_CONTROL,
539  Interfaces::LevelControl::Client>
540  {
541  public:
542 
543  virtual ~SimpleLevelControl() {}
544  };
545 
549  template<typename OnOffServer = Interfaces::OnOff::Server,
550  typename LevelControlServer = Interfaces::LevelControl::Server>
552  public Profile2<SIMPLE_LEVEL_CONTROLLABLE_SWITCHABLE, OnOffServer, LevelControlServer>
553  {
554  static_assert(std::is_base_of<Interfaces::OnOff::Server, OnOffServer>::value,
555  "OnOff::Server MUST be of type Interfaces::OnOff::Server !");
556 
557  static_assert(std::is_base_of<Interfaces::LevelControl::Server,
558  LevelControlServer>::value,
559  "LevelControl::Server MUST be of type Interfaces::LevelControl::Server !");
560 
561  public:
562 
564 
565  OnOffServer *on_off()
566  {
567  return this->first();
568  }
569 
570  LevelControlServer *level_control()
571  {
572  return this->second();
573  }
574  };
575 
579  template<typename OnOffClient = Interfaces::OnOff::Client,
580  typename LevelControlClient = Interfaces::LevelControl::Client>
582  public Profile2<SIMPLE_LEVEL_CONTROL_SWITCH, OnOffClient, LevelControlClient>
583  {
584  static_assert(std::is_base_of<Interfaces::OnOff::Client, OnOffClient>::value,
585  "OnOff::Client MUST be of type Interfaces::OnOff::Client !");
586 
587  static_assert(std::is_base_of<Interfaces::LevelControl::Client,
588  LevelControlClient>::value,
589  "LevelControl::Client MUST be of type Interfaces::LevelControl::Client !");
590  public:
591 
592  virtual ~SimpleLevelControlSwitch() {}
593 
594  OnOffClient *on_off()
595  {
596  return this->first();
597  }
598 
599  LevelControlClient *level_control()
600  {
601  return this->second();
602  }
603  };
604 
608  class AC_Outlet: public Profile<AC_OUTLET, Interfaces::OnOff::Server>
609  {
610  public:
611 
612  virtual ~AC_Outlet() {}
613  };
614 
618  template<typename OnOffServer = Interfaces::OnOff::Server,
619  typename SimplePowerMeterServer = Interfaces::SimplePowerMeter::Server>
621  public Profile2<AC_OUTLET_WITH_POWER_METERING, OnOffServer, SimplePowerMeterServer>
622  {
623  static_assert(std::is_base_of<Interfaces::OnOff::Server, OnOffServer>::value,
624  "OnOff::Server MUST be of type Interfaces::OnOff::Server !");
625 
626  static_assert(std::is_base_of<Interfaces::SimplePowerMeter::Server,
627  SimplePowerMeterServer>::value,
628  "SimplePowerMeterServer MUST be of type Interfaces::SimplePowerMeter::Server !");
629 
630  public:
631 
632  virtual ~AC_OutletWithPowerMetering() {}
633 
634  OnOffServer *on_off()
635  {
636  return this->first();
637  }
638 
639  SimplePowerMeterServer *power_meter()
640  {
641  return this->second();
642  }
643  };
644 
648  class SimpleLight: public Profile<SIMPLE_LIGHT, Interfaces::OnOff::Server>
649  {
650  public:
651 
652  virtual ~SimpleLight() {}
653  };
654 
658  template<typename OnOffServer = Interfaces::OnOff::Server,
659  typename LevelControlServer = Interfaces::LevelControl::Server>
660  class DimmableLight: public Profile2<DIMMABLE_LIGHT, OnOffServer, LevelControlServer>
661  {
662  static_assert(std::is_base_of<Interfaces::OnOff::Server, OnOffServer>::value,
663  "OnOff::Server MUST be of type Interfaces::OnOff::Server !");
664 
665  static_assert(std::is_base_of<Interfaces::LevelControl::Server,
666  LevelControlServer>::value,
667  "LevelControl::Client MUST be of type Interfaces::LevelControl::Server !");
668 
669  public:
670 
671  virtual ~DimmableLight() {}
672 
673  OnOffServer *on_off()
674  {
675  return this->first();
676  }
677 
678  LevelControlServer *level_control()
679  {
680  return this->second();
681  }
682  };
683 
687  template<typename OnOffClient = Interfaces::OnOff::Client,
688  typename LevelControlClient = Interfaces::LevelControl::Client>
689  class DimmerSwitch: public Profile2<DIMMER_SWITCH, OnOffClient, LevelControlClient>
690  {
691  static_assert(std::is_base_of<Interfaces::OnOff::Client, OnOffClient>::value,
692  "OnOff::Server MUST be of type Interfaces::OnOff::Client !");
693 
694  static_assert(std::is_base_of<Interfaces::LevelControl::Client,
695  LevelControlClient>::value,
696  "LevelControl::Server MUST be of type Interfaces::LevelControl::Client !");
697 
698  public:
699 
700  virtual ~DimmerSwitch() {}
701 
702  OnOffClient *on_off()
703  {
704  return this->first();
705  }
706 
707  LevelControlClient *level_control()
708  {
709  return this->second();
710  }
711  };
712 
716  class SimpleDoorLock: public Profile<SIMPLE_DOOR_LOCK, Interfaces::OnOff::Server>
717  {
718  public:
719 
720  virtual ~SimpleDoorLock() {}
721  };
722 
726  class DoorBell: public Profile<DOOR_BELL, Interfaces::Alert::Server>
727  {
728  public:
729 
730  virtual ~DoorBell() {}
731  };
732 
736  class SimplePowerMeter: public Profile<SIMPLE_POWER_METER,
737  Interfaces::SimplePowerMeter::Server>
738  {
739  public:
740 
741  virtual ~SimplePowerMeter() {}
742  };
743 
747  class SimpleTemperatureSensor: public Profile<SIMPLE_TEMPERATURE_SENSOR,
748  Interfaces::SimpleTemperature::Server>
749  {
750  public:
751 
752  virtual ~SimpleTemperatureSensor() {}
753  };
754 
758  class SimpleHumiditySensor: public Profile<SIMPLE_HUMIDITY_SENSOR,
759  Interfaces::SimpleHumidity::Server>
760  {
761  public:
762 
763  virtual ~SimpleHumiditySensor() {}
764  };
765 
769  template<typename OnOffServer = Interfaces::OnOff::Server,
770  typename SimpleThermostatServer = Interfaces::SimpleThermostat::Server>
771  class ControlableThermostat: public Profile2<CONTROLABLE_THERMOSTAT, OnOffServer,
772  SimpleThermostatServer>
773  {
774  static_assert(std::is_base_of<Interfaces::OnOff::Server, OnOffServer>::value,
775  "OnOffServer MUST be of type Interfaces::OnOff::Server !");
776 
777  static_assert(std::is_base_of<Interfaces::SimpleThermostat::Server,
778  SimpleThermostatServer>::value,
779  "SimpleThermostatServer MUST be of type Interfaces::SimpleThermostat::Server !");
780 
781  public:
782 
783  virtual ~ControlableThermostat() {}
784 
785  OnOffServer *on_off()
786  {
787  return this->first();
788  }
789 
790  SimpleThermostatServer *simple_thermostat()
791  {
792  return this->second();
793  }
794  };
795 
799  class SimpleAirPressureSensor: public Profile<SIMPLE_AIR_PRESSURE_SENSOR,
800  Interfaces::SimpleAirPressure::Server>
801  {
802  public:
803 
804  virtual ~SimpleAirPressureSensor() {}
805  };
806 
810  class SimpleButton: public Profile<SIMPLE_BUTTON, Interfaces::SimpleButton::Server>
811  {
812  public:
813 
814  virtual ~SimpleButton() {}
815  };
816 
820  class SimpleLED: public Profile<SIMPLE_LED, Interfaces::SimpleVisualEffects::Server>
821  {
822  public:
823 
824  virtual ~SimpleLED() {}
825  };
826 
830  class EnvironmentMonitor: public ProfileN<ENVIRONMENT_MONITOR,
831  Interfaces::SimpleTemperature::Server,
832  Interfaces::SimpleHumidity::Server,
833  Interfaces::SimpleAirPressure::Server>
834  {
835  public:
836 
837  virtual ~EnvironmentMonitor() {}
838  };
839 
843  template<typename OnOffServer = Interfaces::OnOff::Server,
844  typename ColourControlServer = Interfaces::ColourControl::Server>
845  class ColourBulb:
846  public Profile2<COLOUR_BULB, OnOffServer, ColourControlServer>
847  {
848  static_assert(std::is_base_of<Interfaces::OnOff::Server, OnOffServer>::value,
849  "OnOffServer MUST be of type Interfaces::OnOff::Server !");
850 
851  static_assert(std::is_base_of<Interfaces::ColourControl::IServer,
852  ColourControlServer>::value,
853  "ColourControlServer MUST be of type Interfaces::ColourControl::IServer !");
854 
855  public:
856 
857  virtual ~ColourBulb() {}
858 
859  OnOffServer *on_off()
860  {
861  return this->first();
862  }
863 
864  ColourControlServer *colour_control()
865  {
866  return this->second();
867  }
868  };
869 
873  template<typename OnOffServer = Interfaces::OnOff::Server,
874  typename ColourControlServer = Interfaces::ColourControl::Server,
875  typename LevelControlServer = Interfaces::LevelControl::Server>
877  public ProfileN<DIMMABLE_COLOUR_BULB, OnOffServer, ColourControlServer, LevelControlServer>
878  {
879  typedef ProfileN<DIMMABLE_COLOUR_BULB, OnOffServer, ColourControlServer,
880  LevelControlServer> profile_t;
881 
882  static_assert(std::is_base_of<Interfaces::OnOff::Server, OnOffServer>::value,
883  "OnOffServer MUST be of type Interfaces::OnOff::Server !");
884 
885  static_assert(std::is_base_of<Interfaces::ColourControl::IServer,
886  ColourControlServer>::value,
887  "ColourControlServer MUST be of type Interfaces::ColourControl::IServer !");
888 
889  static_assert(std::is_base_of<Interfaces::LevelControl::Server,
890  LevelControlServer>::value,
891  "LevelControlServer MUST be of type Interfaces::LevelControl::Server !");
892 
893  public:
894 
895  virtual ~DimmableColourBulb()
896  {}
897 
898  OnOffServer *on_off()
899  {
900  return const_cast<OnOffServer *>(profile_t::template get<0>());
901  }
902 
903  ColourControlServer *colour_control()
904  {
905  return const_cast<ColourControlServer *>(profile_t::template get<1>());
906  }
907 
908  LevelControlServer *level_control()
909  {
910  return const_cast<LevelControlServer *>(profile_t::template get<2>());
911  }
912  };
913 
917  class Tracker: public AbstractProfile<TRACKER>
918  {
919  public:
920 
921  virtual ~Tracker() {}
922 
924  virtual void periodic(uint32_t time)
925  {
926  UNUSED(time);
927  }
928  };
929 
933  class SimpleKeypad: public Profile<SIMPLE_KEYPAD,
934  Interfaces::SimpleKeypad::Server>
935  {
936  public:
937 
938  virtual ~SimpleKeypad()
939  {}
940  };
941 
942  // =============================================================================
951  // =============================================================================
952 
956  class SimpleDetector: public Detector<SIMPLE_DETECTOR>
957  {
958  public:
959 
960  virtual ~SimpleDetector() {}
961  };
962 
966  class DoorOpenCloseDetector: public Detector<DOOR_OPEN_CLOSE_DETECTOR>
967  {
968  public:
969 
970  virtual ~DoorOpenCloseDetector() {}
971  };
972 
976  class WindowOpenCloseDetector: public Detector<WINDOW_OPEN_CLOSE_DETECTOR>
977  {
978  public:
979 
980  virtual ~WindowOpenCloseDetector() {}
981  };
982 
986  class MotionDetector: public Detector<MOTION_DETECTOR>
987  {
988  public:
989 
990  virtual ~MotionDetector() {}
991  };
992 
996  class SmokeDetector: public Detector<SMOKE_DETECTOR>
997  {
998  public:
999 
1000  virtual ~SmokeDetector() {}
1001  };
1002 
1006  class GasDetector: public Detector<GAS_DETECTOR>
1007  {
1008  public:
1009 
1010  virtual ~GasDetector() {}
1011  };
1012 
1016  class FloodDetector: public Detector<FLOOD_DETECTOR>
1017  {
1018  public:
1019 
1020  virtual ~FloodDetector() {}
1021  };
1022 
1026  class GlassBreakDetector: public Detector<GLASS_BREAK_DETECTOR>
1027  {
1028  public:
1029 
1030  virtual ~GlassBreakDetector() {}
1031  };
1032 
1036  class VibrationDetector: public Detector<VIBRATION_DETECTOR>
1037  {
1038  public:
1039 
1040  virtual ~VibrationDetector() {}
1041  };
1042 
1046  class SimpleLightSensor: public Profile<SIMPLE_LIGHT_SENSOR,
1047  Interfaces::SimpleLightSensor::Server>
1048  {
1049  public:
1050 
1051  virtual ~SimpleLightSensor()
1052  {}
1053  };
1054 
1058  class Siren: public Profile<SIREN, Interfaces::OnOff::Server>
1059  {
1060  public:
1061 
1062  virtual ~Siren() {}
1063  };
1064 
1068  class Alertable: public Profile<ALERTABLE, Interfaces::Alert::Client>
1069  {
1070  public:
1071 
1072  virtual ~Alertable() {}
1073  };
1074 
1075  // =============================================================================
1084  // =============================================================================
1085 
1089  class SimplePendant: public Detector<SIMPLE_PENDANT>
1090  {
1091  public:
1092 
1093  virtual ~SimplePendant() {}
1094  };
1095 
1096  // =============================================================================
1106  // =============================================================================
1107 
1111  class UserInterfaceLock: public Profile<USER_INTERFACE_LOCK, Interfaces::OnOff::Server>
1112  {
1113  public:
1114 
1115  virtual ~UserInterfaceLock() {}
1116  };
1117 
1121  class UserInterface: public AbstractProfile<USER_INTERFACE>
1122  {
1123  public:
1124 
1125  virtual ~UserInterface() {}
1126 
1128  virtual void periodic(uint32_t time)
1129  {
1130  UNUSED(time);
1131  }
1132  };
1133 
1137  class GenericApplicationLogic: public AbstractProfile<GENERIC_APPLICATION>
1138  {
1139  public:
1140 
1141  virtual ~GenericApplicationLogic() {}
1142 
1144  virtual void periodic(uint32_t time)
1145  {
1146  UNUSED(time);
1147  }
1148  };
1151  } // namespace Profiles
1152 
1153 } // namespace HF
1154 
1155 #endif /* HF_PROFILES_H */
Class template for profiles containing multiple interfaces.
Definition: profiles.h:332
This unit will be acting upon some physical AC switch.
Definition: profiles.h:85
Allows a unit to receive and interpret requests for adjustment of some quantity.
Definition: profiles.h:73
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.
Definition: profiles.h:1137
Use for a motion detector that senses and sends an alert.
Definition: profiles.h:158
Simple Air Pressure Sensor profile implementation.
Definition: profiles.h:799
On-Off Interface : Client side implementation.
Definition: on_off.h:218
AC Outlet profile implementation.
Definition: profiles.h:608
Simple Light Sensor profile implementation.
Definition: profiles.h:1046
Use for a flood detector that senses and sends an alert.
Definition: profiles.h:167
Allows a unit to do and provide measurements over electric quantities.
Definition: profiles.h:109
Colour Control Interface : Server side implementation.
User Interface Lock.
Definition: profiles.h:196
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.
Definition: profiles.h:67
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.
Definition: profiles.h:164
This unit will be acting upon some physical siren that will sound an alert.
Definition: profiles.h:179
Dimmable Colour bulb profile implementation.
Definition: profiles.h:876
Allows a unit to provide light readings.
Definition: profiles.h:176
void alert(bool state)
Send an alert command to the broadcast address.
Definition: profiles.h:469
Simple Level Control profile implementation.
Definition: profiles.h:538
List of attributes UIDs.
Definition: attributes.h:176
This unit will be acting upon some physical door bell.
Definition: profiles.h:106
User Interface profile implementation.
Definition: profiles.h:1121
Smoke Detector profile implementation.
Definition: profiles.h:996
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.
Definition: profiles.h:1036
This file contains the definitions for the Simple Temperature interface.
uint16_t uid() const
Return this profile HAN-FUN UID.
Definition: profiles.h:274
virtual void periodic(uint32_t time)
Handle periodic processing.
Definition: profiles.h:1144
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.
Definition: interface.h:445
Simple Thermostat Interface : Server side implementation.
This file contains the definitions for the Alert interface.
Environment Monitoring profile implementation.
Definition: profiles.h:830
Simple On/Off Switchable profile implementation.
Definition: profiles.h:506
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...
Definition: attributes.h:752
Controllable thermostat profile implementation.
Definition: profiles.h:771
Use for an open/close window detector that senses and sends an alert.
Definition: profiles.h:155
Simple Detector profile implementation.
Definition: profiles.h:956
Simple Pendant profile implementation.
Definition: profiles.h:1089
Common::Result handle(Protocol::Packet &packet, Common::ByteArray &payload, uint16_t offset)
Handle incoming messages from the network.
Definition: profiles.h:350
Dimmable Colour Bulb.
Definition: profiles.h:136
Motion Detector profile implementation.
Definition: profiles.h:986
Dimmer Switch profile implementation.
Definition: profiles.h:689
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&#39;s...
Definition: profiles.h:314
Helper template class to allow interfaces implementation to be added as fields to other classes...
Definition: interface.h:412
Siren profile implementation.
Definition: profiles.h:1058
Allows a unit to send both on/off and level control requests.
Definition: profiles.h:82
This file contains the definitions common to all interfaces.
virtual void periodic(uint32_t time)
Handle periodic processing.
Definition: profiles.h:924
Simple Air Pressure Sensor.
Definition: profiles.h:118
uint32_t state()
Return the current state for all the alerts as a bitmask.
On-Off Interface : Server side implementation.
Definition: on_off.h:119
Use for an open/close door detector that senses and sends an alert.
Definition: profiles.h:152
Controllable thermostat.
Definition: profiles.h:124
User Interface unit (e.g. keypad, remote control)
Definition: profiles.h:199
Simple Temperature Sensor profile implementation.
Definition: profiles.h:747
Simple Level Controllable Switchable profile implementation.
Definition: profiles.h:551
Simple sensor to measure the relative humidity.
Definition: profiles.h:115
Class template for profiles containing only one interface.
Definition: profiles.h:305
Simple LED profile.
Definition: profiles.h:127
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&#39;s...
Definition: profiles.h:478
Logic Application logic unit, (e.g. can be at the concentrator, Portal, user controller) ...
Definition: profiles.h:202
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&#39;s...
Use for a smoke detector that senses and sends an alert.
Definition: profiles.h:161
Colour bulb profile implementation.
Definition: profiles.h:845
Allows a unit to send on/off requests.
Definition: profiles.h:70
Simple Level Control Switch profile implementation.
Definition: profiles.h:581
void enable(uint8_t index)
Enable alert at index.
Flood Detector profile implementation.
Definition: profiles.h:1016
Window Open Close Detector profile implementation.
Definition: profiles.h:976
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.
Definition: profiles.h:189
This class represents a byte array.
virtual void periodic(uint32_t time)
Handle periodic processing.
Definition: profiles.h:1128
Simple Door Lock profile implementation.
Definition: profiles.h:716
Common::Result handle(Protocol::Packet &packet, Common::ByteArray &payload, uint16_t offset)
Handle incoming messages from the network.
Definition: interface.h:463
Gas Detector profile implementation.
Definition: profiles.h:1006
Use for a glass break detector that senses and sends an alert.
Definition: profiles.h:170
Common::Result handle(Protocol::Packet &packet, Common::ByteArray &payload, uint16_t offset)
Handle incoming messages from the network.
Definition: profiles.h:290
Use for a generic detector that senses and sends an alert.
Definition: profiles.h:149
Proprietary profiles UID end value.
Definition: profiles.h:214
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&#39;s...
Definition: profiles.h:279
Alertable profile implementation.
Definition: profiles.h:1068
void disableAll()
Disable all alerts.
Network Address.
Definition: protocol.h:201
uint16_t uid() const
This method returns the interface UID.
Definition: interface.h:374
Network Message.
Definition: protocol.h:60
AC Outlet profile implementation.
Definition: profiles.h:620
Simple LED profile implementation.
Definition: profiles.h:820
Simple Button profile implementation.
Definition: profiles.h:810
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&#39;s...
Definition: profiles.h:364
Simple Humidity Sensor profile implementation.
Definition: profiles.h:758
This file contains the definitions for the Simple Thermostat interface.
Class template for all profile implementations.
Definition: profiles.h:269
Level Control Interface : Server side implementation.
Interface2 * second()
Pointer to the second interface instance.
Definition: profiles.h:408
This file contains the definitions for the Simple Button interface.
Simple Power Meter profile implementation.
Definition: profiles.h:736
Fail - Invalid Argument.
Proprietary profiles UID start value.
Definition: profiles.h:211
HAN-FUN Protocol Packet.
Definition: protocol.h:298
Alert Interface : Server side implementation.
Definition: alert.h:176
This file contains the definitions for the Simple Air Pressure interface.
Simple Keypad profile implementation.
Definition: profiles.h:933
Simple On/Off Switch profile implementation.
Definition: profiles.h:517
Dimmable Light profile implementation.
Definition: profiles.h:660
Interface/Service Attribute API.
Definition: attributes.h:44
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.
Definition: profiles.h:79
Use for a vibration detector that senses and sends an alert.
Definition: profiles.h:173
void alert(Protocol::Address &addr, bool state)
Send an alert command to the remote device given by the address in addr.
Definition: profiles.h:458
const Interface2 * second() const
Pointer to the second interface instance.
Definition: profiles.h:428
Simple Level Controllable profile implementation.
Definition: profiles.h:527
Top level class representing a HAN-FUN profile.
Definition: profiles.h:240
UID
Profiles UID&#39;s
Definition: profiles.h:60
#define UNUSED(x)
Helper macro to remove warning about unused function/method argument.
Environment Monitoring.
Definition: profiles.h:130
This unit will be acting upon some physical Light switch.
Definition: profiles.h:94
This unit will be acting upon some dimmable light.
Definition: profiles.h:97
User Interface Lock profile implementation.
Definition: profiles.h:1111
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.
Definition: profiles.h:100
Common interface for all Interfaces.
Definition: interface.h:43
Tracker profile implementation.
Definition: profiles.h:917
Glass Break Detector profile implementation.
Definition: profiles.h:1026
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.
Definition: alert.h:338
This unit will be acting upon some physical AC switch and provides measurements over electric quantit...
Definition: profiles.h:91
Class template for profiles containing two interfaces.
Definition: profiles.h:384
This unit will be acting upon some physical door lock switch.
Definition: profiles.h:103
Simple sensor to measure the temperature.
Definition: profiles.h:112
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&#39;s...
Definition: interface.h:483
Interface1 * first()
Pointer to the first interface instance.
Definition: profiles.h:398
Allows a unit to send level adjustment requests.
Definition: profiles.h:76
virtual uint16_t uid() const =0
This method returns the interface UID.
Result
Commands result codes.
Door Bell profile implementation.
Definition: profiles.h:726
Class template for Detector type profiles.
Definition: profiles.h:438
Simple Light profile implementation.
Definition: profiles.h:648
const Interface1 * first() const
Pointer to the first interface instance.
Definition: profiles.h:418
Door Open Close Detector profile implementation.
Definition: profiles.h:966
This profile can be used to receive alerts.
Definition: profiles.h:182
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.
Definition: attributes.h:22