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

#include <PrfPulseMeter.h>

Inheritance diagram for PrfPulseMeterJson:
PrfPulseMeter PrfCommonJson

Public Member Functions

 PrfPulseMeterJson ()
 
 PrfPulseMeterJson (const PrfPulseMeterJson &o)
 
 PrfPulseMeterJson (const rapidjson::Value &val)
 
void setNadr (uint16_t nadr)
 
virtual ~PrfPulseMeterJson ()
 
std::string encodeResponse (const std::string &errStr) override
 
- Public Member Functions inherited from PrfPulseMeter
 PrfPulseMeter ()
 
virtual ~PrfPulseMeter ()
 
void commandReadCounters (const std::chrono::seconds &sec)
 
void commandStoreCounter (CntNum cntNum, uint32_t value)
 
void commandDisableAutosleep (bool enable)
 
void parseResponse (const DpaMessage &response) override
 
void parseCommand (const std::string &command) override
 
const std::string & encodeCommand () const override
 
uint8_t getThermometerType () const
 
double getTemperature () const
 
uint8_t getPowerVoltageType () const
 
double getPowerVoltage () const
 
double getIqrfSuplyVoltage () const
 
int getRssi () const
 
int getCntLen () const
 
int getCnts () const
 
int getCounter (CntNum cntNum) const
 
uint8_t getCntSum () const
 
uint8_t getDataSum () const
 
bool getStoreCounterResult () const
 
bool getDisableAutosleepResult () const
 
Cmd getCmd () const
 
- 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 Types inherited from PrfPulseMeter
enum  Cmd { Cmd::READ_COUNTERS = 0, Cmd::STORE_COUNTER = 1, Cmd::DISABLE_AUTO_SLEEP = 2 }
 
enum  FrcCmd { FrcCmd::ALIVE = 0, FrcCmd::ALIVE_STOP_AUTOSLEEP = 1, FrcCmd::ALIVE_START_AUTOSLEEP = 2 }
 
enum  CntNum { CntNum::CNT_1 = 1, CntNum::CNT_2 = 2 }
 
- 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
 
- Static Public Attributes inherited from PrfPulseMeter
static const std::string PRF_NAME
 
- 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...
 

Constructor & Destructor Documentation

◆ PrfPulseMeterJson() [1/3]

PrfPulseMeterJson::PrfPulseMeterJson ( )

◆ PrfPulseMeterJson() [2/3]

PrfPulseMeterJson::PrfPulseMeterJson ( const PrfPulseMeterJson o)

◆ PrfPulseMeterJson() [3/3]

PrfPulseMeterJson::PrfPulseMeterJson ( const rapidjson::Value &  val)

◆ ~PrfPulseMeterJson()

virtual PrfPulseMeterJson::~PrfPulseMeterJson ( )
inlinevirtual

Member Function Documentation

◆ encodeResponse()

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

◆ setNadr()

void PrfPulseMeterJson::setNadr ( uint16_t  nadr)

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