HAN-FUN API  1.5.3
This project provides the common implementation of ULE Alliance's HAN-FUN application protocol.
node.h
Go to the documentation of this file.
1 // =============================================================================
16 // =============================================================================
17 #ifndef HF_APP_NODE_H
18 #define HF_APP_NODE_H
19 
20 #include "hanfun.h"
21 
27 // =============================================================================
28 // API
29 // =============================================================================
30 
34 struct Node: public HF::Devices::Node::Abstract<HF::Devices::Node::DefaultUnit0>
35 {
36  virtual ~Node() = default;
37 
38  void receive(HF::Protocol::Packet &packet, HF::Common::ByteArray &payload, uint16_t offset);
39 };
40 
44 struct SimpleLight: public HF::Units::Unit<HF::Profiles::SimpleLight>
45 {
52  SimpleLight(uint8_t index, HF::IDevice &device):
53  HF::Units::Unit<HF::Profiles::SimpleLight>(index, device)
54  {}
55 
56  void on(HF::Protocol::Address &source);
57 
58  void off(HF::Protocol::Address &source);
59 
60  void toggle(HF::Protocol::Address &source);
61 };
62 
66 struct SimpleSwitch: public HF::Units::Unit<HF::Profiles::SimpleOnOffSwitch>
67 {
74  SimpleSwitch(uint8_t index, HF::IDevice &device):
75  HF::Units::Unit<HF::Profiles::SimpleOnOffSwitch>(index, device)
76  {}
77 };
78 
81 #endif /* HF_APP_BASE_H */
This is the top level include file for the HAN-FUN library.
SimpleSwitch(uint8_t index, HF::IDevice &device)
Constructor.
Definition: node.h:74
Helper template class to implement units.
Definition: units.h:196
This class represents the interface common to all HAN-FUN devices.
Definition: device.h:99
This class represents a byte array.
Network Address.
Definition: protocol.h:201
Unit(uint8_t id, IDevice &device)
Constructor.
Definition: units.h:212
HAN-FUN Protocol Packet.
Definition: protocol.h:298
SimpleLight(uint8_t index, HF::IDevice &device)
Constructor.
Definition: node.h:52
Template for declaring HAN-FUN node devices.
Definition: devices.h:425
void receive(Protocol::Packet &packet, Common::ByteArray &payload, uint16_t offset) _override
Callback to deliver a packet received from the transport layer.
Definition: devices.h:446
Top-level namespace for the HAN-FUN library.
Definition: attributes.h:22