![]() |
HAN-FUN API
1.5.3
This project provides the common implementation of ULE Alliance's HAN-FUN application protocol.
|
This class represents the message for the response of a SUOTA::CHECK_VERSION_CMD
.
More...
#include <suota.h>
Public Types | |
enum | Status { VERSION_AVAILABLE = 0x00, NO_VERSION_AVAILABLE = 0x11, FAIL_INFRASTUCTURE = 0x12, FAIL_UNKNOWN = Common::FAIL_UNKNOWN } |
Possible result codes for a SUOTA::CHECK_VERSION_CMD. More... | |
Public Member Functions | |
CheckVersionResponse (Status _status=FAIL_UNKNOWN, const std::string _sw_version="", const std::string _hw_version="", const std::string _url="") | |
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... | |
![]() | |
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... | |
![]() | |
Version (const std::string _sw_version="", const std::string _hw_version="", const std::string _url="") | |
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... | |
Static Public Attributes | |
static constexpr uint16_t | min_size = Protocol::Response::min_size + Version::min_size |
Minimum pack/unpack required data size. | |
![]() | |
static constexpr uint16_t | min_size = sizeof(uint8_t) |
Minimum number of bytes required by this message. | |
![]() | |
static constexpr uint16_t | min_size = 2 * sizeof(uint8_t) |
Minimum pack/unpack required data size. | |
Additional Inherited Members | |
![]() | |
std::string | sw_version |
Current/Available software version. More... | |
std::string | hw_version |
Current/Minimum required hardware version. More... | |
std::string | url |
Update URL. More... | |
This class represents the message for the response of a SUOTA::CHECK_VERSION_CMD
.
Possible result codes for a SUOTA::CHECK_VERSION_CMD.
Enumerator | |
---|---|
VERSION_AVAILABLE | New version available. |
NO_VERSION_AVAILABLE | No newer version available. |
FAIL_INFRASTUCTURE | Server or Network are down. |
FAIL_UNKNOWN | Fail: Unknown Error. |
Definition at line 132 of file suota.h.
|
inline |
Constructor.
[in] | _status | response status to send (M) |
[in] | _sw_version | software version to send (M) |
[in] | _hw_version | hardware version to send (M) |
[in] | _url | update URL (O) |
Definition at line 148 of file suota.h.
|
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 166 of file suota.h.
References HF_SERIALIZABLE_CHECK, HF::Core::SUOTA::Version::pack(), HF::Protocol::Response::pack(), and size().
|
inline |
Number bytes needed to serialize the message.
Definition at line 160 of file suota.h.
References HF::Core::SUOTA::Version::size(), and HF::Protocol::Response::size().
Referenced by pack(), and unpack().
|
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 179 of file suota.h.
References HF_ASSERT, HF_SERIALIZABLE_CHECK, min_size, size(), HF::Core::SUOTA::Version::unpack(), and HF::Protocol::Response::unpack().