From 51568bd95b9e9f1f4e23bc64c04894071d573f3b Mon Sep 17 00:00:00 2001 From: Edward Viaene Date: Thu, 15 Oct 2026 14:14:13 -0500 Subject: [PATCH] Capabilities.scope is False on the digital-only board The SDK read the "signal" cap as the scope. Firmware 3.6+ lists signal on every board, the digital one included, and names "scope" itself, so the first run on a real digital pod (benchpod-a1c5c7, 3.9.1) failed test_status_says_digital_and_drops_the_analog_capabilities. signal now only counts on firmware without the analog flag. HW: digital pod SDK e2e 84 passed / 0 failed / 94 skipped, MCP 7/0/6. Co-Authored-By: Claude Opus 5.5 --- packages/embeddedci/CHANGELOG.md | 5 +++++ .../src/embeddedci/benchpod/capabilities.py | 6 +++++- .../tests/test_capabilities_scope.py | 21 +++++++++++++++++++ 3 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 packages/embeddedci/tests/test_capabilities_scope.py diff --git a/packages/embeddedci/CHANGELOG.md b/packages/embeddedci/CHANGELOG.md index ad43e20..2c77695 100644 --- a/packages/embeddedci/CHANGELOG.md +++ b/packages/embeddedci/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog — `embeddedci` +## Unreleased + +- `Capabilities.scope` is False on the digital-only board. Current firmware lists `signal` on every + board; it only stands for the scope on firmware without the `analog` flag. + ## 2.13.0 - `generate()` on firmware 3.9.1+ (`Capabilities.generate16`) sends the volts (or microamps on diff --git a/packages/embeddedci/src/embeddedci/benchpod/capabilities.py b/packages/embeddedci/src/embeddedci/benchpod/capabilities.py index a65b30c..236ca9c 100644 --- a/packages/embeddedci/src/embeddedci/benchpod/capabilities.py +++ b/packages/embeddedci/src/embeddedci/benchpod/capabilities.py @@ -285,7 +285,11 @@ def from_status(cls, status: Mapping[str, Any]) -> "Capabilities": caps = status.get("caps") if isinstance(caps, (list, tuple)): names = {str(x).lower() for x in caps} - c.scope = c.scope or ("signal" in names or "scope" in names) + # "signal" stood for the scope on firmware that predates the analog flag. Current + # firmware lists it on every board, the digital-only one included, and names "scope" + # itself, so it only counts when the status has no analog flag. + legacy = _as_bool(status, "analog") is None + c.scope = c.scope or "scope" in names or (legacy and "signal" in names) c.analyzer = c.analyzer or ("la" in names or "analyzer" in names) c.serial = c.serial or ("uart" in names or "serial" in names) # The DAC/gateware features. Firmware advertises these in status.caps[] built from diff --git a/packages/embeddedci/tests/test_capabilities_scope.py b/packages/embeddedci/tests/test_capabilities_scope.py new file mode 100644 index 0000000..cfa43e6 --- /dev/null +++ b/packages/embeddedci/tests/test_capabilities_scope.py @@ -0,0 +1,21 @@ +"""Capabilities.scope from a pod's status: the digital-only board has no scope.""" + +from embeddedci.benchpod.capabilities import Capabilities + + +def test_digital_board_has_no_scope(): + # Firmware 3.6+ lists "signal" on every board and names "scope" itself on the analog one. + status = {"board": "stm32h563", "adc_bits": 16, "analog": False, + "caps": ["signal", "gpio", "power", "la", "analyzer", "command"]} + assert Capabilities.from_status(status).scope is False + + +def test_analog_board_has_the_scope(): + status = {"board": "stm32h563", "adc_bits": 16, "analog": True, + "caps": ["signal", "la", "analog", "scope", "dac"]} + assert Capabilities.from_status(status).scope is True + + +def test_firmware_without_the_analog_flag_keeps_signal_as_scope(): + status = {"board": "stm32h563", "adc_bits": 16, "caps": ["signal", "la"]} + assert Capabilities.from_status(status).scope is True