BeeeOn Gateway  v2020.3.1-2-g6f737dc
Platform to interconnect the IoT world
DPAResponse.h
1 #pragma once
2 
3 #include <string>
4 
5 #include "iqrf/DPAMessage.h"
6 
7 namespace BeeeOn {
8 
20 class DPAResponse : public DPAMessage {
21 public:
22  typedef Poco::SharedPtr<DPAResponse> Ptr;
23 
24  enum Type {
25  PERIPHERAL_INFO = 0x80,
26  BONDED_NODES = 0x82,
27  BOND_NODE = 0x84,
28  REMOVE_NODE = 0x85,
29  };
30 
35  void setErrorCode(uint8_t errCode);
36  uint8_t errorCode() const;
37 
38  void setDPAValue(uint8_t dpaValue);
39  uint8_t dpaValue() const;
40 
45  virtual std::string toDPAString() const override;
46 
50  static DPAResponse::Ptr fromRaw(const std::string &data);
51 
52 protected:
53  DPAResponse();
54 
56  DPAMessage::NetworkAddress node,
57  uint8_t pNumber,
58  uint8_t pCommand,
59  uint16_t hwPID,
60  const std::vector<uint8_t> &pData,
61  uint8_t errorCode,
62  uint8_t dpaValue
63  );
64 
65 private:
66  uint8_t m_errorCode;
67  uint8_t m_dpaValue;
68 };
69 
70 }
The class represents DPA message that can be sent/received from IQRF network.
Definition: DPAMessage.h:22
virtual std::string toDPAString() const override
Converts the header items and peripheral data to string that is divided by dots.
Definition: DPAResponse.cpp:123
void setErrorCode(uint8_t errCode)
Definition: DPAResponse.cpp:38
static DPAResponse::Ptr fromRaw(const std::string &data)
Parses given message into general or specific response.
Definition: DPAResponse.cpp:58
Each response contains a header with:
Definition: DPAResponse.h:20