Allow 0 dB spanloss in power management 02/110202/3
authorJonas Mårtensson <jonas.martensson@smartoptics.com>
Fri, 9 Feb 2024 08:07:45 +0000 (08:07 +0000)
committerGilles Thouenon <gilles.thouenon@orange.com>
Sat, 10 Feb 2024 08:23:21 +0000 (08:23 +0000)
Currently, power management, and therefore also service creation, fails
if any spanloss is 0 dB. There is nothing in the OpenROADM spec that
says 0 dB is out of range. The spanloss range is defined as:
Min: 0, Max: 27 dB

JIRA: TRNSPRTPCE-785
Signed-off-by: Jonas Mårtensson <jonas.martensson@smartoptics.com>
Change-Id: I62969b7cbe5c9ba06cdbfa51ee5db87c372479ea

olm/src/main/java/org/opendaylight/transportpce/olm/power/PowerMgmtImpl.java

index cbfc365ad44d1b19df8dcd969c66eee1b6aef862..dda3592b2009a2f8af1404e7c4385e8dd87de256 100644 (file)
@@ -197,8 +197,8 @@ public class PowerMgmtImpl implements PowerMgmt {
 
                     LOG.info("Spanloss TX is {}", spanLossTx);
                     // TODO: The span-loss limits should be obtained from optical specifications
-                    if (spanLossTx == null || spanLossTx.intValue() <= 0 || spanLossTx.intValue() > 27) {
-                        LOG.error("Power Value is null: spanLossTx null or out of openROADM range ]0,27] {}",
+                    if (spanLossTx == null || spanLossTx.intValue() < 0 || spanLossTx.intValue() > 27) {
+                        LOG.error("Power Value is null: spanLossTx null or out of openROADM range [0,27] {}",
                             spanLossTx);
                         return false;
                     }