From b50b361d9fd3d02f02e1f9b62bf3a00a87141a57 Mon Sep 17 00:00:00 2001 From: Cole Walker Date: Fri, 28 Oct 2022 15:29:36 -0400 Subject: [PATCH] [PTP] No longer consider clockClass 7 and 135 as locked PTP-notification was treating clockClass values 7 and 135 as indicators of a locked status, which is incorrect as per ITU-T G.8275.1. This was resulting in ptp-notification delivering locked status to clients when it should instead be transitioning to holdover/freerun. Removed clockClass 7 and 135 from the list of valid locked clockClasses. PTP-notification is now able to properly transition states when these classes are observed. Test plan: PASS: Build and deploy image PASS: Verify correct state transitions when clockClass 6, 7, 135 are observed Partial-Bug: 1995014 Signed-off-by: Cole Walker Change-Id: If68df991c3d6555f09e19a0d11f2c71e077c2587 --- .../trackingfunctionsdk/common/helpers/constants.py | 4 +--- .../trackingfunctionsdk/common/helpers/ptpsync.py | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/notificationservice-base/docker/ptptrackingfunction/trackingfunctionsdk/common/helpers/constants.py b/notificationservice-base/docker/ptptrackingfunction/trackingfunctionsdk/common/helpers/constants.py index 6c0c1ef..8e9e2a2 100644 --- a/notificationservice-base/docker/ptptrackingfunction/trackingfunctionsdk/common/helpers/constants.py +++ b/notificationservice-base/docker/ptptrackingfunction/trackingfunctionsdk/common/helpers/constants.py @@ -27,9 +27,7 @@ MASTER_MODE = "master" TIME_IS_TRACEABLE1 = "1" TIME_IS_TRACEABLE2 = "true" GM_IS_PRESENT = "true" -CLOCK_CLASS_VALUE1 = "6" -CLOCK_CLASS_VALUE2 = "7" -CLOCK_CLASS_VALUE3 = "135" +CLOCK_CLASS_VALUE6 = "6" # ts2phc constants NMEA_SERIALPORT = "ts2phc.nmea_serialport" GNSS_PIN = "GNSS-1PPS" diff --git a/notificationservice-base/docker/ptptrackingfunction/trackingfunctionsdk/common/helpers/ptpsync.py b/notificationservice-base/docker/ptptrackingfunction/trackingfunctionsdk/common/helpers/ptpsync.py index fc3bc1a..0e88e0e 100644 --- a/notificationservice-base/docker/ptptrackingfunction/trackingfunctionsdk/common/helpers/ptpsync.py +++ b/notificationservice-base/docker/ptptrackingfunction/trackingfunctionsdk/common/helpers/ptpsync.py @@ -86,9 +86,7 @@ def check_results(result, total_ptp_keywords, port_count): and result[constants.TIME_TRACEABLE].lower != constants.TIME_IS_TRACEABLE2): sync_state = constants.FREERUN_PHC_STATE if (result[constants.GM_CLOCK_CLASS] not in - [constants.CLOCK_CLASS_VALUE1, - constants.CLOCK_CLASS_VALUE2, - constants.CLOCK_CLASS_VALUE3]): + [constants.CLOCK_CLASS_VALUE6]): sync_state = constants.FREERUN_PHC_STATE return sync_state