5 #include "model/DeviceID.h"
6 #include "model/ModuleID.h"
7 #include "model/ModuleType.h"
8 #include "net/MqttClient.h"
9 #include "net/MACAddress.h"
10 #include "util/Loggable.h"
11 #include "vektiva/VektivaSmarwiStatus.h"
22 typedef Poco::SharedPtr<VektivaSmarwi> Ptr;
26 const std::string &remoteID);
28 std::string remoteID();
31 std::list<ModuleType> moduleTypes()
const;
32 Poco::Net::IPAddress ipAddress();
33 void setIpAddress(
const Poco::Net::IPAddress &ipAddress);
34 std::string productName();
45 MqttClient::Ptr mqttClient);
72 const std::string &remoteId,
73 const std::string &macAddress,
74 const std::string &command);
97 MqttClient::Ptr mqttClient);
105 MqttClient::Ptr mqttClient);
112 const std::string &remoteId,
113 const std::string &macAddress,
114 const std::string &lastSegment);
118 std::string m_remoteID;
120 Poco::Net::IPAddress m_ipAddress;
void requestModifyState(const ModuleID &moduleID, double value, MqttClient::Ptr mqttClient)
Attempts to change status of the device.
Definition: VektivaSmarwi.cpp:158
The class represents a standalone device Smarwi. It allows to communicate with the actual device via ...
Definition: VektivaSmarwi.h:20
Definition: SensorData.h:20
static std::string buildTopicRegex(const std::string &remoteId, const std::string &macAddress, const std::string &lastSegment)
Definition: VektivaSmarwi.cpp:244
static MqttMessage buildMqttMessage(const std::string &remoteId, const std::string &macAddress, const std::string &command)
Constructs an MQTT message with the topic "ion/<remoteId>/%<macAddress>/cmd" and message specified in...
Definition: VektivaSmarwi.cpp:236
static VektivaSmarwiStatus parseStatusResponse(std::string &rcvmsg)
Parses Smarwi's status response to an object which is returned if parsing is successful.
Definition: VektivaSmarwi.cpp:167
SensorData createSensorData(const VektivaSmarwiStatus &smarwiStatus)
Creates Smarwi sensor data to send to registered exporters.
Definition: VektivaSmarwi.cpp:203
Definition: MACAddress.h:8
Definition: MqttMessage.h:7
Definition: ModuleID.h:12
void publishModifyStateCommand(const ModuleID &moduleID, double value, MqttClient::Ptr mqttClient)
Function checks if module id and it's value is valid and if so, publishes a command to change state o...
Definition: VektivaSmarwi.cpp:54
The class represents the status of the Smarwi device. The status information is obtained by MQTT clie...
Definition: VektivaSmarwiStatus.h:11
Definition: Loggable.h:19
Definition: DeviceID.h:17
void confirmStateModification(MqttClient::Ptr mqttClient)
After command to modify state was published, this function waits until the message with correct statu...
Definition: VektivaSmarwi.cpp:106
static DeviceID buildDeviceID(const MACAddress &macAddrStr)
Called internally when constructing the instance. Creates DeviceID based on Mac address of device...
Definition: VektivaSmarwi.cpp:216