Fix SHUTDOWN & STARTUP listed as a transition in plugin

This commit is contained in:
Alexey Rybalchenko 2019-07-16 10:54:32 +02:00 committed by Dennis Klein
parent 5256e7c580
commit 63c02657c1
2 changed files with 3 additions and 3 deletions

View File

@ -40,7 +40,7 @@ DDS::DDS(const string& name, const Plugin::Version version, const string& mainta
, fConnectingChans()
, fStopMutex()
, fStopCondition()
, fCommands({ "BIND", "CONNECT", "INIT TASK", "RUN", "STOP", "RESET TASK", "RESET DEVICE", "SHUTDOWN", "STARTUP" })
, fTransitions({ "BIND", "CONNECT", "INIT TASK", "RUN", "STOP", "RESET TASK", "RESET DEVICE" })
, fControllerThread()
, fEvents()
, fEventsMutex()
@ -326,7 +326,7 @@ auto DDS::SubscribeForCustomCommands() -> void
} else {
fDDSCustomCmd.send(id + ": could not queue " + cmd + " transition", to_string(senderId));
}
} else if (fCommands.find(cmd) != fCommands.end()) {
} else if (fTransitions.find(cmd) != fTransitions.end()) {
if (ChangeDeviceState(ToDeviceStateTransition(cmd))) {
fDDSCustomCmd.send(id + ": queued " + cmd + " transition", to_string(senderId));
} else {

View File

@ -89,7 +89,7 @@ class DDS : public Plugin
std::mutex fStopMutex;
std::condition_variable fStopCondition;
const std::set<std::string> fCommands;
const std::set<std::string> fTransitions;
std::thread fControllerThread;
std::queue<DeviceState> fEvents;