From b8eb9385ce586e97b2d6ff4f1da60cd477823d01 Mon Sep 17 00:00:00 2001 From: Leonard Yu Date: Thu, 30 Nov 2023 15:26:00 +0100 Subject: [PATCH] Add M_HEALTH --- xoa_driver/internals/commands/m_commands.py | 29 +++++++++++++++++++ .../hli_v1/modules/modules_l23/family_l1.py | 4 +++ .../hli_v2/modules/modules_l23/family_l1.py | 4 +++ 3 files changed, 37 insertions(+) diff --git a/xoa_driver/internals/commands/m_commands.py b/xoa_driver/internals/commands/m_commands.py index 611b3cca..83a38a3e 100644 --- a/xoa_driver/internals/commands/m_commands.py +++ b/xoa_driver/internals/commands/m_commands.py @@ -609,6 +609,8 @@ class GetDataAttr(ResponseBodyStruct): """coded integer, does this module support Time Sensitive Networking (TSN) ?""" can_ppm_sweep: YesNo = field(XmpInt()) """coded integer, does this module support Local Clock Adjustment/Sweep (aka. PPM Sweep) ?""" + monitoring_bitmask: int = field(XmpInt()) + """extended module monitoring capabilities""" def get(self) -> Token[GetDataAttr]: """Get the test module capabilities. @@ -1752,3 +1754,30 @@ def set(self, on_off: OnOff) -> Token[None]: set_on = functools.partialmethod(set, OnOff.ON) """Enable the bypass mode of the impairment emulator. """ + + +@register_command +@dataclass +class M_HEALTH: + """ + Gets the module health information. + """ + + code: typing.ClassVar[int] = 456 + pushed: typing.ClassVar[bool] = False + + _connection: 'interfaces.IConnection' + _module: int + + class GetDataAttr(ResponseBodyStruct): + info: str = field(XmpStr()) + """Module health information json string""" + + def get(self) -> Token[GetDataAttr]: + """Gets the module health information. + + :return: Module health information json string + :rtype: M_HEALTH.GetDataAttr + """ + + return Token(self._connection, build_get_request(self, module=self._module)) \ No newline at end of file diff --git a/xoa_driver/internals/hli_v1/modules/modules_l23/family_l1.py b/xoa_driver/internals/hli_v1/modules/modules_l23/family_l1.py index ce760c13..19523a30 100644 --- a/xoa_driver/internals/hli_v1/modules/modules_l23/family_l1.py +++ b/xoa_driver/internals/hli_v1/modules/modules_l23/family_l1.py @@ -11,6 +11,7 @@ from xoa_driver.internals.commands import ( M_CLOCKPPBSWEEP, M_CLOCKSWEEPSTATUS, + M_HEALTH, ) @@ -36,6 +37,9 @@ def __init__(self, conn: "itf.IConnection", init_data: "m_itf.ModuleInitData") - self.clock_sweep = MClockSweep(conn, self.module_id) """Clock ppm sweep control""" + self.health = M_HEALTH(conn, self.module_id) + """Module health info""" + @typing.final @revisions.register_valkyrie_module(rev="Freya-800G-1S-1P[a]") diff --git a/xoa_driver/internals/hli_v2/modules/modules_l23/family_l1.py b/xoa_driver/internals/hli_v2/modules/modules_l23/family_l1.py index bc8c50a1..a1e096a5 100644 --- a/xoa_driver/internals/hli_v2/modules/modules_l23/family_l1.py +++ b/xoa_driver/internals/hli_v2/modules/modules_l23/family_l1.py @@ -11,6 +11,7 @@ from xoa_driver.internals.commands import ( M_CLOCKPPBSWEEP, M_CLOCKSWEEPSTATUS, + M_HEALTH, ) @@ -36,6 +37,9 @@ def __init__(self, conn: "itf.IConnection", init_data: "m_itf.ModuleInitData") - self.clock_sweep = MClockSweep(conn, self.module_id) """Clock ppm sweep control""" + self.health = M_HEALTH(conn, self.module_id) + """Module health info""" + @typing.final @revisions.register_valkyrie_module(rev="Freya-800G-1S-1P[a]")