![]() |
HAN-FUN API
1.5.3
This project provides the common implementation of ULE Alliance's HAN-FUN application protocol.
|
HAN-FUN Protocol Packet. More...
#include <protocol.h>
Public Member Functions | |
Packet (Message &message) | |
Constructor. More... | |
Packet (Address &dst_addr, Message &message, uint8_t unit=BROADCAST_UNIT) | |
Constructor. More... | |
Packet (Address &src_addr, Address &dst_addr, Message &message) | |
Constructor. More... | |
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 | |
Address | source |
Source Address. More... | |
Address | destination |
Destination Address. More... | |
Message | message |
Packet message payload;. | |
Transport::Link * | link |
Link where this packet originated from. | |
Static Public Attributes | |
static constexpr uint16_t | header_min_size |
Minimum pack/unpack required header data size. | |
static constexpr uint16_t | min_size |
Minimum pack/unpack required data size. | |
Definition at line 298 of file protocol.h.
|
inline |
Constructor.
[in] | message | message this packet holds. |
Definition at line 318 of file protocol.h.
|
inline |
Constructor.
[in] | dst_addr | destination device address. |
[in] | message | message to be sent. |
[in] | unit | destination unit for this packet. |
Definition at line 327 of file protocol.h.
Constructor.
[in] | src_addr | source device address for packet. |
[in] | dst_addr | destination device address for packet. |
[in] | message | message payload. |
Definition at line 342 of file protocol.h.
uint16_t HF::Protocol::Packet::pack | ( | Common::ByteArray & | array, |
uint16_t | offset = 0 |
||
) | 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.,
[in,out] | array | ByteArray reference to write the object to. |
[in] | offset | offset to start writing to. |
uint16_t HF::Protocol::Packet::size | ( | ) | const |
Number bytes needed to serialize the message.
uint16_t HF::Protocol::Packet::unpack | ( | const Common::ByteArray & | array, |
uint16_t | offset = 0 |
||
) |
Read a message from a ByteArray.
[in] | array | ByteArray reference to read the message from. |
[in] | offset | offset to start reading from. |
Referenced by HF::Transport::AbstractLayer::receive().
Address HF::Protocol::Packet::destination |
Destination Address.
Definition at line 301 of file protocol.h.
Referenced by HF::Devices::AbstractDevice::to_local().
Address HF::Protocol::Packet::source |
Source Address.
Definition at line 300 of file protocol.h.
Referenced by HF::Devices::AbstractDevice::from_local().