BeeeOn Gateway  v2020.3.1-2-g6f737dc
Platform to interconnect the IoT world
GWDeviceListResponse.h
1 #pragma once
2 
3 #include <map>
4 #include <vector>
5 
6 #include <Poco/SharedPtr.h>
7 #include <Poco/JSON/Array.h>
8 #include <Poco/JSON/Object.h>
9 
10 #include "gwmessage/GWResponse.h"
11 #include "model/DeviceID.h"
12 #include "model/ModuleID.h"
13 #include "model/RefreshTime.h"
14 #include "util/Loggable.h"
15 
16 namespace BeeeOn {
17 
54 public:
55  typedef Poco::SharedPtr<GWDeviceListResponse> Ptr;
56 
58  GWDeviceListResponse(const Poco::JSON::Object::Ptr object);
59 
60  void setDevices(const std::vector<DeviceID> &devices);
61 
65  std::vector<DeviceID> devices() const;
66 
67  void setModulesValues(
68  const DeviceID &device,
69  const std::map<ModuleID, double> &values);
70 
74  std::map<ModuleID, double> modulesValues(const DeviceID &device) const;
75 
76  void setRefreshFor(const DeviceID &device, const RefreshTime &refresh);
77  RefreshTime refreshFor(const DeviceID &device) const;
78 
79  void setProperties(
80  const DeviceID &device,
81  const std::map<std::string, std::string> &properties);
82  std::map<std::string, std::string> properties(
83  const DeviceID &device) const;
84 };
85 
86 }
RefreshTime represents time of refreshing values from sensors. E.g. sensors are polled periodically o...
Definition: RefreshTime.h:24
Represents a message sent byt the server to the gateway as a response to the GWDeviceListRequest.
Definition: GWDeviceListResponse.h:53
Definition: Loggable.h:19
std::map< ModuleID, double > modulesValues(const DeviceID &device) const
Definition: GWDeviceListResponse.cpp:68
Represents a response to a request message (subclass of a GWRequest). The GWResponse can be used alon...
Definition: GWResponse.h:55
Definition: DeviceID.h:17
std::vector< DeviceID > devices() const
Definition: GWDeviceListResponse.cpp:32