Vektiva device manager provides an easy way to manage devices that are compatible with implemented interface. In the current state it's Smarwi windows maintainer.
More...
|
AsyncWork::Ptr | startDiscovery (const Poco::Timespan &timeout) override |
| Starts device discovery process in a technology-specific way. This method is always called inside a critical section and so its implementation does not have to be thread-safe nor reentrant (unless it cooperates with other threads itself). More...
|
|
AsyncWork< std::set< DeviceID >
>::Ptr | startUnpair (const DeviceID &id, const Poco::Timespan &) override |
| Starts device unpair process in a technology-specific way. This method is always called inside a critical section and so its implementation does not have to be thread-safe nor reentrant (unless it cooperates with other threads itself). More...
|
|
AsyncWork< double >::Ptr | startSetValue (const DeviceID &id, const ModuleID &module, const double value, const Poco::Timespan &) override |
| Starts set-value operation in a technology specific way. The method is always called inside a critical section and so its implementation does not have to be thread-save nor reentrant (unless it cooperates with other threads itself). More...
|
|
void | handleAccept (const DeviceAcceptCommand::Ptr cmd) override |
| Generic handler of the DeviceAcceptCommand. It might be helpful to override this method in case we need to make some technology-specific check of the device to be accepted. The default implementation simply marks the given device as paired.
|
|
bool | updateDevice (VektivaSmarwi::Ptr newDevice) |
| New device is being processed. If true is returned, NewDeviceCommand can be dispatched. More...
|
|
void | modifyValue (const DeviceID &deviceID, const ModuleID &moduleID, const double value) |
| Finds a device with the corresponding device ID and attempts to change the state of the selected module ID. More...
|
|
void | statusMessageAction (MqttMessage &mqttMessage) |
| Groups all actions that are done when "status" message is received. More...
|
|
void | onlineMessageAction (MqttMessage &mqttMessage) |
| Groups all actions that are done when "online" message is received. More...
|
|
void | clearMqttMessageBuffer () |
| Clears all messages buffered in the MQTT client to assure there are no previous messages when attempting to contact a device.
|
|
void | analyzeMessage (MqttMessage &mqttMessage) |
| Parses the received message and according to its' content, correct actions are performed. More...
|
|
MqttMessage | messageReceivedInTime (const std::string &lastSegment, VektivaSmarwi::Ptr device) |
| Waits for a specified amount of time for a message with the last segment of the topic equal to lastSegment argument and device properties. More...
|
|
void | shipSmarwiStatus (const DeviceID &deviceId, const VektivaSmarwiStatus &smarwiStatus) |
| Sends Smarwi status to the exporters. More...
|
|
void | dispatchNewDevice (VektivaSmarwi::Ptr device) |
| Dispatches NewDeviceCommand. More...
|
|
bool | receiveStatusMessageAndUpdate (VektivaSmarwi::Ptr device) |
| When status message is updated, info is parsed and device pointer passed in argument is updated with info from the message. More...
|
|
void | updateDeviceInfo (VektivaSmarwi::Ptr device, const VektivaSmarwiStatus &smarwiStatus) |
| Function to update any relevant info that can be updated (e.g. IP address) More...
|
|
bool | isTopicValid (const std::string &topic, const std::string &lastSegment, const std::string &remoteId="", const std::string &macAddr="") |
| Function to validate topic in received message Last two parameters are optional and can either specify the exact Remote ID and MAC address or if left blank, they'll check for rules that topic have to have. More...
|
|
std::pair< std::string,
std::string > | retrieveDeviceInfoFromTopic (const std::string &topic) |
| Exctracts Remote ID and MAC address from MQTT message' topic. More...
|
|
void | escapeRegexString (std::string ®exString) |
| Escapes inputted string from regex control characters. More...
|
|
std::set< DeviceID > | waitRemoteStatus (const Poco::Timespan &timeout) |
| Wait until the remote status is delivered or timeout exceeds. DO NOT USE this method, it is intended as a transition mechanism from calling of the deprecated method deviceList(). More...
|
|
virtual void | handleGeneric (const Command::Ptr cmd, Result::Ptr result) |
|
void | handleListen (const GatewayListenCommand::Ptr cmd) |
| Implements handling of the listen command in a generic way. The method ensures that only 1 thread can execute the discovery process at a time. More...
|
|
virtual AsyncWork::Ptr | startSearch (const Poco::Timespan &timeout, const Poco::Net::IPAddress &address) |
| Start searching a device by IP address in a technology-specific way. This method is always called inside a critical section and so its implementation does not have to be thread-safe nor reentrant (unless it cooperates with other threads itself). More...
|
|
virtual AsyncWork::Ptr | startSearch (const Poco::Timespan &timeout, const MACAddress &address) |
| Start searching a device by MAC address in a technology-specific way. This method is always called inside a critical section and so its implementation does not have to be thread-safe nor reentrant (unless it cooperates with other threads itself). More...
|
|
virtual AsyncWork::Ptr | startSearch (const Poco::Timespan &timeout, const uint64_t serialNumber) |
| Start searching a device by serial number in a technology-specific way. This method is always called inside a critical section and so its implementation does not have to be thread-safe nor reentrant (unless it cooperates with other threads itself). More...
|
|
void | handleSearch (const DeviceSearchCommand::Ptr cmd) |
| Implements handling of the search command in a generic way. The method ensures that only 1 thread can exactly the search process at a time. It is also mutual exclusive to the discovery process.
|
|
std::set< DeviceID > | handleUnpair (const DeviceUnpairCommand::Ptr cmd) |
| Implements handling of the unpair command in a generic way. The method ensures that only 1 thread can execute the unpair process at a time. More...
|
|
AsyncWork< double >::Ptr | startSetValueByMode (const DeviceID &id, const ModuleID &module, const double value, const OpMode &mode, const Poco::Timespan &timeout) |
| Call an implementation of startSetValue() based on the given operation mode.
|
|
virtual AsyncWork< double >::Ptr | startSetValueTryHarder (const DeviceID &id, const ModuleID &module, const double value, const Poco::Timespan &timeout) |
| Default implementation just calls startSetValue().
|
|
virtual AsyncWork< double >::Ptr | startSetValueRepeatOnFail (const DeviceID &id, const ModuleID &module, const double value, const Poco::Timespan &timeout) |
| Default implementation calls startSetValue() again if a Poco::IOException is thrown until timeout exceeds. However, due to asynchronous behaviour, this way of repeating on fail might be inappropriate.
|
|
void | handleSetValue (const DeviceSetValueCommand::Ptr cmd) |
| Implements handling of the set-value command in a generic way. The method ensures that only 1 thread can execute set-value process at a time. If the set-value operation succeeds, it ships the set value. More...
|
|
void | ship (const SensorData &sensorData) |
|
DeviceCache::Ptr | deviceCache () const |
|
CancellableSet & | cancellable () |
|
Poco::Timespan | checkDelayedOperation (const std::string &opname, const Poco::Clock &started, const Poco::Timespan &duration) const |
| When starting an asynchronous operation, it might happen we sleep too long on a lock because the previous operation did not finished yet. This method performs such checks and also tests for global stop request. If everything is in order it just fixes the duration by the time elapsed by waiting. Otherwise, it throws an exception. More...
|
|
bool | manageUntilFinished (const std::string &opname, AnyAsyncWork::Ptr work, const Poco::Timespan &timeout) |
| Manage an AsyncWork after it is started. If it does not finish in the given timeout, it is cancelled explicitly. More...
|
|
void | setupLogger (Poco::Logger *logger=0) const |
|
Poco::Logger & | logger () const |
|
| Loggable (const ClassInfo &info) |
|
| Loggable (const std::type_info &info) |
|
Vektiva device manager provides an easy way to manage devices that are compatible with implemented interface. In the current state it's Smarwi windows maintainer.