added update check result as global MQTT topic

This commit is contained in:
john30
2017-03-26 18:18:30 +02:00
parent 9831183624
commit db9085233c
4 changed files with 27 additions and 4 deletions
+5
View File
@@ -357,6 +357,11 @@ void MainLoop::run() {
if (result == "200 OK") {
m_updateCheck = message == "" ? "unknown" : message;
logNotice(lf_main, "update check: %s", message.c_str());
if (!dataSinks.empty()) {
for (list<DataSink*>::iterator it = dataSinks.begin(); it != dataSinks.end(); it++) {
(*it)->notifyUpdateCheckResult(message == "OK" ? "" : m_updateCheck);
}
}
} else {
logError(lf_main, "update check error: %s", result.c_str());
}