BeeeOn Gateway  v2020.3.1-2-g6f737dc
Platform to interconnect the IoT world
DeviceSetValueCommand.h
1 #pragma once
2 
3 #include <Poco/Timespan.h>
4 
5 #include "core/PrefixCommand.h"
6 #include "model/DeviceID.h"
7 #include "model/ModuleID.h"
8 #include "model/OpMode.h"
9 
10 namespace BeeeOn {
11 
12 /*
13  * The command to set the value of a particular device.
14  *
15  * When system receives command, the device manager sets
16  * the value of a device identified by DeviceID containing
17  * the module identified by ModuleID. The value has to be
18  * set before timeout expiration. If status of set value
19  * cannot be find and the timeout is expired, device
20  * manager must send message about this failure to server.
21  * The individual states of the settings to which the command
22  * can get need to be reported on server.
23  *
24  */
26 public:
27  typedef Poco::AutoPtr<DeviceSetValueCommand> Ptr;
28 
30  const DeviceID &deviceID,
31  const ModuleID &moduleID,
32  const double value,
33  const OpMode &mode,
34  const Poco::Timespan &timeout);
35 
36  ModuleID moduleID() const;
37  double value() const;
38  Poco::Timespan timeout() const;
39  DeviceID deviceID() const;
40  OpMode mode() const;
41 
42  std::string toString() const override;
43 
44 protected:
46 
47 private:
48  DeviceID m_deviceID;
49  ModuleID m_moduleID;
50  double m_value;
51  OpMode m_mode;
52  Poco::Timespan m_timeout;
53 };
54 
55 }
std::string toString() const override
Definition: DeviceSetValueCommand.cpp:50
Definition: ModuleID.h:12
Ancestor for Commands that are related to a specific DevicePrefix only.
Definition: PrefixCommand.h:12
Definition: DeviceSetValueCommand.h:25
Definition: DeviceID.h:17