From cfbefaa12d2d2cf936711a40bcb4d26b78578773 Mon Sep 17 00:00:00 2001 From: Chadwick Boulay Date: Mon, 29 Jan 2024 22:23:57 -0500 Subject: [PATCH] Store sysfreq in _config. --- pycbsdk/cbhw/device/base.py | 1 + pycbsdk/cbhw/device/nsp.py | 2 ++ 2 files changed, 3 insertions(+) diff --git a/pycbsdk/cbhw/device/base.py b/pycbsdk/cbhw/device/base.py index db87a3f..9ba4e83 100644 --- a/pycbsdk/cbhw/device/base.py +++ b/pycbsdk/cbhw/device/base.py @@ -26,6 +26,7 @@ def __init__(self, params: Params): "proc_chans": 0, "channel_infos": {}, "group_infos": {}, + "sysfreq": None, # Should be 30_000 for legacy or 1e9 for Gemini PTP } self.config_callbacks = defaultdict( lambda: [] diff --git a/pycbsdk/cbhw/device/nsp.py b/pycbsdk/cbhw/device/nsp.py index 9d48473..6dfe167 100644 --- a/pycbsdk/cbhw/device/nsp.py +++ b/pycbsdk/cbhw/device/nsp.py @@ -332,6 +332,7 @@ def _handle_sysrep(self, pkt): self._config["transport"] = pkt.transport # bitwise or'd flags if b_general or pkt.header.type == CBPacketType.SYSREPRUNLEV: self._config["runlevel"] = CBRunLevel(pkt.runlevel) + self._config["sysfreq"] = pkt.sysfreq self._config_events["sysrep"].set() if b_general or pkt.header.type == CBPacketType.SYSREPRUNLEV: if self._config["runlevel"] == CBRunLevel.STANDBY: @@ -569,6 +570,7 @@ def get_config( # Clear out our existing config self._config["proc_chans"] = 0 self._config["channel_infos"] = {} + self._config["sysfreq"] = None time.sleep(0.1) pkt = self.packet_factory.make_packet( None,