BeeeOn Gateway  v2020.3.1-2-g6f737dc
Platform to interconnect the IoT world
DPAProtocol.h
1 #pragma once
2 
3 #include <list>
4 #include <string>
5 #include <vector>
6 
7 #include <Poco/SharedPtr.h>
8 
9 #include "iqrf/DPAMessage.h"
10 #include "iqrf/DPARequest.h"
11 #include "model/ModuleType.h"
12 #include "model/SensorData.h"
13 
14 namespace BeeeOn {
15 
21 class DPAProtocol {
22 public:
23  typedef Poco::SharedPtr<DPAProtocol> Ptr;
24 
29  struct ProductInfo {
30  const std::string vendorName;
31  const std::string productName;
32  };
33 
34  virtual ~DPAProtocol();
35 
42  virtual DPARequest::Ptr pingRequest(
43  DPAMessage::NetworkAddress address) const = 0;
44 
49  virtual DPARequest::Ptr dpaProductInfoRequest(
50  DPAMessage::NetworkAddress address) const = 0;
51 
59  const std::vector<uint8_t> &msg,
60  uint16_t hwPID) const = 0;
61 
66  virtual DPARequest::Ptr dpaModulesRequest(
67  DPAMessage::NetworkAddress node) const = 0;
68 
72  virtual std::list<ModuleType> extractModules(
73  const std::vector<uint8_t> &message) const = 0;
74 
79  virtual DPARequest::Ptr dpaValueRequest(
80  DPAMessage::NetworkAddress node,
81  const std::list<ModuleType> &type) const = 0;
82 
90  virtual SensorData parseValue(
91  const std::list<ModuleType> &modules,
92  const std::vector<uint8_t> &msg) const = 0;
93 };
94 
95 }
virtual DPARequest::Ptr pingRequest(DPAMessage::NetworkAddress address) const =0
DPA request for detecting that specific device communicates using the same protocols as implemented p...
Vendor and product name for each paired device. It can be filled from IQRF repository or statically f...
Definition: DPAProtocol.h:29
Definition: SensorData.h:20
The class provides interface for obtaining of measured data, for detecting of supported modules that ...
Definition: DPAProtocol.h:21
virtual DPARequest::Ptr dpaValueRequest(DPAMessage::NetworkAddress node, const std::list< ModuleType > &type) const =0
virtual DPARequest::Ptr dpaModulesRequest(DPAMessage::NetworkAddress node) const =0
virtual DPARequest::Ptr dpaProductInfoRequest(DPAMessage::NetworkAddress address) const =0
virtual std::list< ModuleType > extractModules(const std::vector< uint8_t > &message) const =0
virtual ProductInfo extractProductInfo(const std::vector< uint8_t > &msg, uint16_t hwPID) const =0
Obtaining of information from received response on the dpaProductInfoRequest().
virtual SensorData parseValue(const std::list< ModuleType > &modules, const std::vector< uint8_t > &msg) const =0
Obtains measured values from the given byte message. The contents of the message must conform with th...