Skip to content
This repository has been archived by the owner on May 21, 2024. It is now read-only.

Commit

Permalink
Merge pull request #1434 from doanac/reportHwInfo
Browse files Browse the repository at this point in the history
sotauptaneclient: Make reportHwInfo smarter
  • Loading branch information
lbonn authored Nov 5, 2019
2 parents bae32de + cd65a41 commit 13e8652
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/libaktualizr/primary/sotauptaneclient.cc
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,11 @@ data::InstallationResult SotaUptaneClient::PackageInstallSetResult(const Uptane:
void SotaUptaneClient::reportHwInfo() {
Json::Value hw_info = Utils::getHardwareInfo();
if (!hw_info.empty()) {
http->put(config.tls.server + "/system_info", hw_info);
if (hw_info != last_hw_info_reported) {
if (http->put(config.tls.server + "/system_info", hw_info).isOk()) {
last_hw_info_reported = hw_info;
}
}
} else {
LOG_WARNING << "Unable to fetch hardware information from host system.";
}
Expand Down
1 change: 1 addition & 0 deletions src/libaktualizr/primary/sotauptaneclient.h
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ class SotaUptaneClient {
std::shared_ptr<Bootloader> bootloader;
std::shared_ptr<ReportQueue> report_queue;
Json::Value last_network_info_reported;
Json::Value last_hw_info_reported;
Uptane::EcuMap hw_ids;
std::shared_ptr<event::Channel> events_channel;
boost::signals2::connection conn;
Expand Down

0 comments on commit 13e8652

Please sign in to comment.