HAN-FUN API  1.5.3
This project provides the common implementation of ULE Alliance's HAN-FUN application protocol.
group_table.h
Go to the documentation of this file.
1 // =============================================================================
15 // =============================================================================
16 
17 #ifndef HF_CORE_GROUP_TABLE_H
18 #define HF_CORE_GROUP_TABLE_H
19 
20 #include "hanfun/protocol.h"
21 #include "hanfun/core.h"
22 
23 namespace HF
24 {
25  namespace Core
26  {
27  // Forward declaration.
28  namespace GroupTable
29  {
30  class IServer;
31  }
32 
48 
52  namespace GroupTable
53  {
61  typedef enum _CMD
63  {
64  ADD_CMD = 0x01,
65  REMOVE_CMD = 0x02,
66  REMOVE_ALL_CMD = 0x03,
68  __LAST_CMD__ = READ_ENTRIES_CMD
69  } CMD;
70 
72  typedef enum _Attributes
73  {
76  __LAST_ATTR__ = NUMBER_OF_MAX_ENTRIES_ATTR
77  } Attributes;
78 
82  struct Entry
83  {
84  uint16_t group;
85 
86  uint8_t unit;
87 
88  Entry(uint16_t _group = 0, uint8_t _unit = 0):
89  group(_group), unit(_unit) {}
90 
91  Entry(const Entry &entry) = default;
92 
94  static constexpr uint16_t min_size = sizeof(uint16_t) // Group Address
95  + sizeof(uint8_t); // Unit ID
96 
98  uint16_t size() const;
99 
101  uint16_t pack(Common::ByteArray &array, uint16_t offset = 0) const;
102 
104  uint16_t unpack(const Common::ByteArray &array, uint16_t offset = 0);
105  };
106 
107  // =============================================================================
108  // Attribute Helper classes
109  // =============================================================================
110 
115  {
116  static constexpr uint8_t ID = NUMBER_OF_ENTRIES_ATTR;
117  static constexpr bool WRITABLE = false;
118 
119  NumberOfEntries(uint8_t value = 0, HF::Interface *owner = nullptr):
120  Attribute<uint8_t>(HF::Interface::GROUP_TABLE, ID, owner, value, WRITABLE)
121  {}
122  };
123 
128  {
129  static constexpr uint8_t ID = NUMBER_OF_MAX_ENTRIES_ATTR;
130  static constexpr bool WRITABLE = false;
131 
132  NumberOfMaxEntries(uint8_t value = 0, HF::Interface *owner = nullptr):
133  Attribute<uint8_t>(HF::Interface::GROUP_TABLE, ID, owner, value, WRITABLE)
134  {}
135  };
136 
148 
149  // =============================================================================
150  // Messages
151  // =============================================================================
152 
156  struct Response: public Protocol::Response, public Entry
157  {
166  uint16_t group = 0x0000, uint8_t unit = 0x00):
167  Protocol::Response(code), Entry(group, unit) {}
168 
175  Response(Common::Result code, const Entry &entry):
176  Protocol::Response(code), Entry(entry) {}
177 
178  // =================================================================
179  // Serializable API
180  // =================================================================
181 
183  static constexpr uint16_t min_size = Protocol::Response::min_size
184  + Entry::min_size;
185 
187  uint16_t size() const
188  {
190  }
191 
193  uint16_t pack(Common::ByteArray &array, uint16_t offset = 0) const
194  {
195  HF_SERIALIZABLE_CHECK(array, offset, size());
196 
197  uint16_t start = offset;
198 
199  offset += Protocol::Response::pack(array, offset);
200  offset += Entry::pack(array, offset);
201 
202  return offset - start;
203  }
204 
206  uint16_t unpack(const Common::ByteArray &array, uint16_t offset = 0)
207  {
208  HF_SERIALIZABLE_CHECK(array, offset, size());
209 
210  uint16_t start = offset;
211 
212  offset += Protocol::Response::unpack(array, offset);
213  offset += Entry::unpack(array, offset);
214 
215  return offset - start;
216  }
217  };
218 
223  struct ReadEntries
224  {
225  uint8_t start;
226  uint8_t count;
227 
228  ReadEntries(uint8_t _start = 0, uint8_t _count = 1):
229  start(_start), count(_count) {}
230 
231  // =================================================================
232  // Serializable API
233  // =================================================================
234 
235  static constexpr uint16_t min_size = sizeof(uint8_t)
236  + sizeof(uint8_t);
237 
239  uint16_t size() const
240  {
241  return min_size;
242  }
243 
245  uint16_t pack(Common::ByteArray &array, uint16_t offset = 0) const
246  {
247  HF_SERIALIZABLE_CHECK(array, offset, min_size);
248 
249  offset += array.write(offset, start);
250  offset += array.write(offset, count);
251 
252  return min_size;
253  }
254 
256  uint16_t unpack(const Common::ByteArray &array, uint16_t offset = 0)
257  {
258  HF_SERIALIZABLE_CHECK(array, offset, min_size);
259 
260  offset += array.read(offset, start);
261  offset += array.read(offset, count);
262 
263  return min_size;
264  }
265  };
266 
271  {
272  uint8_t start;
273 
274  std::vector<Entry> entries;
275 
284  uint8_t _start = 0, uint8_t _count = 0):
285  Protocol::Response(_code), start(_start)
286  {
287  entries.reserve(_count);
288  }
289 
290  // =================================================================
291  // Serializable API
292  // =================================================================
293 
295  static constexpr uint16_t min_size = Protocol::Response::min_size
296  + sizeof(uint8_t)
297  + sizeof(uint8_t);
298 
300  uint16_t size() const
301  {
302  uint16_t res = Protocol::Response::size()
303  + sizeof(uint8_t)
304  + sizeof(uint8_t);
305 
306  std::for_each(entries.begin(), entries.end(), [&res](const Entry &entry)
307  {
308  res += entry.size();
309  });
310 
311  return res;
312  }
313 
315  uint16_t pack(Common::ByteArray &array, uint16_t offset = 0) const
316  {
317  HF_SERIALIZABLE_CHECK(array, offset, size());
318 
319  uint16_t _start = offset;
320 
321  offset += Protocol::Response::pack(array, offset);
322 
323  offset += array.write(offset, start);
324  offset += array.write(offset, (uint8_t) entries.size());
325 
326  std::for_each(entries.begin(), entries.end(),
327  [&array, &offset](const Entry &entry)
328  {
329  offset += entry.pack(array, offset);
330  });
331 
332  return offset - _start;
333  }
334 
336  uint16_t unpack(const Common::ByteArray &array, uint16_t offset = 0)
337  {
338  HF_SERIALIZABLE_CHECK(array, offset, min_size);
339 
340  uint16_t _start = offset;
341 
342  offset += Protocol::Response::unpack(array, offset);
343 
344  offset += array.read(offset, start);
345 
346  uint8_t count = 0;
347  offset += array.read(offset, count);
348 
349  HF_SERIALIZABLE_CHECK(array, offset, count * Entry::min_size);
350 
351  entries.reserve(count * Entry::min_size);
352 
353  for (int i = 0; i < count; ++i)
354  {
355  Entry entry;
356  offset += entry.unpack(array, offset);
357  entries.push_back(entry);
358  }
359 
360  return offset - _start;
361  }
362  };
363 
364  // =============================================================================
365  // API
366  // =============================================================================
367 
371  struct IEntries: public Common::IEntries<Entry>
372  {
373  // =============================================================================
374  // API
375  // =============================================================================
376 
380  virtual void clear() = 0;
381 
388  virtual void for_each(uint16_t group,
389  std::function<void(const Entry &)> func) const = 0;
390 
398  virtual Entry const &operator[](uint8_t index) const = 0;
399  };
400 
404  struct Entries: public IEntries
405  {
406  typedef std::vector<Entry> Container;
407 
408  uint16_t size() const;
409 
410  Common::Result save(const Entry &entry);
411 
412  Common::Result destroy(const Entry &entry);
413 
414  void clear();
415 
416  void for_each(uint16_t group, std::function<void(const Entry &)> func) const;
417 
418  Entry const &operator[](uint8_t index) const
419  {
420  return db.at(index);
421  }
422 
423  protected:
424 
434  bool any_of(uint16_t group, uint8_t unit) const;
435 
436  Container db;
437  };
438 
444  struct Base: public Service<HF::Interface::GROUP_TABLE>
445  {
446  protected:
447 
450  };
451 
457  class IServer: public ServiceRole<GroupTable::Base, HF::Interface::SERVER_ROLE>
458  {
459  protected:
460 
463 
464  public:
465 
468  ServiceRole<GroupTable::Base, HF::Interface::SERVER_ROLE>(unit),
469  _number_of_max_entries(std::numeric_limits<uint8_t>::max())
470  {}
471 
473  virtual ~IServer() {}
474 
475  // ======================================================================
476  // Events
477  // ======================================================================
480 
492  virtual Common::Result add(const Protocol::Address &addr, const Entry &entry);
493 
505  virtual Common::Result remove(const Protocol::Address &addr, const Entry &entry);
506 
516  virtual Common::Result remove_all(const Protocol::Address &addr);
517 
528  const ReadEntries &params);
529 
531  // ======================================================================
532 
533  // =============================================================================
534  // Get/Set API.
535  // =============================================================================
536 
542  uint8_t number_of_entries() const;
543 
549  uint8_t number_of_max_entries() const;
550 
556  void number_of_max_entries(uint8_t __value);
557 
558  // =============================================================================
559  // Attribute API.
560  // =============================================================================
561 
563 
564  HF::Attributes::UIDS attributes(uint8_t pack_id =
566 
567  // =============================================================================
568  // Attribute API.
569  // =============================================================================
570 
571  virtual IEntries &entries() const = 0;
572 
573  protected:
574 
576  uint16_t offset);
577 
578 
579  uint16_t payload_size(Protocol::Message::Interface &itf) const;
580  };
581 
582  template<typename _Entries = GroupTable::Entries>
583  class Server: public IServer
584  {
585  public:
586 
588  Server(Unit0 &unit):
589  IServer(unit) {}
590 
591  virtual ~Server() {}
592 
593  IEntries &entries() const
594  {
595  return *(const_cast<_Entries *>(&db));
596  }
597 
598  protected:
599 
600  _Entries db;
601  };
602 
603  typedef Server<> DefaultServer;
604 
610  struct Client: public ServiceRole<GroupTable::Base, HF::Interface::CLIENT_ROLE>
611  {
613 
614  virtual ~Client() {}
615 
616  // ======================================================================
617  // Commands
618  // ======================================================================
621 
629  void add(const Protocol::Address &addr, const Entry &entry);
630 
638  void add(const uint16_t device, const Entry &entry)
639  {
640  Protocol::Address addr(device, 0);
641  add(addr, entry);
642  }
643 
652  void add(const Protocol::Address &addr, uint16_t group, uint8_t unit)
653  {
654  Entry entry(group, unit);
655 
656  add(addr, entry);
657  }
658 
667  void add(const uint16_t device, uint16_t group, uint8_t unit)
668  {
669  Protocol::Address addr(device, 0);
670  Entry entry(group, unit);
671  add(addr, entry);
672  }
673 
681  void remove(const Protocol::Address &addr, const Entry &entry);
682 
690  void remove(const uint16_t device, const Entry &entry)
691  {
692  Protocol::Address addr(device, 0);
693  remove(addr, entry);
694  }
695 
704  void remove(const Protocol::Address &addr, uint16_t group, uint8_t unit)
705  {
706  Entry entry(group, unit);
707 
708  remove(addr, entry);
709  }
710 
719  void remove(const uint16_t device, uint16_t group, uint8_t unit)
720  {
721  Protocol::Address addr(device, 0);
722  Entry entry(group, unit);
723  remove(addr, entry);
724  }
725 
732  void remove_all(const Protocol::Address &addr);
733 
740  void remove_all(uint16_t device)
741  {
742  Protocol::Address addr(device, 0);
743  remove_all(addr);
744  }
745 
753  void read_entries(const Protocol::Address &addr, const ReadEntries &params);
754 
763  void read_entries(const Protocol::Address &addr, const uint8_t offset,
764  const uint8_t count)
765  {
766  ReadEntries params(offset, count);
767 
768  read_entries(addr, params);
769  }
770 
778  void read_entries(const uint16_t device, const ReadEntries &params)
779  {
780  Protocol::Address addr(device, 0);
781  read_entries(addr, params);
782  }
783 
792  void read_entries(const uint16_t device, const uint8_t offset, const uint8_t count)
793  {
794  Protocol::Address addr(device, 0);
795  ReadEntries params(offset, count);
796  read_entries(addr, params);
797  }
798 
800  // ======================================================================
801 
802  // ======================================================================
803  // Events
804  // ======================================================================
807 
814  virtual void added(const Protocol::Address &addr, const GroupTable::Response &response);
815 
822  virtual void removed(const Protocol::Address &addr,
824 
831  virtual void removed_all(const Protocol::Address &addr,
833 
840  virtual void read_entries(const Protocol::Address &addr,
842 
844  // ======================================================================
845 
846  protected:
847 
849  uint16_t offset);
850 
851 
852  uint16_t payload_size(Protocol::Message::Interface &itf) const;
853  };
854 
855  // =============================================================================
856  // Operators
857  // =============================================================================
858 
859  inline bool operator==(const Entry &lhs, const Entry &rhs)
860  {
861  return lhs.group == rhs.group && lhs.unit == rhs.unit;
862  }
863 
864  inline bool operator!=(const Entry &lhs, const Entry &rhs)
865  {
866  return !(lhs == rhs);
867  }
868 
871  } // namespace GroupTable
872 
873  } // namespace Core
874 
875 } // namespace HF
876 
882 // =============================================================================
883 // Stream Helpers
884 // =============================================================================
885 
894 std::ostream &operator<<(std::ostream &stream, const HF::Core::GroupTable::CMD command);
895 
904 std::ostream &operator<<(std::ostream &stream,
905  const HF::Core::GroupTable::Attributes attribute);
908 #endif /* HF_CORE_GROUP_TABLE_H */
IServer(Unit0 &unit)
Constructor.
Definition: group_table.h:467
Entry const & operator[](uint8_t index) const
Retrive the entry at the given index.
Definition: group_table.h:418
Group Table Service : Parent.
Definition: group_table.h:444
static constexpr uint8_t ID
Attribute UID.
Definition: group_table.h:116
uint16_t write(uint16_t offset, uint8_t data)
Write a byte into the array at the given offset.
static constexpr bool WRITABLE
Attribute Read/Write.
Definition: group_table.h:117
bool response(Message::Type type)
Check if message is a response.
std::ostream & operator<<(std::ostream &stream, const HF::Core::GroupTable::CMD command)
Convert the given command into a string and write it to the given stream.
HF::Attributes::IAttribute * create_attribute(uint8_t uid)
Create an attribute object that can hold the attribute with the given uid. (HF::Core::GroupTable::Ser...
void read_entries(const uint16_t device, const uint8_t offset, const uint8_t count)
Send a HAN-FUN message containing a GroupTable::REMOVE_ALL_CMD, to the device with the given address...
Definition: group_table.h:792
This represent the special unit with ID/UID = 0.
Definition: core.h:67
void read_entries(const Protocol::Address &addr, const ReadEntries &params)
Send a HAN-FUN message containing a GroupTable::READ_ENTRIES_CMD, to the given network address...
HF::Attributes::IAttribute * attribute(uint8_t uid)
Return a pointer to the interface attribute with the given uid.
Default implementation of the IEntries API.
Definition: group_table.h:404
uint16_t unpack(const Common::ByteArray &array, uint16_t offset=0)
Read a message from a ByteArray.
Definition: group_table.h:256
CMD
Command IDs.
Definition: group_table.h:62
List of attributes UIDs.
Definition: attributes.h:176
Group Table persistent storage API.
Definition: group_table.h:371
Helper class to handle the Number Of Entries attribute for the Group Table service.
Definition: group_table.h:114
Return all mandatory attributes for the interface.
Definition: attributes.h:842
This file contains the forward declarations of the core services and interfaces implementing classes...
uint16_t pack(Common::ByteArray &array, uint16_t offset=0) const
Write the object on to a ByteArray so it can be sent over the network.
Definition: group_table.h:193
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.
STL namespace.
void remove_all(uint16_t device)
Send a HAN-FUN message containing a GroupTable::REMOVE_ALL_CMD, to the device with the given address...
Definition: group_table.h:740
virtual Entry const & operator[](uint8_t index) const =0
Retrive the entry at the given index.
uint8_t _number_of_max_entries
Number Of Max Entries.
Definition: group_table.h:462
void add(const uint16_t device, const Entry &entry)
Send a HAN-FUN message containing a GroupTable::ADD_CMD, to the given device and the given entry...
Definition: group_table.h:638
Scheduling::Entry< Interval > Entry
Specific part for the Event Scheduler of the HF::Scheduling::Entry.
This class the response for a GroupTable::READ_ENTRIES_CMD command.
Definition: group_table.h:270
static constexpr uint16_t min_size
Minimum pack/unpack required data size.
Definition: group_table.h:94
uint16_t size() const
Number bytes needed to serialize the message.
Definition: group_table.h:300
Helper class to handle the Number Of Max Entries attribute for the Group Table service.
Definition: group_table.h:127
void add(const Protocol::Address &addr, const Entry &entry)
Send a HAN-FUN message containing a GroupTable::ADD_CMD, to the given network address.
uint8_t number_of_max_entries() const
Get the Number Of Max Entries for the Group Table server.
This file contains the definitions for the HAN-FUN protocol messages.
uint16_t unpack(const Common::ByteArray &array, uint16_t offset=0)
Read a message from a ByteArray.
Definition: group_table.h:336
virtual void removed_all(const Protocol::Address &addr, const Protocol::Response &response)
Callback for processing the response of a GroupTable::REMOVE_ALL_CMD.
Group Table Service : Client side implementation.
Definition: group_table.h:610
bool any_of(uint16_t group, uint8_t unit) const
Check if there exists any entry for the group/unit address given.
uint8_t number_of_entries() const
Get the Number Of Entries for the Group Table server.
virtual void removed(const Protocol::Address &addr, const GroupTable::Response &response)
Callback for processing the response of a GroupTable::REMOVE_CMD.
std::vector< Entry > entries
Vector containing the entries in the response.
Definition: group_table.h:274
uint16_t unpack(const Common::ByteArray &array, uint16_t offset=0)
Read a message from a ByteArray.
Definition: group_table.h:206
uint16_t pack(Common::ByteArray &array, uint16_t offset=0) const
Write the object on to a ByteArray so it can be sent over the network.
Definition: group_table.h:245
Group Table Service : Server side implementation.
Definition: group_table.h:457
#define HF_SERIALIZABLE_CHECK(__array, __offset, __size)
Helper macro to check if the given __array has enough size so __size bytes can be written/read from t...
Read Entries command UID.
Definition: group_table.h:67
uint16_t size() const
Number bytes needed to serialize the message.
Remove command UID.
Definition: group_table.h:65
Common::Result handle_command(Protocol::Packet &packet, Common::ByteArray &payload, uint16_t offset)
Handle incoming messages from the network.
void clear()
Clear all entries in database.
Base(Unit0 &unit)
Constructor.
Definition: group_table.h:449
Fail - Unknown reason.
Number Of Entries attribute UID.
Definition: group_table.h:74
uint16_t uid() const
This method returns the interface UID.
Definition: core.h:191
This represents a group table entry data structure.
Definition: group_table.h:82
uint8_t unit
Unit ID to route the group messages to.
Definition: group_table.h:86
HF::Interface const * owner() const
Definition: attributes.h:414
Unit0 & unit() const
The device this unit is associated with.
Definition: core.h:142
uint16_t size() const
Number bytes needed to serialize the message.
Definition: group_table.h:239
virtual ReadEntriesResponse read_entries(const Protocol::Address &addr, const ReadEntries &params)
Callback that is called when a GroupTable::READ_ENTRIES_CMD, is received.
uint16_t pack(Common::ByteArray &array, uint16_t offset=0) const
Write the object on to a ByteArray so it can be sent over the network.
This class represents a byte array.
Number Of Max Entries attribute UID.
Definition: group_table.h:75
uint8_t count
Number of entries to read.
Definition: group_table.h:226
virtual Common::Result add(const Protocol::Address &addr, const Entry &entry)
Callback that is called when a GroupTable::ADD_CMD, is received.
void add(const uint16_t device, uint16_t group, uint8_t unit)
Send a HAN-FUN message containing a GroupTable::ADD_CMD, to the given device, for the given group and...
Definition: group_table.h:667
static constexpr uint16_t min_size
Minimum required data size for pack/unpack.
Definition: group_table.h:295
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...
Group Table interface UID.
Definition: interface.h:69
void for_each(uint16_t group, std::function< void(const Entry &)> func) const
Call the given function for all the entries with given group address.
Network Address.
Definition: protocol.h:201
void add(const Protocol::Address &addr, uint16_t group, uint8_t unit)
Send a HAN-FUN message containing a GroupTable::ADD_CMD, to the given network address, for the given group and unit.
Definition: group_table.h:652
Interface Address.
Definition: protocol.h:93
This class contains the required parameters for a GroupTable::READ_ENTRIES_CMD command.
Definition: group_table.h:223
Container db
Group table entries database.
Definition: group_table.h:436
Base class for responses.
Definition: group_table.h:156
virtual Common::Result remove_all(const Protocol::Address &addr)
Callback that is called when a GroupTable::REMOVE_ALL_CMD, is received.
virtual void for_each(uint16_t group, std::function< void(const Entry &)> func) const =0
Call the given function for all the entries with given group address.
HAN-FUN Protocol Packet.
Definition: protocol.h:298
void read_entries(const uint16_t device, const ReadEntries &params)
Send a HAN-FUN message containing a GroupTable::REMOVE_ALL_CMD, to the device with the given address...
Definition: group_table.h:778
virtual void added(const Protocol::Address &addr, const GroupTable::Response &response)
Callback for processing the response of a GroupTable::ADD_CMD.
Response(Common::Result code, const Entry &entry)
Constructor.
Definition: group_table.h:175
Remove All command %UID.
Definition: group_table.h:66
Interface/Service Attribute API.
Definition: attributes.h:44
Attributes
Attributes.
Definition: group_table.h:72
uint16_t size() const
Number bytes needed to serialize the message.
Definition: group_table.h:187
uint16_t read(uint16_t offset, uint8_t &data) const
Read the byte at offset into data.
uint16_t size() const
Number bytes needed to serialize the message.
Parent class for the response messages.
Definition: protocol.h:368
Class template for all interfaces role implementations.
Definition: core.h:225
static constexpr uint16_t min_size
Minimum pack/unpack required data size.
Definition: group_table.h:183
uint8_t start
Offset to start reading entries from.
Definition: group_table.h:272
Response(Common::Result code=Common::Result::FAIL_UNKNOWN, uint16_t group=0x0000, uint8_t unit=0x00)
Constructor.
Definition: group_table.h:165
static constexpr bool WRITABLE
Attribute Read/Write.
Definition: group_table.h:130
Helper template class to declare an attribute with the given T type.
Definition: attributes.h:349
static constexpr uint8_t ID
Attribute UID.
Definition: group_table.h:129
uint8_t start
Offset to start reading entries from.
Definition: group_table.h:225
Attribute(const uint16_t interface, const uint8_t uid, const HF::Interface *__owner, uint8_t data, bool writable=false)
Attribute template constructor.
Definition: attributes.h:360
static constexpr uint16_t min_size
Minimum number of bytes required by this message.
Definition: protocol.h:375
uint16_t pack(Common::ByteArray &array, uint16_t offset=0) const
Write the object on to a ByteArray so it can be sent over the network.
Definition: group_table.h:315
ReadEntriesResponse(Common::Result _code=Common::Result::OK, uint8_t _start=0, uint8_t _count=0)
Constructor.
Definition: group_table.h:283
Common::Result handle_command(Protocol::Packet &packet, Common::ByteArray &payload, uint16_t offset)
Handle incoming messages from the network.
uint16_t pack(Common::ByteArray &array, uint16_t offset=0) const
Write the object on to a ByteArray so it can be sent over the network.
virtual ~IServer()
Destructor.
Definition: group_table.h:473
Common interface for all Interfaces.
Definition: interface.h:43
uint16_t unpack(const Common::ByteArray &array, uint16_t offset=0)
Read a message from a ByteArray.
void read_entries(const Protocol::Address &addr, const uint8_t offset, const uint8_t count)
Send a HAN-FUN message containing a GroupTable::READ_ENTRIES_CMD, to the given network address...
Definition: group_table.h:763
Class template for all core services implementations.
Definition: core.h:188
uint16_t unpack(const Common::ByteArray &array, uint16_t offset=0)
Read a message from a ByteArray.
uint16_t group
Group address the entry belongs to.
Definition: group_table.h:84
Result
Commands result codes.
uint16_t size() const
Return the number of entries in the container.
HF::Attributes::IAttribute * create_attribute(HF::Core::AttributeReporting::IServer *server, uint8_t uid)
Create an attribute object that can hold the attribute with the given uid.
virtual void clear()=0
Clear all entries in database.
void remove_all(const Protocol::Address &addr)
Send a HAN-FUN message containing a GroupTable::REMOVE_ALL_CMD, to the given network address...
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...
Basic API for persistent storage implementations.
Top-level namespace for the HAN-FUN library.
Definition: attributes.h:22