BeeeOn Gateway  v2020.3.1-2-g6f737dc
Platform to interconnect the IoT world
IQRFJsonResponse.h
1 #pragma once
2 
3 #include "iqrf/IQRFJsonRequest.h"
4 #include "util/Enum.h"
5 
6 namespace BeeeOn {
7 
9 public:
10  typedef Poco::SharedPtr<IQRFJsonResponse> Ptr;
11 
12  struct DpaErrorEnum
13  {
14  enum Raw {
15  STATUS_NO_ERROR,
16  ERROR_FAIL,
17  ERROR_PCMD,
18  ERROR_PNUM,
19  ERROR_ADDR,
20  ERROR_DATA_LEN,
21  ERROR_DATA,
22  ERROR_HWPID,
23  ERROR_NADR,
24  ERROR_IFACE_CUSTOM_HANDLER,
25  ERROR_MISSING_CUSTOM_DPA_HANDLER,
26  ERROR_TIMEOUT,
27  STATUS_CONFIRMATION = 0xFF
28  };
29 
30  static EnumHelper<Raw>::ValueMap &valueMap();
31  };
32 
34 
40  struct RawData {
41  std::string request;
42  std::string requestTs;
43  std::string confirmation;
44  std::string confirmationTs;
45  std::string response;
46  std::string responseTs;
47  };
48 
50 
54  void setResponse(const std::string &response);
55  std::string response() const;
56 
60  void setRawData(const RawData &raw);
61 
65  std::string toString() override;
66 
71  DpaError errorCode() const;
72  void setErrorCode(const DpaError &errCode);
73 
78  void setStatus(const std::string& statString, int statNum);
79 
83  void setGWIdentification(const std::string& identification);
84 
88  void setRequest(const std::string &request) override;
89  std::string request() const override;
90 
91 private:
92  RawData m_rawData;
93 
94  DpaError m_errorCode;
95 
96  std::string m_insId;
97  std::string m_statusStr;
98  int m_status = 0;
99 };
100 
101 }
void setRequest(const std::string &request) override
Definition: IQRFJsonResponse.cpp:49
DpaError errorCode() const
Definition: IQRFJsonResponse.cpp:103
Definition: IQRFJsonResponse.h:12
std::string toString() override
Definition: IQRFJsonResponse.cpp:54
Definition: IQRFJsonResponse.h:8
void setGWIdentification(const std::string &identification)
Definition: IQRFJsonResponse.cpp:34
void setStatus(const std::string &statString, int statNum)
Definition: IQRFJsonResponse.cpp:27
Definition: IQRFJsonRequest.h:7
void setRawData(const RawData &raw)
Definition: IQRFJsonResponse.cpp:39
The structure corresponds to the composition of the field contained within the message data-&gt;raw http...
Definition: IQRFJsonResponse.h:40
std::map< Raw, std::string > ValueMap
Definition: Enum.h:20
void setResponse(const std::string &response)
Definition: IQRFJsonResponse.cpp:22