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

sotauptaneclient: Make reportHwInfo smarter #1434

Merged
merged 1 commit into from
Nov 5, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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