HAN-FUN API  1.5.3
This project provides the common implementation of ULE Alliance's HAN-FUN application protocol.
HF::Core::SUOTA::Version Struct Reference

Helper class that represents the information of a particular version. More...

#include <suota.h>

+ Inheritance diagram for HF::Core::SUOTA::Version:
+ Collaboration diagram for HF::Core::SUOTA::Version:

Public Member Functions

 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...
 

Data Fields

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...
 

Static Public Attributes

static constexpr uint16_t min_size = 2 * sizeof(uint8_t)
 Minimum pack/unpack required data size.
 

Detailed Description

Helper class that represents the information of a particular version.

Definition at line 91 of file suota.h.

Constructor & Destructor Documentation

◆ Version()

HF::Core::SUOTA::Version::Version ( const std::string  _sw_version = "",
const std::string  _hw_version = "",
const std::string  _url = "" 
)
inline

Constructor.

Parameters
[in]_sw_versionsoftware version string.
[in]_hw_versionhardware version string.
[in]_urlupdate URL string.

Definition at line 104 of file suota.h.

106  :
107  sw_version(_sw_version), hw_version(_hw_version), url(_url)
108  {}
std::string sw_version
Current/Available software version.
Definition: suota.h:93
std::string url
Update URL.
Definition: suota.h:95
std::string hw_version
Current/Minimum required hardware version.
Definition: suota.h:94

Member Function Documentation

◆ pack()

uint16_t HF::Core::SUOTA::Version::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.,

Serializable obj;
ByteArray payload(obj.size());
obj.pack(payload);
Parameters
[in,out]arrayByteArray reference to write the object to.
[in]offsetoffset to start writing to.
Returns
the number of bytes written.

Referenced by HF::Core::SUOTA::CheckVersionResponse::pack().

+ Here is the caller graph for this function:

◆ size()

uint16_t HF::Core::SUOTA::Version::size ( ) const

Number bytes needed to serialize the message.

Returns
number of bytes the message requires to be serialized.

Referenced by HF::Core::SUOTA::CheckVersionResponse::size().

+ Here is the caller graph for this function:

◆ unpack()

uint16_t HF::Core::SUOTA::Version::unpack ( const Common::ByteArray array,
uint16_t  offset = 0 
)

Read a message from a ByteArray.

Parameters
[in]arrayByteArray reference to read the message from.
[in]offsetoffset to start reading from.
Returns
the number of bytes read.

Referenced by HF::Core::SUOTA::CheckVersionResponse::unpack().

+ Here is the caller graph for this function:

Field Documentation

◆ hw_version

std::string HF::Core::SUOTA::Version::hw_version

Current/Minimum required hardware version.

Definition at line 94 of file suota.h.

◆ sw_version

std::string HF::Core::SUOTA::Version::sw_version

Current/Available software version.

Definition at line 93 of file suota.h.

◆ url

std::string HF::Core::SUOTA::Version::url

Update URL.

Definition at line 95 of file suota.h.


The documentation for this struct was generated from the following file: