HAN-FUN API  1.5.3
This project provides the common implementation of ULE Alliance's HAN-FUN application protocol.
device.h
Go to the documentation of this file.
1 // =============================================================================
15 // =============================================================================
16 
17 #ifndef HF_DEVICE_H
18 #define HF_DEVICE_H
19 
20 #include "hanfun/common.h"
21 #include "hanfun/transport.h"
22 
23 namespace HF
24 {
25  // Forward declaration of the core namespace.
26  namespace Core
27  {
28  namespace DeviceInformation
29  {
30  struct Server;
31 
32  } // namespace DeviceInformation
33 
34  namespace AttributeReporting
35  {
36  struct IServer;
37 
38  } // namespace AttributeReporting
39 
40  namespace GroupTable
41  {
42  class IServer;
43 
44  } // namespace GroupTable
45 
46  namespace Time
47  {
48  class Server;
49 
50  } // namespace Time
51 
52  namespace BatchProgramManagement
53  {
54  class IServer;
55  } // namespace BatchProgramManagement
56 
57  namespace Scheduling
58  {
59  namespace Event
60  {
61  struct IServer;
62 
63  } // namespace Event
64 
65  namespace Weekly
66  {
67  struct IServer;
68 
69  } // namespace Weekly
70 
71  } // namespace Scheduling
72 
73  } // namespace Core
74 
75  // Forward declaration of the units namespace.
76  namespace Units
77  {
78  // Forward declaration of the Unit's interface.
79  struct IUnit;
80 
81  } // namespace Units
82 
83  // Forward declaration of the protocol namespace.
84  namespace Protocol
85  {
86  // Forward declaration of the protocol packet structure.
87  struct Packet;
88 
89  } // namespace Protocol
90 
100  {
104  struct IUnits: public Common::SimpleList<Units::IUnit *>
105  {
106  IUnits::size_type size() const
107  {
108  return distance(begin(), end());
109  }
110  };
111 
115  struct IUnit0
116  {
122  virtual Core::DeviceInformation::Server *device_info() const = 0;
123 
130 
137 
144 
145 #if HF_GROUP_SUPPORT
146 
151  virtual HF::Core::GroupTable::IServer *group_table() = 0;
152 
158  virtual HF::Core::GroupTable::IServer *group_table() const = 0;
159 #endif
160 
161 #if HF_TIME_SUPPORT
162 
167  virtual HF::Core::Time::Server *time() = 0;
168 
174  virtual HF::Core::Time::Server *time() const = 0;
175 #endif
176 
177 #if HF_BATCH_PROGRAM_SUPPORT
178 
183  virtual HF::Core::BatchProgramManagement::IServer *batch_program() = 0;
184 
190  virtual HF::Core::BatchProgramManagement::IServer *batch_program() const = 0;
191 #endif
192 
193 #if HF_EVENT_SCHEDULING_SUPPORT
194 
199  virtual HF::Core::Scheduling::Event::IServer *event_scheduling() = 0;
200 
206  virtual HF::Core::Scheduling::Event::IServer *event_scheduling() const = 0;
207 #endif
208 
209 #if HF_WEEKLY_SCHEDULING_SUPPORT
210 
215  virtual HF::Core::Scheduling::Weekly::IServer *weekly_scheduling() = 0;
216 
222  virtual HF::Core::Scheduling::Weekly::IServer *weekly_scheduling() const = 0;
223 #endif
224 
225  };
226 
234  virtual uint16_t address() const = 0;
235 
241  virtual const IUnits &units() const = 0;
242 
251  virtual Units::IUnit *unit(uint8_t id) const = 0;
252 
258  virtual IUnit0 *unit0() const = 0;
259 
265  virtual void add(Units::IUnit *unit) = 0;
266 
272  virtual void remove(Units::IUnit *unit) = 0;
273 
279  virtual void send(Protocol::Packet &packet) = 0;
280 
282  virtual void periodic(uint32_t time) = 0;
283  };
284 
287 } // namespace HF
288 
289 #endif /* DEVICE_H_ */
virtual Core::DeviceInformation::Server * device_info() const =0
Return a pointer to unit 0 device information service.
This file contains the common defines for the HAN-FUN library.
Unit list type.
Definition: device.h:104
virtual const IUnits & units() const =0
Return the list of units registered in this device.
virtual void add(Units::IUnit *unit)=0
Add unit to devices unit lists.
virtual Units::IUnit * unit(uint8_t id) const =0
Return pointer to the unit with the given id.
Scheduling Service : Server side implementation.
This class represents the interface common to all HAN-FUN devices.
Definition: device.h:99
Group Table Service : Server side implementation.
Definition: group_table.h:457
Batch Program Management Interfaces::Interface : Server side implementation.
virtual Core::AttributeReporting::IServer * attribute_reporting() const =0
Return a pointer to unit 0 attribute reporting service.
virtual uint16_t address() const =0
Return the device address on the HAN-FUN network, when the device is registered, or HF_BROADCAST_ADDR...
This file contains the definition of the transport layer API for the HAN-FUN common implementation...
Scheduling Service : Server side implementation.
virtual IUnit0 * unit0() const =0
Return pointer to the unit 0 for this device.
virtual void send(Protocol::Packet &packet)=0
Send given packet into the HAN-FUN network.
HAN-FUN device Unit 0 common API.
Definition: device.h:115
virtual void periodic(uint32_t time)=0
Handle periodic processing.
HAN-FUN Protocol Packet.
Definition: protocol.h:298
Time Service : Server side implementation.
Definition: time.h:220
This class represents the interface implemented by all HAN-FUN units.
Definition: units.h:48
Time
This represents the type of time that is associated with a time measurement.
Device Information interface : Server side.
Attribute Reporting - Server Role.
This is the interface used by the transport layer to signal events comming in from the network...
Top-level namespace for the HAN-FUN library.
Definition: attributes.h:22