flexPTP-test/TestController.py
András Wiesner cdbec108cb GUI...
2026-04-27 21:47:57 +02:00

41 lines
1.4 KiB
Python

from DeviceInterface import DeviceInterface
from LinuxPtpObserver import LinuxPtpObserver
from FlexPtpController import FlexPtpController
class TestController:
def __prepare_device(self) -> None:
self.__fptp_controller.disable_all_logging()
self.__fptp_controller.set_priority(128, 255)
self.__fptp_controller.set_domain(0)
self.__fptp_controller.reset_flexptp()
def __init__(self, di: DeviceInterface, lptp_observer: LinuxPtpObserver) -> None:
self.__di = di
self.__fptp_controller = FlexPtpController(di)
self.__lptp_observer = lptp_observer
pass
def start_test_e2e_udp(self) -> None:
self.__fptp_controller.start_e2e_udp()
self.__lptp_observer.start_linuxptp("E2E_UDP")
def start_test_e2e_l2(self) -> None:
self.__fptp_controller.start_e2e_l2()
self.__lptp_observer.start_linuxptp("E2E_L2")
def start_test_p2p_udp(self) -> None:
self.__fptp_controller.start_p2p_udp()
self.__lptp_observer.start_linuxptp("P2P_UDP")
def start_test_p2p_l2(self) -> None:
self.__fptp_controller.start_p2p_l2()
self.__lptp_observer.start_linuxptp("P2P_L2")
def start_test_gPTP(self) -> None:
self.__fptp_controller.start_gPTP()
self.__lptp_observer.start_linuxptp("gPTP")
def stop_test(self) -> None:
self.__lptp_observer.stop_linuxptp()