Skip to content

Commit

Permalink
https://telecominfraproject.atlassian.net/browse/WIFI-13268
Browse files Browse the repository at this point in the history
Signed-off-by: stephb9959 <[email protected]>
  • Loading branch information
stephb9959 committed Jan 4, 2024
1 parent 35aa6fb commit 5756d59
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/AP_WS_LookForUpgrade.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace OpenWifi {
return false;

uint64_t GoodConfig = ConfigurationCache().CurrentConfig(SerialNumberInt_);
std::cout << __LINE__ << ": " << SerialNumber_ << " GoodConfig: " << GoodConfig << " UUID:" << UUID << " Pending:" << State_.PendingUUID << std::endl;
std::cout << __LINE__ << ": " << SerialNumber_ << " INT:" << SerialNumberInt_ << " GoodConfig: " << GoodConfig << " UUID:" << UUID << " Pending:" << State_.PendingUUID << std::endl;
if (GoodConfig && (GoodConfig == UUID || GoodConfig == State_.PendingUUID)) {
UpgradedUUID = UUID;
return false;
Expand Down Expand Up @@ -40,17 +40,19 @@ namespace OpenWifi {
}

Config::Config Cfg(D.Configuration);
if(D.UUID==0 && UUID == Cfg.UUID()) {
// if this is a broken device (UUID==0) just fix it
auto StoredConfigurationUUID = Cfg.UUID();
if(D.UUID==0 && UUID == StoredConfigurationUUID) {
D.UUID = UpgradedUUID = UUID;
Cfg.SetUUID(UUID);
D.Configuration = Cfg.get();
D.pendingUUID = 0;
D.pendingConfiguration.clear();
D.pendingConfigurationCmd.clear();
StorageService()->UpdateDevice(Session, D);
ConfigurationCache().Add(SerialNumberInt_, UUID);
std::cout << __LINE__ << ": " << SerialNumber_ << " GoodConfig: " << GoodConfig << " UUID:" << UUID << " Pending:" << State_.PendingUUID << std::endl;
return false;
}


if (UUID > D.UUID) {
// so we have a problem, the device has a newer config than we have. So we need to
// make sure our config is newer.
Expand Down

0 comments on commit 5756d59

Please sign in to comment.