HAN-FUN API  1.5.3
This project provides the common implementation of ULE Alliance's HAN-FUN application protocol.
HF::Core::GroupTable::ReadEntries Struct Reference

This class contains the required parameters for a GroupTable::READ_ENTRIES_CMD command. More...

#include <group_table.h>

+ Collaboration diagram for HF::Core::GroupTable::ReadEntries:

Public Member Functions

uint16_t size () const
 Number bytes needed to serialize the message. More...
 
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. More...
 
uint16_t unpack (const Common::ByteArray &array, uint16_t offset=0)
 Read a message from a ByteArray. More...
 

Data Fields

uint8_t start
 Offset to start reading entries from. More...
 
uint8_t count
 Number of entries to read. More...
 

Detailed Description

This class contains the required parameters for a GroupTable::READ_ENTRIES_CMD command.

Definition at line 223 of file group_table.h.

Member Function Documentation

◆ pack()

uint16_t HF::Core::GroupTable::ReadEntries::pack ( Common::ByteArray array,
uint16_t  offset = 0 
) const
inline

Write the object on to a ByteArray so it can be sent over the network.

The buffer passed in MUST have enough size to hold the serialized object, e.g.,

Serializable obj;
ByteArray payload(obj.size());
obj.pack(payload);
Parameters
[in,out]arrayByteArray reference to write the object to.
[in]offsetoffset to start writing to.
Returns
the number of bytes written.

Definition at line 245 of file group_table.h.

References count, HF_SERIALIZABLE_CHECK, start, and HF::Common::ByteArray::write().

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  }
#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...
uint8_t count
Number of entries to read.
Definition: group_table.h:226
uint8_t start
Offset to start reading entries from.
Definition: group_table.h:225
+ Here is the call graph for this function:

◆ size()

uint16_t HF::Core::GroupTable::ReadEntries::size ( ) const
inline

Number bytes needed to serialize the message.

Returns
number of bytes the message requires to be serialized.

Definition at line 239 of file group_table.h.

240  {
241  return min_size;
242  }

◆ unpack()

uint16_t HF::Core::GroupTable::ReadEntries::unpack ( const Common::ByteArray array,
uint16_t  offset = 0 
)
inline

Read a message from a ByteArray.

Parameters
[in]arrayByteArray reference to read the message from.
[in]offsetoffset to start reading from.
Returns
the number of bytes read.

Definition at line 256 of file group_table.h.

References count, HF_SERIALIZABLE_CHECK, HF::Common::ByteArray::read(), and start.

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  }
#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...
uint8_t count
Number of entries to read.
Definition: group_table.h:226
uint8_t start
Offset to start reading entries from.
Definition: group_table.h:225
+ Here is the call graph for this function:

Field Documentation

◆ count

uint8_t HF::Core::GroupTable::ReadEntries::count

Number of entries to read.

Definition at line 226 of file group_table.h.

Referenced by pack(), and unpack().

◆ start

uint8_t HF::Core::GroupTable::ReadEntries::start

Offset to start reading entries from.

Definition at line 225 of file group_table.h.

Referenced by pack(), and unpack().


The documentation for this struct was generated from the following file: