VOL-4028: Fix conversion error from dBu to dBm for rx/tx power in
ANI-G test results
Change-Id: Iea9fd16c9bcd07ce9b7c16b57befab44993af0b4
diff --git a/VERSION b/VERSION
index f0bb29e..d9acaf8 100755
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-1.3.0
+1.3.1-dev140
diff --git a/internal/pkg/onuadaptercore/omci_self_test_handler.go b/internal/pkg/onuadaptercore/omci_self_test_handler.go
index c38e89b..55116b6 100644
--- a/internal/pkg/onuadaptercore/omci_self_test_handler.go
+++ b/internal/pkg/onuadaptercore/omci_self_test_handler.go
@@ -265,14 +265,12 @@
OnuOpticalInfo: &extension.GetOnuPonOpticalInfoResponse{
// OMCI representation is Volts, 2s compliment, 20mV resolution
PowerFeedVoltage: float32(TwosComplementToSignedInt16(msgObj.PowerFeedVoltage)) * 0.02,
+ // OMCI representation is Decibel-microwatts, 2s compliment, 0.002dB resolution.
+ // Subtract 30 to convert the unit from dBu to dBm (as expected by proto interface)
+ ReceivedOpticalPower: float32(TwosComplementToSignedInt16(msgObj.ReceivedOpticalPower))*0.002 - 30,
// OMCI representation is Decibel-microwatts, 2s compliment, 0.002dB resolution
- // Note: The OMCI table A.3.39.5 seems to be wrong about resolution. While it says the units are
- // in Decibel-microwatts, 2s complement, 0.002 dB resolution, it actually seems to be
- // Decibel-milliwatts, 2s complement, 0.002 dB resolution after analyzing the results from the ONUs
- ReceivedOpticalPower: float32(TwosComplementToSignedInt16(msgObj.ReceivedOpticalPower)) * 0.002,
- // OMCI representation is Decibel-microwatts, 2s compliment, 0.002dB resolution
- // Same comments as in the case of ReceivedOpticalPower about resolution.
- MeanOpticalLaunchPower: float32(TwosComplementToSignedInt16(msgObj.MeanOpticalLaunch)) * 0.002,
+ // Subtract 30 to convert the unit from dBu to dBm (as expected by proto interface)
+ MeanOpticalLaunchPower: float32(TwosComplementToSignedInt16(msgObj.MeanOpticalLaunch))*0.002 - 30,
// OMCI representation is unsigned int, 2uA resolution
// units of gRPC interface is mA.
LaserBiasCurrent: float32(msgObj.LaserBiasCurrent) * 0.000002 * 1000, // multiply by 1000 to get units in mA