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

#include <ProtocolBridge.h>

Inheritance diagram for ProtocolBridgeJson:
ProtocolBridge PrfCommonJson

Public Member Functions

 ProtocolBridgeJson ()
 
 ProtocolBridgeJson (const ProtocolBridgeJson &o)
 
 ProtocolBridgeJson (const rapidjson::Value &val)
 
void setNadr (uint16_t nadr)
 
virtual ~ProtocolBridgeJson ()
 
std::string encodeResponse (const std::string &errStr) override
 
- Public Member Functions inherited from ProtocolBridge
 ProtocolBridge ()
 
virtual ~ProtocolBridge ()
 
void commandSysinfo ()
 
void commandGetNewVisible ()
 
void commandGetNewInvisible ()
 
void commandGetAllVisible ()
 
void commandGetNewDataInfo ()
 
void commandGetCompactPacket (uint16_t meterIndex)
 
void commandGetFullPacket (uint16_t meterIndex)
 
void commandGetVisibleConfirmation (uint8_t index, uint8_t map[])
 
void commandGetInvisibleConfirmation (uint8_t index, uint8_t map[])
 
void commandSleepNow (uint16_t sleepTime)
 
void commandDeleteId (uint16_t meterIndex)
 
void commandDeleteAll ()
 
void commandSetSleepInterval (uint16_t sleepInterval)
 
void commandSetWmTimeout (uint16_t wmTimeout)
 
void commandSetWmAllReadedTimeout (uint16_t wmTimeout)
 
void commandSetNodeTimeout (uint16_t nodeTimeout)
 
void commandSetAnyPacketMode (bool enable)
 
void parseResponse (const DpaMessage &response) override
 
void parseCommand (const std::string &command) override
 
const std::string & encodeCommand () const override
 
SysinfoResponse getSysinfoResponse () const
 
NewVisibleMetersResponse getNewVisibleMetersResponse () const
 
NewInvisibleMetersResponse getNewInvisibleMetersResponse () const
 
AllVisibleMetersResponse getAllVisibleMetersResponse () const
 
NewDataInfoResponse getNewDataInfoResponse () const
 
CompactPacketResponse getCompactPacketResponse () const
 
FullPacketResponse getFullPacketResponse () const
 
VisibleConfirmationResponse getVisibleConfirmationResponse () const
 
InvisibleConfirmationResponse getInvisibleConfirmationResponse () const
 
SleepNowResponse getSleepNowResponse () const
 
DeleteIdResponse getDeleteIdResponse () const
 
DeleteAllResponse getDeleteAllResponse () const
 
SetNodeTimeoutResponse getSetNodeTimeoutResponse () const
 
SetAnyPacketModeResponse getSetAnyPacketModeResponse () 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 ProtocolBridge
enum  Cmd {
  Cmd::SYSINFO, Cmd::GET_NEW_VISIBLE, Cmd::GET_NEW_INVISIBLE, Cmd::GET_ALL_VISIBLE,
  Cmd::GET_NEW_DATA_INFO, Cmd::GET_COMPACT_PACKET, Cmd::GET_FULL_PACKET, Cmd::GET_VISIBLE_CONFIRMATION,
  Cmd::GET_INVISIBLE_CONFIRMATION, Cmd::SLEEP_NOW, Cmd::DELETE_ID, Cmd::DELETE_ALL,
  Cmd::SET_SLEEP_INTERVAL, Cmd::SET_WM_TIMEOUT, Cmd::SET_WM_ALL_READED_TIMEOUT, Cmd::SET_NODE_TIMEOUT,
  Cmd::SET_ANY_PACKET_MODE
}
 
enum  FrcCmd { FrcCmd::ALIVE, FrcCmd::STAT }
 
- 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 ProtocolBridge
static const std::string PRF_NAME
 
static const int CONFIRMATION_BITMAP_LEN = 10
 
static const int SYSINFO_SERIAL_NUMBER_LEN = 12
 
static const int SYSINFO_FIRMWARE_VERSION_LEN = 5
 
static const int VISIBLE_METERS_BITMAP_LEN = 38
 
static const int INVISIBLE_METERS_BITMAP_LEN = 38
 
static const int ALL_VISIBLE_METERS_BITMAP_LEN = 38
 
static const int NEW_DATA_INFO_BITMAP_LEN = 38
 
static const int VMBUS_MAX_FRAME_LEN = 45
 
- 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

◆ ProtocolBridgeJson() [1/3]

ProtocolBridgeJson::ProtocolBridgeJson ( )

◆ ProtocolBridgeJson() [2/3]

ProtocolBridgeJson::ProtocolBridgeJson ( const ProtocolBridgeJson o)

◆ ProtocolBridgeJson() [3/3]

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

◆ ~ProtocolBridgeJson()

virtual ProtocolBridgeJson::~ProtocolBridgeJson ( )
inlinevirtual

Member Function Documentation

◆ encodeResponse()

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

◆ setNadr()

void ProtocolBridgeJson::setNadr ( uint16_t  nadr)

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