From 7f07629512408330ede1a9a9ddbb21cdc0171f3c Mon Sep 17 00:00:00 2001 From: Thomas Wiedebusch Date: Tue, 21 Oct 2025 13:22:45 +0200 Subject: [PATCH] GenesisMeter: - BUGFIX: Offline Password Handling --- Common/Common.sln.DotSettings | 1 + .../WaterMeter/Genesis/GenesisCore/GenesisMeter.cs | 14 +++++++++++--- Common/LaaPackages | 2 +- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/Common/Common.sln.DotSettings b/Common/Common.sln.DotSettings index ac891ef0..9421a131 100644 --- a/Common/Common.sln.DotSettings +++ b/Common/Common.sln.DotSettings @@ -63,6 +63,7 @@ True True True + True True True True diff --git a/Common/Hardware/WaterMeter/Genesis/GenesisCore/GenesisMeter.cs b/Common/Hardware/WaterMeter/Genesis/GenesisCore/GenesisMeter.cs index a3ac134b..a2108335 100644 --- a/Common/Hardware/WaterMeter/Genesis/GenesisCore/GenesisMeter.cs +++ b/Common/Hardware/WaterMeter/Genesis/GenesisCore/GenesisMeter.cs @@ -1224,6 +1224,9 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore /// /// - Optional the offline passwords will be used. /// + /// + /// - BUGFIX: Avoid request of password from DB if offline password usage fored. + /// private String GetPassword() { // without PCB ID it is not possible to login, @@ -1241,8 +1244,9 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore } } - // on unknown password try to get it from DB - if (MeterPwdHandlerDb.GetPasswordFromDb(PcbId, out var password) && !UseOfflinePasswords) + var password = ""; + // if NOT offline password usage required try to get it from DB + if (!UseOfflinePasswords && MeterPwdHandlerDb.GetPasswordFromDb(PcbId, out password) ) { Logger.Info($"Slot:{Slot} - Got password from GenesisPasswordService, " + $"URL({ServiceUrls.GenesisGetPasswordServiceUrl() + PcbId})"); @@ -1266,9 +1270,13 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore if (!string.IsNullOrEmpty(password)) { - Logger.Info($"Slot:{Slot} - Got password for PcbId:{PcbId} from password file!"); + Logger.Info($"Slot:{Slot} - Got password for PcbId:{PcbId} from 'offline password' file!"); OfflinePassword = password; } + else + { + Logger.Info($"Slot:{Slot} - 'offline password' file does not contain a password for PcbId:{PcbId} !"); + } } return password; diff --git a/Common/LaaPackages b/Common/LaaPackages index 41c1163d..a9ef9051 160000 --- a/Common/LaaPackages +++ b/Common/LaaPackages @@ -1 +1 @@ -Subproject commit 41c1163d102dbb63572e60c6ffd501e1765d848c +Subproject commit a9ef9051cabb74806a4ce0293794cf95756883e6