![]() |
HAN-FUN API
1.5.3
This project provides the common implementation of ULE Alliance's HAN-FUN application protocol.
|
Message sent between the concentrator and the nodes. More...
Public Member Functions | |
msg_t (uint16_t primitive=NONE_MSG) | |
Constructor. More... | |
msg_t (uint16_t primitive, HF::Common::ByteArray &data) | |
Constructor. More... | |
uint16_t | size () const |
Number bytes needed to serialize the message. More... | |
uint16_t | pack (HF::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 (HF::Common::ByteArray &array, uint16_t offset=0) |
Read a message from a ByteArray. More... | |
Data Fields | |
uint16_t | nbytes |
Number of bytes in the message. More... | |
uint16_t | primitive |
Message type. More... | |
HF::Common::ByteArray | data |
Message payload. More... | |
Static Public Attributes | |
static constexpr uint16_t | min_size = sizeof(nbytes) + sizeof(primitive) |
Minimum pack/unpack required data size. | |
Message sent between the concentrator and the nodes.
Definition at line 60 of file transport.cpp.
|
inline |
|
inline |
Constructor.
[in] | primitive | message type. |
[in] | data | message payload. |
Definition at line 81 of file transport.cpp.
|
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.,
[in,out] | array | ByteArray reference to write the object to. |
[in] | offset | offset to start writing to. |
Definition at line 95 of file transport.cpp.
References data, HF_SERIALIZABLE_CHECK, primitive, size(), and HF::Common::ByteArray::write().
|
inline |
Number bytes needed to serialize the message.
Definition at line 89 of file transport.cpp.
References data, and min_size.
Referenced by pack().
|
inline |
Read a message from a ByteArray.
[in] | array | ByteArray reference to read the message from. |
[in] | offset | offset to start reading from. |
Definition at line 113 of file transport.cpp.
References data, HF_SERIALIZABLE_CHECK, min_size, nbytes, primitive, and HF::Common::ByteArray::read().
HF::Common::ByteArray msg_t::data |
Message payload.
Definition at line 64 of file transport.cpp.
uint16_t msg_t::nbytes |
Number of bytes in the message.
Definition at line 62 of file transport.cpp.
Referenced by unpack().
uint16_t msg_t::primitive |