![]() |
HAN-FUN API
1.5.3
This project provides the common implementation of ULE Alliance's HAN-FUN application protocol.
|
API for all UIDs. More...
#include <uids.h>
Public Member Functions | |
virtual uint8_t | type () const =0 |
Type of the UID. More... | |
virtual int | compare (const UID_T &other) const |
Compare the current UID with the given UID. 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... | |
![]() | |
virtual | ~Serializable () |
Destructor. | |
![]() | |
virtual UID_T * | clone () const=0 |
Create a clone object of the object where this method is being called. More... | |
Static Public Attributes | |
static constexpr uint16_t | min_size |
Minimum pack/unpack required data size. | |
|
inlinevirtual |
Compare the current UID with the given UID.
This function returns a value less that 0 if the current UID object order is lower that the given UID, 0 if the UIDs represent the same entity and a value greater that 0 if current UID object is above the given UID.
[in] | other | a pointer to a UID object to compare to. |
<0 | the current UID is lower that the given UID. |
0 | the current UID is the same as given UID. |
>0 | the current UID is greater that the given UID. |
Reimplemented in HF::UID::URI, HF::UID::ByteArray< _Class, _size, _type >, HF::UID::ByteArray< DECT, 5, DECT_UID >, and HF::UID::ByteArray< MAC, 6, MAC_UID >.
Definition at line 88 of file uids.h.
References type().
Referenced by HF::UID::ByteArray< MAC, 6, MAC_UID >::compare(), HF::UID::URI::compare(), and HF::UID::UID::compare().
|
inlinevirtual |
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. |
Implements HF::Common::Serializable.
Reimplemented in HF::UID::URI, HF::UID::ByteArray< _Class, _size, _type >, HF::UID::ByteArray< DECT, 5, DECT_UID >, HF::UID::ByteArray< MAC, 6, MAC_UID >, and HF::UID::NONE.
Definition at line 104 of file uids.h.
References HF_SERIALIZABLE_CHECK, min_size, type(), and HF::Common::ByteArray::write().
Referenced by HF::UID::NONE::pack(), HF::UID::ByteArray< MAC, 6, MAC_UID >::pack(), HF::UID::URI::pack(), and HF::UID::UID::pack().
|
inlinevirtual |
Number bytes needed to serialize the message.
Implements HF::Common::Serializable.
Reimplemented in HF::UID::URI, HF::UID::ByteArray< _Class, _size, _type >, HF::UID::ByteArray< DECT, 5, DECT_UID >, and HF::UID::ByteArray< MAC, 6, MAC_UID >.
Definition at line 98 of file uids.h.
References min_size.
Referenced by HF::UID::URI::size(), HF::UID::UID::size(), and HF::UID::NONE::unpack().
|
pure virtual |
Type of the UID.
Implemented in HF::UID::Abstract< _type >, HF::UID::Abstract< URI_UID >, and HF::UID::Abstract< NONE_UID >.
Referenced by compare(), pack(), HF::UID::UID::type(), and unpack().
|
inlinevirtual |
Read a message from a ByteArray.
[in] | array | ByteArray reference to read the message from. |
[in] | offset | offset to start reading from. |
Implements HF::Common::Serializable.
Reimplemented in HF::UID::URI, HF::UID::ByteArray< _Class, _size, _type >, HF::UID::ByteArray< DECT, 5, DECT_UID >, HF::UID::ByteArray< MAC, 6, MAC_UID >, and HF::UID::NONE.
Definition at line 114 of file uids.h.
References HF_SERIALIZABLE_CHECK, min_size, HF::Common::ByteArray::read(), and type().
Referenced by HF::UID::NONE::unpack(), HF::UID::ByteArray< MAC, 6, MAC_UID >::unpack(), and HF::UID::URI::unpack().