diff options
-rw-r--r-- | mainloop.cpp | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/mainloop.cpp b/mainloop.cpp index ad73df7..9944e09 100644 --- a/mainloop.cpp +++ b/mainloop.cpp @@ -526,6 +526,20 @@ void MainLoop::read() try { + auto& objInfo = std::get<ObjectInfo>(i.second); + auto& obj = std::get<Object>(objInfo); + + auto it = obj.find(InterfaceType::STATUS); + if (it != obj.end()) + { + auto statusIface = std::experimental::any_cast< + std::shared_ptr<StatusObject>>(it->second); + if (!statusIface->functional()) + { + continue; + } + } + // Retry for up to a second if device is busy // or has a transient error. @@ -539,9 +553,6 @@ void MainLoop::read() value = adjustValue(i.first, value); - auto& objInfo = std::get<ObjectInfo>(i.second); - auto& obj = std::get<Object>(objInfo); - for (auto& iface : obj) { auto valueIface = std::shared_ptr<ValueObject>(); |