Skip to content

Commit

Permalink
Merge pull request #345 from Telecominfraproject/WIFI-13507
Browse files Browse the repository at this point in the history
  • Loading branch information
stephb9959 authored Mar 16, 2024
2 parents 574172b + b77d40f commit 8e44f1e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion build
Original file line number Diff line number Diff line change
@@ -1 +1 @@
93
94
9 changes: 5 additions & 4 deletions src/AP_WS_LookForUpgrade.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ namespace OpenWifi {
return false;

uint64_t GoodConfig = GetCurrentConfigurationID(SerialNumberInt_);
// std::cout << __LINE__ << ": " << SerialNumber_ << " INT:" << SerialNumberInt_ << " GoodConfig: " << GoodConfig << " UUID:" << UUID << " Pending:" << State_.PendingUUID << std::endl;
if (GoodConfig && (GoodConfig == UUID || GoodConfig == State_.PendingUUID)) {
UpgradedUUID = UUID;
State_.PendingUUID = 0;
Expand All @@ -24,16 +23,18 @@ namespace OpenWifi {
return false;
}

// std::cout << "D.pendingUUID: " << D.pendingUUID << " UUID: " << D.UUID << " SerialNumber: " << D.SerialNumber << std::endl;
if(State_.PendingUUID!=0 && UUID==State_.PendingUUID) {
// std::cout << __LINE__ << ": " << SerialNumber_ << " GoodConfig: " << GoodConfig << " UUID:" << UUID << " Pending:" << State_.PendingUUID << std::endl;
// so we sent an upgrade to a device, and now it is completing now...
UpgradedUUID = UUID;
StorageService()->CompleteDeviceConfigurationChange(Session, SerialNumber_);
State_.PendingUUID = 0;
return true;
}
// std::cout << __LINE__ << ": " << SerialNumber_ << " GoodConfig: " << GoodConfig << " UUID:" << UUID << " Pending:" << State_.PendingUUID << " Device:" << D.UUID << std::endl;

// dont upgrade a switch if it does not have a real config. Config will always be more than 20 characters
if (D.DeviceType==Platforms::SWITCH && D.Configuration.size()<20) {
return false;
}

Config::Config Cfg(D.Configuration);
// if this is a broken device (UUID==0) just fix it
Expand Down
7 changes: 4 additions & 3 deletions src/AP_WS_Process_connect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -234,10 +234,11 @@ namespace OpenWifi {
if (Updated) {
StorageService()->UpdateDevice(DbSession_->Session(), DeviceInfo);
}
}

if(!Simulated_) {
uint64_t UpgradedUUID = 0;
LookForUpgrade(DbSession_->Session(), UUID, UpgradedUUID);
if(!Simulated_) {
uint64_t UpgradedUUID = 0;
if (LookForUpgrade(DbSession_->Session(), UUID, UpgradedUUID)) {
State_.UUID = UpgradedUUID;
}
}
Expand Down

0 comments on commit 8e44f1e

Please sign in to comment.