IQRF Gateway Daemon
Public Member Functions | List of all members
PrfThermometerJson Class Reference

Parse/encode JSON message holding PrfThermometer. More...

#include <JsonSerializer.h>

Inheritance diagram for PrfThermometerJson:
PrfCommonJson

Public Member Functions

 PrfThermometerJson (const rapidjson::Value &val)
 parametric constructor More...
 
virtual ~PrfThermometerJson ()
 
std::string encodeResponse (const std::string &errStr) override
 DpaTask overriden method. More...
 
- Public Member Functions inherited from PrfCommonJson
int parseBinary (uint8_t *to, const std::string &from, int maxlen)
 Parse binary data encoded hexa. More...
 
template<typename T >
void parseHexaNum (T &to, const std::string &from)
 Parse templated ordinary type T encoded hexa. More...
 
void encodeHexaNum (std::string &to, uint8_t from)
 Encode uint_8 to hexa string. More...
 
void encodeHexaNum (std::string &to, uint16_t from)
 Encode uint_16 to hexa string. More...
 
void encodeBinary (std::string &to, const uint8_t *from, int len)
 Encode binary data to hexa string. More...
 
void encodeTimestamp (std::string &to, std::chrono::time_point< std::chrono::system_clock > from)
 Encode timestamp. More...
 

Additional Inherited Members

- Public Attributes inherited from PrfCommonJson
bool m_has_ctype = false
 various flags to store presence of members of DPA request to be used in DPA response More...
 
bool m_has_type = false
 
bool m_has_nadr = false
 
bool m_has_hwpid = false
 
bool m_has_timeout = false
 
bool m_has_msgid = false
 
bool m_has_request = false
 
bool m_has_request_ts = false
 
bool m_has_response = false
 
bool m_has_response_ts = false
 
bool m_has_confirmation = false
 
bool m_has_confirmation_ts = false
 
bool m_has_cmd = false
 
bool m_has_rcode = false
 
bool m_has_rdata = false
 
bool m_has_dpaval = false
 
std::string m_ctype
 various flags to store members of DPA request to be used in DPA response More...
 
std::string m_type
 
std::string m_nadr = "0"
 
std::string m_hwpid = "0xffff"
 
int m_timeoutJ = 0
 
std::string m_msgid
 
std::string m_requestJ
 
std::string m_request_ts
 
std::string m_responseJ
 
std::string m_response_ts
 
std::string m_confirmationJ
 
std::string m_confirmation_ts
 
std::string m_cmdJ
 
std::string m_statusJ
 
std::string m_rcodeJ
 
std::string m_rdataJ
 
std::string m_dpavalJ
 
rapidjson::Document m_doc
 
bool m_dotNotation = true
 
- Protected Member Functions inherited from PrfCommonJson
 PrfCommonJson ()
 
 PrfCommonJson (const PrfCommonJson &o)
 
void parseRequestJson (const rapidjson::Value &val, DpaTask &dpaTask)
 Parse common items. More...
 
void addResponseJsonPrio1Params (const DpaTask &dpaTask)
 Encode begining members of JSON. More...
 
void addResponseJsonPrio2Params (const DpaTask &dpaTask)
 Encode middle members of JSON. More...
 
std::string encodeResponseJsonFinal (const DpaTask &dpaTask)
 Encode final members of JSON and return it. More...
 

Detailed Description

Parse/encode JSON message holding PrfThermometer.

Class to be passed to parser as creator of PrfThermometer object from incoming JSON. It will be probably reimplemented. See: https://github.com/iqrfsdk/iqrf-daemon/wiki/JsonStructureDpa-v1#predefined-embedded-perifery-types

Constructor & Destructor Documentation

◆ PrfThermometerJson()

PrfThermometerJson::PrfThermometerJson ( const rapidjson::Value &  val)
explicit

parametric constructor

Parameters
[in]valJSON to be parsed

◆ ~PrfThermometerJson()

virtual PrfThermometerJson::~PrfThermometerJson ( )
inlinevirtual

Member Function Documentation

◆ encodeResponse()

std::string PrfThermometerJson::encodeResponse ( const std::string &  errStr)
override

DpaTask overriden method.

Parameters
[in]errStrresult of DpaTask handling in IQRF mesh to be stored in message
Returns
encoded message

The documentation for this class was generated from the following files: