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

List of attributes UIDs. More...

#include <attributes.h>

Inherits std::vector< T >.

+ Collaboration diagram for HF::Attributes::UIDS:

Public Member Functions

 UIDS (std::initializer_list< uint8_t > uids)
 Constructor. More...
 
vector< uint8_t >::size_type length () const
 Number of elements in the list. More...
 
uint16_t unpack (const Common::ByteArray &array, uint16_t offset, uint8_t &count)
 Read a message from a ByteArray. More...
 

Static Public Attributes

static constexpr uint8_t min_size = sizeof(uint8_t)
 Minimum pack/unpack required data size.
 

Detailed Description

List of attributes UIDs.

Definition at line 176 of file attributes.h.

Constructor & Destructor Documentation

◆ UIDS()

HF::Attributes::UIDS::UIDS ( std::initializer_list< uint8_t >  uids)
inline

Constructor.

Parameters
[in]uidsattributes UIDs list.

Definition at line 186 of file attributes.h.

186  : vector<uint8_t>(uids)
187  {}

Member Function Documentation

◆ length()

vector<uint8_t>::size_type HF::Attributes::UIDS::length ( ) const
inline

Number of elements in the list.

Note
this is used as an alias to the underling method, std::vector<uint8_t>::size, as the size method signature is used to provide a Serializable type interface.
Returns
number of elements.

Definition at line 198 of file attributes.h.

199  {
200  return vector<uint8_t>::size();
201  }

◆ unpack()

uint16_t HF::Attributes::UIDS::unpack ( const Common::ByteArray array,
uint16_t  offset,
uint8_t &  count 
)
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.
Parameters
[out]countreference to a variable that will hold the count value read from the array.

Definition at line 244 of file attributes.h.

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

245  {
246  HF_SERIALIZABLE_CHECK(array, offset, min_size);
247 
248  uint16_t start = offset;
249 
250  offset += array.read(offset, count);
251 
252  HF_SERIALIZABLE_CHECK(array, offset, count);
253 
254  vector<uint8_t>::reserve(count);
255 
256  for (uint8_t i = 0; i < count; i++)
257  {
258  uint8_t uid;
259  offset += array.read(offset, uid);
260  vector<uint8_t>::push_back(uid);
261  }
262 
263  return offset - start;
264  }
static constexpr uint8_t min_size
Minimum pack/unpack required data size.
Definition: attributes.h:204
#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...
+ Here is the call graph for this function:

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