Entry field for a given attribute.
More...
#include <attribute_reporting.h>
|
static constexpr uint16_t | min_size |
| Minimum pack/unpack required data size.
|
|
Entry field for a given attribute.
Definition at line 377 of file attribute_reporting.h.
◆ Field()
HF::Core::AttributeReporting::Event::Field::Field |
( |
Type |
_type = COV , |
|
|
uint8_t |
_attr_uid = 0 |
|
) |
| |
|
inline |
Constructor.
- Parameters
-
[in] | _type | field type. |
[in] | _attr_uid | field attribute uid. |
Definition at line 394 of file attribute_reporting.h.
uint8_t attr_uid
Attribute UID.
◆ pack()
uint16_t HF::Core::AttributeReporting::Event::Field::pack |
( |
Common::ByteArray & |
array, |
|
|
uint16_t |
offset, |
|
|
bool |
with_uid |
|
) |
| const |
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] | array | ByteArray reference to write the object to. |
[in] | offset | offset to start writing to. |
- Returns
- the number of bytes written.
- Parameters
-
[in] | with_uid | include attr_uid in the serialization. |
◆ size()
uint16_t HF::Core::AttributeReporting::Event::Field::size |
( |
bool |
with_uid | ) |
const |
Number bytes needed to serialize the message.
- Returns
- number of bytes the message requires to be serialized.
- Parameters
-
[in] | with_uid | if true include attr_uid size in the size calculation. |
◆ unpack()
uint16_t HF::Core::AttributeReporting::Event::Field::unpack |
( |
const Common::ByteArray & |
array, |
|
|
uint16_t |
offset, |
|
|
bool |
with_uid |
|
) |
| |
Read a message from a ByteArray.
- Parameters
-
[in] | array | ByteArray reference to read the message from. |
[in] | offset | offset to start reading from. |
- Returns
- the number of bytes read.
- Warning
- If
with_uid
== true
, then if the value read from the array does not match the attribute's UID, no more data will be read.
- Parameters
-
[in] | with_uid | include uid() size in the calculation. |
The documentation for this struct was generated from the following file: