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 5, 2024
1 parent 52123f7 commit ffe86a3
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 12 deletions.
2 changes: 1 addition & 1 deletion build
Original file line number Diff line number Diff line change
@@ -1 +1 @@
66
68
18 changes: 8 additions & 10 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 = GetCurrentConfigurationID(SerialNumberInt_);
std::cout << __LINE__ << ": " << SerialNumber_ << " INT:" << SerialNumberInt_ << " 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;
State_.PendingUUID = 0;
Expand All @@ -24,18 +24,16 @@ namespace OpenWifi {
return false;
}



std::cout << "D.pendingUUID: " << D.pendingUUID << " UUID: " << D.UUID << " SerialNumber: " << D.SerialNumber << std::endl;
// 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;
// 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;
// std::cout << __LINE__ << ": " << SerialNumber_ << " GoodConfig: " << GoodConfig << " UUID:" << UUID << " Pending:" << State_.PendingUUID << " Device:" << D.UUID << std::endl;

Config::Config Cfg(D.Configuration);
// if this is a broken device (UUID==0) just fix it
Expand All @@ -52,7 +50,7 @@ namespace OpenWifi {
D.pendingConfigurationCmd.clear();
StorageService()->UpdateDevice(Session, D);
SetCurrentConfigurationID(SerialNumberInt_, UUID);
std::cout << __LINE__ << ": " << SerialNumber_ << " GoodConfig: " << GoodConfig << " UUID:" << UUID << " Pending:" << State_.PendingUUID << std::endl;
// std::cout << __LINE__ << ": " << SerialNumber_ << " GoodConfig: " << GoodConfig << " UUID:" << UUID << " Pending:" << State_.PendingUUID << std::endl;
return false;
}

Expand All @@ -61,7 +59,7 @@ namespace OpenWifi {
// make sure our config is newer.
D.UUID = UUID + 2;
UpgradedUUID = D.UUID;
std::cout << __LINE__ << ": " << SerialNumber_ << " GoodConfig: " << GoodConfig << " UUID:" << UUID << " Pending:" << State_.PendingUUID << std::endl;
// std::cout << __LINE__ << ": " << SerialNumber_ << " GoodConfig: " << GoodConfig << " UUID:" << UUID << " Pending:" << State_.PendingUUID << std::endl;
}

Cfg.SetUUID(D.UUID);
Expand Down Expand Up @@ -103,8 +101,8 @@ namespace OpenWifi {
Notification.content.newUUID = UpgradedUUID;
GWWebSocketNotifications::DeviceConfigurationChange(Notification);

std::cout << __LINE__ << ": " << SerialNumber_ << " GoodConfig: " << GoodConfig << " UUID:" << UUID <<
" Pending:" << State_.PendingUUID << " Upgraded:" << UpgradedUUID << std::endl;
// std::cout << __LINE__ << ": " << SerialNumber_ << " GoodConfig: " << GoodConfig << " UUID:" << UUID <<
// " Pending:" << State_.PendingUUID << " Upgraded:" << UpgradedUUID << std::endl;

return true;
}
Expand Down
1 change: 0 additions & 1 deletion src/CommandManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ namespace OpenWifi {
CompleteTelemetryCommand(RPC->second, Payload,
rpc_execution_time);
} else if (RPC->second.Command == APCommands::Commands::configure && RPC->second.rpc_entry==nullptr) {
std::cout << "Complete configure command: " << SerialNumberStr << std::endl;
CompleteConfigureCommand(RPC->second, Payload,
rpc_execution_time);
} else {
Expand Down

0 comments on commit ffe86a3

Please sign in to comment.