From f8d7968f5d32ede6cf7c5d762c266066047baa90 Mon Sep 17 00:00:00 2001 From: Edward Viaene Date: Fri, 20 Nov 2026 16:18:42 -0600 Subject: [PATCH 1/7] USB decode from the LA: SDK decode_usb + MCP decode_la protocol usb Full speed and low speed from a passive D+/D- tap: packets (CRC5/CRC16, bit stuffing, PID checks per packet), transactions, control transfers with SETUP requests and descriptors decoded. Mirrors the server's decode/usb.go, held to it by the shared usb_decode_vectors.json. Co-Authored-By: Claude Opus 5.5 --- packages/embeddedci-mcp/CHANGELOG.md | 9 + packages/embeddedci-mcp/README.md | 4 +- packages/embeddedci-mcp/pyproject.toml | 2 +- .../src/embeddedci_mcp/guide.py | 2 +- .../src/embeddedci_mcp/models.py | 5 + .../src/embeddedci_mcp/server.py | 36 +- .../tests/test_capture_resources.py | 33 + .../embeddedci-mcp/tests/tools_surface.json | 46 +- packages/embeddedci/CHANGELOG.md | 7 + packages/embeddedci/README.md | 14 +- .../src/embeddedci/benchpod/__init__.py | 2 + .../src/embeddedci/benchpod/client.py | 8 +- .../src/embeddedci/benchpod/constants.py | 2 +- .../src/embeddedci/benchpod/decode.py | 13 +- .../src/embeddedci/benchpod/results.py | 3 +- .../src/embeddedci/benchpod/usb_decode.py | 662 ++++++++++++++++++ packages/embeddedci/tests/api_surface.json | 18 +- packages/embeddedci/tests/test_usb_decode.py | 117 ++++ .../tests/testdata/usb_decode_vectors.json | 1 + 19 files changed, 961 insertions(+), 23 deletions(-) create mode 100644 packages/embeddedci/src/embeddedci/benchpod/usb_decode.py create mode 100644 packages/embeddedci/tests/test_usb_decode.py create mode 100644 packages/embeddedci/tests/testdata/usb_decode_vectors.json diff --git a/packages/embeddedci-mcp/CHANGELOG.md b/packages/embeddedci-mcp/CHANGELOG.md index ea585f7..8a35d21 100644 --- a/packages/embeddedci-mcp/CHANGELOG.md +++ b/packages/embeddedci-mcp/CHANGELOG.md @@ -1,5 +1,14 @@ # Changelog — `embeddedci-mcp` +## 4.0.1 + +Not released yet. Needs embeddedci 4.0.1. + +- **`decode_la` decodes USB** full and low speed: `protocol="usb"`, `dp`, `dm`, `speed` + (`auto`, `full`, `low`). `items` are transactions, `transfers` the control transfers (an + enumeration as a list), with `speed`, `errors` and `sof_count`. `benchpod://capture/decode` + carries the packets, transactions and transfers. + ## 4.0.0 Pairs with BenchPod firmware 4.0.0 and embeddedci 4.0. Breaking changes: diff --git a/packages/embeddedci-mcp/README.md b/packages/embeddedci-mcp/README.md index 43f6f59..e8f7c96 100644 --- a/packages/embeddedci-mcp/README.md +++ b/packages/embeddedci-mcp/README.md @@ -344,7 +344,7 @@ version the SDK pins (0.1.0, bundled) unless `BENCHPOD_SENSOR_LIBRARY`, the CLI' | `capture_adc` | Capture the ADC: calibrated statistics, dominant frequency and a min/max envelope; `clipped_samples` counts samples past the range's full scale. `oversample` converts at 400 kS/s and averages down to `sample_rate_hz` for lower noise, about 5 s at most. | `samples=4096`, `sample_rate_hz`, `source`, `points=200`, `trigger_la`, `trigger_edge=rising`, `trigger_timeout_s=10`, `range`, `oversample` | | `capture_la` | Capture all 14 LA channels: levels, edge count, first edge and frequency per channel. Up to 48 MS/s on gateware v50+. `send` (gateware v55+) runs one transaction right after the capture arms: `{"bus":"i2c","addr":118,"write_hex":"d0","read":1}` (the `i2c_open` session, else one from the wiring), `{"bus":"spi","tx_hex":"9f00"}` (SPI pins from the wiring) or `{"bus":"gpio","la":6,"level":0}` (a GPIO output); without `trigger_la` it triggers on SDA or CS falling or the pin's edge, and the result's `send` has the reply. | `samples=4096`, `sample_rate_hz`, `stop_dac_after_s`, `trigger_la`, `trigger_edge=rising`, `trigger_timeout_s=10`, `trigger_pre_samples=0`, `send` | | `capture_correlated` | ADC and LA from one hardware trigger, on one timebase. | `adc_samples=4096`, `adc_sample_rate_hz`, `la_samples=4096`, `la_sample_rate_hz`, `stop_dac_after_s`, `points=200`, `trigger_la`, `trigger_edge=rising`, `trigger_timeout_s=10`, `source` | -| `decode_la` | Decode I2C, UART or SPI from the last LA capture (or a new one). | **`protocol`**, `sda`, `scl`, `rx`, `baud`, `sclk`, `mosi`, `miso`, `cs`, `mode=0`, `capture=last`, `samples=16384`, `sample_rate_hz=1000000`, `max_items=200` | +| `decode_la` | Decode I2C, UART, SPI or USB from the last LA capture (or a new one). USB (full speed at 48 MS/s, low speed from 6 MS/s) returns transactions as `items` and the control transfers as `transfers`: an enumeration as a list. | **`protocol`**, `sda`, `scl`, `rx`, `baud`, `sclk`, `mosi`, `miso`, `cs`, `mode=0`, `dp`, `dm`, `speed=auto`, `capture=last`, `samples=16384`, `sample_rate_hz=1000000`, `max_items=200` | | `la_timing` | Edge timestamps, pulse widths, frequency, duty cycle and channel-to-channel delay from the last capture. | **`la`**, `edge=rising`, `to_la`, `to_edge=rising`, `after=0`, `max_edges=100` | ### DAC @@ -423,7 +423,7 @@ in an app (the BenchPod desktop app's capture view), three more give the last ca |---|---| | `benchpod://capture/la` | The last `capture_la` / `capture_correlated` as run-length `edges`, `[sample index, 14-bit word]` from sample 0, plus `sample_rate_hz`, `count`, `pre_samples`, `seq`, `correlated`. | | `benchpod://capture/adc` | The last `capture_adc` / `capture_correlated`: `samples` in volts (or mA for `current_in`), `unit`, `sample_rate_hz`, `source`, `seq`, `correlated`. | -| `benchpod://capture/decode` | The last `decode_la`: `protocol`, `channels`, and I2C `transactions` with timed segments, or UART / SPI `frames` with `start_us` / `end_us`; `seq` is the capture it decoded. | +| `benchpod://capture/decode` | The last `decode_la`: `protocol`, `channels`, and I2C `transactions` with timed segments, UART / SPI `frames` with `start_us` / `end_us`, or USB `packets`, `transactions` and `transfers`; `seq` is the capture it decoded. | Each is `{"seq": 0}` before the first capture. `seq` numbers the captures, and `correlated` says the LA and ADC captures share one timebase. They can be megabytes: an agent should read the diff --git a/packages/embeddedci-mcp/pyproject.toml b/packages/embeddedci-mcp/pyproject.toml index f7549ae..a7cecb5 100644 --- a/packages/embeddedci-mcp/pyproject.toml +++ b/packages/embeddedci-mcp/pyproject.toml @@ -26,7 +26,7 @@ classifiers = [ dependencies = [ # cloud: the embeddedci: destination; discovery: connect("discover") over mDNS; # analysis: dominant frequency in capture summaries; yaml: sensor definitions an agent writes. - "embeddedci[cloud,discovery,analysis,yaml]>=4.0.0,<5", + "embeddedci[cloud,discovery,analysis,yaml]>=4.0.1,<5", "mcp>=1.12,<2", "anyio>=4", "pydantic>=2.7", diff --git a/packages/embeddedci-mcp/src/embeddedci_mcp/guide.py b/packages/embeddedci-mcp/src/embeddedci_mcp/guide.py index 455490e..ce5dd33 100644 --- a/packages/embeddedci-mcp/src/embeddedci_mcp/guide.py +++ b/packages/embeddedci-mcp/src/embeddedci_mcp/guide.py @@ -30,7 +30,7 @@ - 4-20 mA input: adc_read(source='current_in') reads terminal J8 and returns current in amps (0.004 to 0.020 for a live loop) next to the voltage across the sense resistor (249 ohm; from analog module v3r5 100 ohm behind a 30 mA limiter, read in the low range by default, so a reading stuck near 28.5 to 31.5 mA is the limiter). calibration shows whether the pod has calibrated its ADC offset there. If not, analog readings can be off by up to about 50 mV: ask the user to disconnect J8, then calibrate (once per pod, stored on the pod; it corrects every ADC source). - 4-20 mA output: current_out(current) holds a loop current on terminal J9, in amps (0.012 is 12 mA), and returns the current actually held and the range. It needs an external floating loop supply on J9 and cannot go below about 4 mA or above about 20 mA. It shares the DAC with the voltage outputs and switches them off; dac_stop does not return the loop to 4 mA, current_out(0.004) does. The loop must float: nothing in it may touch pod ground, also not through a target that shares a ground with the pod (SWD, UART). Ask the user how J9 is wired first, and never suggest wiring J9 straight into J8. generate and replay take dac_path='current_out' to play a waveform as a current (levels in amps); capture_adc(source='current_in') summarises the loop current in amps. - Gateware images: the FPGA runs either the 'loop' image (control_loop) or the 'deep_replay' image (replays longer than 2048 samples). control_loop and replay switch automatically (~3 s; switched_image in the result says so). A switch resets the FPGA and stops any DAC output, UART session or sensor emulation, so start those after it. fpga_image switches explicitly. I2C/SPI/UART sensors run on a third, emulation image that sensor_start loads by itself (control_loop and deep replays are unavailable while it runs). -- Logic: capture_la, then decode_la (i2c/uart/spi) re-decodes that capture without re-capturing, and la_timing measures edge times, pulse widths, frequency and the delay between two channels (e.g. trigger pin to result pin). +- Logic: capture_la, then decode_la (i2c/uart/spi/usb; usb full speed needs a 48 MS/s capture) re-decodes that capture without re-capturing, and la_timing measures edge times, pulse widths, frequency and the delay between two channels (e.g. trigger pin to result pin). - Triggers: capture_adc, capture_la and capture_correlated take trigger_la (+ trigger_edge rising/falling/high/low, trigger_timeout seconds) to start on an event rather than immediately, so t = 0 is that edge. Without the trigger firing the tool fails with "TriggerTimeout: ...". - Power profiles: measure_power(duration) reports the DUT's average/minimum/peak current, voltage, energy and charge over a window, with an optional trace (points). To profile across other tool calls, bracket them with power_profile_start and power_profile_stop. - CAN: can_open (mode 'internal' self-tests a lone pod), can_write, can_read, can_respond, can_close. diff --git a/packages/embeddedci-mcp/src/embeddedci_mcp/models.py b/packages/embeddedci-mcp/src/embeddedci_mcp/models.py index 94c60b4..d162234 100644 --- a/packages/embeddedci-mcp/src/embeddedci_mcp/models.py +++ b/packages/embeddedci-mcp/src/embeddedci_mcp/models.py @@ -763,6 +763,11 @@ class DecodeResult(BaseModel): items: List[str] truncated: bool text: Optional[str] = Field(None, description="UART only: the decoded bytes as text.") + speed: Optional[str] = Field(None, description="USB only: full or low.") + transfers: Optional[List[str]] = Field(None, description=( + "USB only: one line per control transfer (request, status, descriptor read back).")) + errors: Optional[int] = Field(None, description="USB only: packets with an error (CRC, bit stuffing, PID).") + sof_count: Optional[int] = Field(None, description="USB only: start-of-frame packets (left out of items).") # -- DAC ------------------------------------------------------------------------------ diff --git a/packages/embeddedci-mcp/src/embeddedci_mcp/server.py b/packages/embeddedci-mcp/src/embeddedci_mcp/server.py index bc2e706..db6b2c5 100644 --- a/packages/embeddedci-mcp/src/embeddedci_mcp/server.py +++ b/packages/embeddedci-mcp/src/embeddedci_mcp/server.py @@ -66,6 +66,7 @@ header_map = None # type: ignore[assignment] from embeddedci.benchpod import decode as sdk_decode +from embeddedci.benchpod import usb_decode from embeddedci.benchpod.capabilities import Capabilities from embeddedci.benchpod.client import API_BASE_ENV, API_KEY_ENV from embeddedci.benchpod.cloud_auth import DEFAULT_API_BASE @@ -2367,15 +2368,23 @@ async def decode_la( miso: Optional[LaPin] = None, cs: Optional[LaPin] = None, mode: Literal[0, 1, 2, 3] = 0, + dp: Annotated[Optional[LaPin], Field(description="usb: the channel on D+.")] = None, + dm: Annotated[Optional[LaPin], Field(description="usb: the channel on D-.")] = None, + speed: Annotated[Literal["auto", "full", "low"], Field(description=( + "usb: full (12 Mbit/s), low (1.5 Mbit/s) or auto (from the idle state)."))] = "auto", capture: Annotated[Literal["last", "new"], Field(description=( "last = decode the previous capture_la; new = capture first (needs samples/sample_rate_hz)."))] = "last", samples: Samples = 16384, sample_rate_hz: Annotated[float, Field(gt=0, le=50_000_000)] = 1_000_000, max_items: Annotated[int, Field(ge=1, le=5000)] = 200, ) -> m.DecodeResult: - """Decode I2C (sda, scl), UART (rx, baud) or SPI (sclk + mosi/miso/cs, mode) from LA data. + """Decode I2C (sda, scl), UART (rx, baud), SPI (sclk + mosi/miso/cs, mode) or USB (dp, dm, + speed) from LA data. - Sample at least ~10x the bit rate. Decoding the last capture again with other channels is free. + Sample at least ~10x the bit rate; USB full speed needs a 48 MS/s capture, low speed 6 MS/s. + USB items are transactions (token, data, handshake; repeated NAKs merged), transfers the + control transfers with the SETUP request and descriptors decoded (an enumeration). + Decoding the last capture again with other channels is free. """ def op() -> m.DecodeResult: pod = SESSION.require() @@ -2385,21 +2394,33 @@ def op() -> m.DecodeResult: raise ValueError("uart needs rx and baud") if protocol == "spi" and sclk is None: raise ValueError("spi needs sclk") + if protocol == "usb" and (dp is None or dm is None): + raise ValueError("usb needs dp and dm") la = SESSION.last_la if capture == "new" or la is None: la = pod.capture_la(samples, sample_rate_hz=sample_rate_hz) SESSION.last_la = la channels = {k: v for k, v in (("sda", sda), ("scl", scl), ("rx", rx), ("baud", baud), - ("sclk", sclk), ("mosi", mosi), ("miso", miso), ("cs", cs)) + ("sclk", sclk), ("mosi", mosi), ("miso", miso), ("cs", cs), + ("dp", dp), ("dm", dm)) if v is not None} if protocol == "spi": channels["mode"] = mode + if protocol == "usb": + channels["speed"] = speed frames = pod.decode(la, protocol, **channels) try: SESSION.last_decode = _decode_view(la, protocol, channels, frames) except Exception: # the capture view's copy never fails the decode itself SESSION.last_decode = None text = None + if protocol == "usb": + items = usb_decode.format_transactions(frames) + transfers = usb_decode.format_transfers(frames) + return m.DecodeResult(protocol=protocol, count=len(items), items=items[:max_items], + truncated=len(items) > max_items, speed=frames.speed, + transfers=transfers[:max_items], errors=frames.error_count, + sof_count=frames.sof_count) if protocol == "i2c": items = i2c.format_transactions(frames).splitlines() elif protocol == "uart": @@ -3006,7 +3027,9 @@ def _decode_view(la: Any, protocol: str, channels: Dict[str, Any], frames: Any) frames (the EmbeddedCI web app's decode result).""" view: Dict[str, Any] = {"seq": SESSION.la_seq, "protocol": protocol, "channels": {k: v for k, v in channels.items()}} - if protocol == "i2c": + if protocol == "usb": + view.update({k: v for k, v in frames.as_dict().items() if k != "protocol"}) + elif protocol == "i2c": view["transactions"] = i2c.timed_transactions(la.words, channels["sda"], channels["scl"], la.sample_rate_hz) else: @@ -3063,8 +3086,9 @@ def capture_adc_resource() -> str: @mcp.resource("benchpod://capture/decode", name="capture_decode_data", mime_type="application/json", title="Last decode, with timing", - description=("The last decode_la in full: I2C transactions with timed segments, or UART / " - "SPI frames, for drawing on the capture. seq is the capture it decoded.")) + description=("The last decode_la in full: I2C transactions with timed segments, UART / " + "SPI frames, or USB packets, transactions and transfers, for drawing on the " + "capture. seq is the capture it decoded.")) def capture_decode_resource() -> str: return json.dumps(SESSION.last_decode or {"seq": 0}, separators=(",", ":")) diff --git a/packages/embeddedci-mcp/tests/test_capture_resources.py b/packages/embeddedci-mcp/tests/test_capture_resources.py index a1bb486..0f2ca02 100644 --- a/packages/embeddedci-mcp/tests/test_capture_resources.py +++ b/packages/embeddedci-mcp/tests/test_capture_resources.py @@ -3,6 +3,7 @@ import json import anyio +import pytest from embeddedci.benchpod.results import LaCapture from embeddedci_mcp.server import (capture_adc_resource, capture_decode_resource, capture_la_resource, @@ -60,3 +61,35 @@ def test_i2c_decode_has_timed_segments(connected): t = json.loads(capture_decode_resource())["transactions"][0] assert t["address"] == "0x50" and t["ok"] and t["direction"] == "write" assert [s["type"] for s in t["segments"]][:3] == ["start", "address-write", "ack"] + + +def _usb_vector_words(): + """The SDK's shared full-speed enumeration vector (48 MS/s, D+ LA1, D- LA2) as dense words.""" + from pathlib import Path + + path = Path(__file__).resolve().parents[2] / "embeddedci" / "tests" / "testdata" / "usb_decode_vectors.json" + case = json.loads(path.read_text())["cases"][0] + words, edges = [0] * case["count"], case["edges"] + for k, (at, w) in enumerate(edges): + end = edges[k + 1][0] if k + 1 < len(edges) else case["count"] + words[at:end] = [w] * (end - at) + return words, case["sample_rate_hz"] + + +def test_usb_decode_lists_the_enumeration(connected): + words, rate = _usb_vector_words() + SESSION.last_la = LaCapture(words=words, sample_rate_hz=rate) + r = call("decode_la", protocol="usb", dp=1, dm=2) + assert r["speed"] == "full" and r["errors"] == 0 and r["sof_count"] == 2 + assert any("SET_ADDRESS 5: OK" in t for t in r["transfers"]) + assert any("NAK x2" in t for t in r["items"]) + d = json.loads(capture_decode_resource()) + assert d["protocol"] == "usb" and d["channels"] == {"dp": 1, "dm": 2, "speed": "auto"} + assert {"packets", "transactions", "transfers"} <= set(d) + assert d["transfers"][0]["request"] == "GET_DESCRIPTOR DEVICE length 64" + + +def test_usb_decode_needs_both_lines(connected): + SESSION.last_la = LaCapture(words=[1] * 100, sample_rate_hz=48e6) + with pytest.raises(Exception, match="usb needs dp and dm"): + call("decode_la", protocol="usb", dp=1) diff --git a/packages/embeddedci-mcp/tests/tools_surface.json b/packages/embeddedci-mcp/tests/tools_surface.json index 3e8dee8..10e0926 100644 --- a/packages/embeddedci-mcp/tests/tools_surface.json +++ b/packages/embeddedci-mcp/tests/tools_surface.json @@ -1900,6 +1900,38 @@ "default": null, "title": "Cs" }, + "dm": { + "anyOf": [ + { + "description": "LA channel (1-14) the signal is wired to.", + "maximum": 14, + "minimum": 1, + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null, + "description": "usb: the channel on D-.", + "title": "Dm" + }, + "dp": { + "anyOf": [ + { + "description": "LA channel (1-14) the signal is wired to.", + "maximum": 14, + "minimum": 1, + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null, + "description": "usb: the channel on D+.", + "title": "Dp" + }, "max_items": { "default": 200, "maximum": 5000, @@ -1952,7 +1984,8 @@ "enum": [ "i2c", "uart", - "spi" + "spi", + "usb" ], "title": "Protocol", "type": "string" @@ -2030,6 +2063,17 @@ ], "default": null, "title": "Sda" + }, + "speed": { + "default": "auto", + "description": "usb: full (12 Mbit/s), low (1.5 Mbit/s) or auto (from the idle state).", + "enum": [ + "auto", + "full", + "low" + ], + "title": "Speed", + "type": "string" } }, "required": [ diff --git a/packages/embeddedci/CHANGELOG.md b/packages/embeddedci/CHANGELOG.md index 22a3cb0..7767c76 100644 --- a/packages/embeddedci/CHANGELOG.md +++ b/packages/embeddedci/CHANGELOG.md @@ -4,6 +4,13 @@ Not released yet. +- **USB decoding from the logic analyzer.** `bp.decode(la, "usb", dp=, dm=)` (and + `LaCapture.decode`, `decode.decode_usb`) decodes full speed (12 Mbit/s, capture at 48 MS/s) and + low speed (1.5 Mbit/s, 6 MS/s and more) from a passive D+/D- tap: packets with CRC5/CRC16, + bit stuffing and PID checks flagged per packet, transactions (token, data, handshake, repeated + NAKs merged) and control transfers with the SETUP request and the descriptors read back + decoded. Returns a `UsbDecode`; locked to the server's decoder by shared vectors. + - **`la_pins` reads a long listing in pages.** On firmware with the `la_pins_paged` feature (features table revision 12), a reply that cannot carry every pin says `next`; the SDK asks again with `"from": next` (and the same `la`) and joins the pins, so `bp.la_pins()` and the MCP diff --git a/packages/embeddedci/README.md b/packages/embeddedci/README.md index b4a3a79..f5bc57e 100644 --- a/packages/embeddedci/README.md +++ b/packages/embeddedci/README.md @@ -1921,6 +1921,11 @@ frames = bp.decode(la, "uart", rx=5, baud=115200) print(decode.uart_text(frames)) words = la.decode("spi", sclk=1, mosi=2, miso=3, cs=4) +usb = bp.capture_la(480_000, sample_rate_hz=48_000_000) # 10 ms of a full-speed bus +enum = usb.decode("usb", dp=7, dm=8) # speed from the idle state +for t in enum.transfers: # control transfers: the enumeration + print(t.request, t.status, t.detail) # GET_DESCRIPTOR DEVICE length 64 OK USB 2.00, ... + both = bp.capture_correlated(adc_samples=4096, adc_sample_rate_hz=400_000, la_samples=4096, la_sample_rate_hz=1_000_000) print(both.adc.duration, both.la.duration) # one hardware trigger: timebases align @@ -1957,7 +1962,13 @@ about 0.44 times the returned rate. * `bp.decode(source, protocol, **channels)` / `LaCapture.decode(...)` — off-device decoding of `i2c` (`sda`, `scl`), `uart` (`rx`, `baud`, optional `data_bits`, `parity`, `stop_bits`) and `spi` (`sclk`, optional `mosi`, `miso`, `cs`, `mode`, `bits`, `msb_first`). Results are - `I2CTransaction`, `UartFrame` and `SpiFrame` lists. + `I2CTransaction`, `UartFrame` and `SpiFrame` lists. `usb` (`dp`, `dm`, optional `speed`: + `full`, `low` or `auto`) returns a `UsbDecode`: `packets` (PID, address, endpoint, frame, data, + CRC5/CRC16 checked, `error` per packet), `transactions` (token, data, handshake; repeated NAKs + merged into `count`) and `transfers` (control transfers with the SETUP request and the + descriptors read back decoded). Tap D+ and D- on two LA channels at the 3.3 V I/O level. Full + speed needs `sample_rate_hz=48_000_000`; low speed decodes from 6 MS/s. High speed is not + visible to the LA. `decode.decode_usb(words, dp=, dm=, sample_rate_hz=)` decodes raw words. | `Capture` | `LaCapture` | |---|---| @@ -2636,6 +2647,7 @@ few built from other shapes); `to_dict()` goes the other way where a type is sen | `I2CByte` | `I2CMessage.data` | `value`, `ack` | | `UartFrame` | `decode("uart")` | `index`, `start_us`, `end_us`, `value`, `hex`, `text`, `ok`, `error` | | `SpiFrame` | `decode("spi")` | `index`, `start_us`, `end_us`, `mosi`, `miso`, `mosi_hex`, `miso_hex` | +| `UsbDecode` | `decode("usb")` | `speed`, `packets`, `transactions`, `transfers`, `sof_count`, `keep_alive_count`, `error_count`, `as_dict()` | | `AnalogPathState` | `analog_path` | `path`, `dac_mux_register`, `cal_relay_register`, `range` | | `AdcReading` | `adc_read` | `source`, `voltage`, `count`, `span`, `offset`, `current`, `range`, `fullscale`, `overrange` | | `AdcRangeState` | `adc_range` | `range`, `supported`, `fullscale`, `normal_fullscale`, `low_fullscale`, `a`, `b` (volts, the `ext` fit of the range) | diff --git a/packages/embeddedci/src/embeddedci/benchpod/__init__.py b/packages/embeddedci/src/embeddedci/benchpod/__init__.py index d86064e..76dc7fc 100644 --- a/packages/embeddedci/src/embeddedci/benchpod/__init__.py +++ b/packages/embeddedci/src/embeddedci/benchpod/__init__.py @@ -94,6 +94,7 @@ def test_boots(benchpod_target, firmware): # fixtures from the pytest plugin input_percent_to_code, ) from .decode import SpiFrame, UartFrame +from .usb_decode import UsbDecode from .errors import ( BenchPodError, CanTimeout, @@ -269,6 +270,7 @@ def test_boots(benchpod_target, firmware): # fixtures from the pytest plugin "Trigger", "UartFrame", "SpiFrame", + "UsbDecode", # DAC output, replay + waveform library "DacHandle", "ReplayHandle", diff --git a/packages/embeddedci/src/embeddedci/benchpod/client.py b/packages/embeddedci/src/embeddedci/benchpod/client.py index 44f9447..b134f7c 100644 --- a/packages/embeddedci/src/embeddedci/benchpod/client.py +++ b/packages/embeddedci/src/embeddedci/benchpod/client.py @@ -2805,11 +2805,13 @@ def _resolve_trigger(self, trigger: Optional[Trigger]) -> Optional[Trigger]: return trigger def decode(self, source: Union[LaCapture, Sequence[int]], protocol: DecodeProtocol = "i2c", *, - sample_rate_hz: Optional[float] = None, **channels: Any) -> list: - """Decode ``i2c``/``uart``/``spi`` from an LA capture (or raw 14-bit words) off-device. + sample_rate_hz: Optional[float] = None, **channels: Any) -> Any: + """Decode ``i2c``/``uart``/``spi``/``usb`` from an LA capture (or raw 14-bit words) off-device. Channels by protocol: i2c ``sda``, ``scl``; uart ``rx``, ``baud``; spi ``sclk`` (+ ``mosi``, - ``miso``, ``cs``, ``mode``). See :func:`embeddedci.benchpod.decode.decode`. + ``miso``, ``cs``, ``mode``); usb ``dp``, ``dm`` (+ ``speed``). I2C, UART and SPI return a + list; USB returns a :class:`~embeddedci.benchpod.usb_decode.UsbDecode` (packets, + transactions, control transfers). See :func:`embeddedci.benchpod.decode.decode`. """ from . import decode as _decode diff --git a/packages/embeddedci/src/embeddedci/benchpod/constants.py b/packages/embeddedci/src/embeddedci/benchpod/constants.py index d8fc5d1..c1840af 100644 --- a/packages/embeddedci/src/embeddedci/benchpod/constants.py +++ b/packages/embeddedci/src/embeddedci/benchpod/constants.py @@ -119,7 +119,7 @@ class Pin(IntEnum): #: Where the in-fabric control loop takes its input from. LoopSource = Literal["adc", "fixed", "sweep"] #: Protocols the off-device LA decoder understands. -DecodeProtocol = Literal["i2c", "uart", "spi"] +DecodeProtocol = Literal["i2c", "uart", "spi", "usb"] #: FDCAN operating mode; ``internal``/``external`` are loopbacks for a lone pod. CanMode = Literal["normal", "internal", "external", "listen"] #: A fault spliced into a replayed waveform. diff --git a/packages/embeddedci/src/embeddedci/benchpod/decode.py b/packages/embeddedci/src/embeddedci/benchpod/decode.py index a578dda..918de46 100644 --- a/packages/embeddedci/src/embeddedci/benchpod/decode.py +++ b/packages/embeddedci/src/embeddedci/benchpod/decode.py @@ -2,8 +2,8 @@ The FPGA captures raw logic only; protocol interpretation runs on the host over the sampled ``words`` plus a channel assignment — the same model the server uses (``POST /analyzer/decode``). -This module is the Python mirror of the server's decoders (``benchpod_uart_decode.go`` / -``benchpod_spi_decode.go``) and reuses :mod:`embeddedci.benchpod.i2c` for I2C, so a test can +This module is the Python mirror of the server's decoders (``decode/uart.go``, ``decode/spi.go``, +``decode/usb.go``) and reuses :mod:`embeddedci.benchpod.i2c` for I2C, so a test can decode the same capture identically whether it goes through the server or stays client-side. ``words[i]`` packs all channels for sample ``i`` (bit ``n`` = channel ``LA{n+1}``); channel @@ -16,6 +16,7 @@ from typing import List, Sequence from . import i2c as _i2c +from .usb_decode import UsbDecode, decode_usb # noqa: F401 (re-exported) def _channel_bits(words: Sequence[int], ch: int) -> List[int]: @@ -240,13 +241,15 @@ def decode_spi(words: Sequence[int], *, sclk: int, mosi: int = 0, miso: int = 0, def decode(words: Sequence[int], protocol: str = "i2c", *, sample_rate_hz: float = 0.0, **channels): - """Decode ``protocol`` (``i2c``/``uart``/``spi``) from raw LA ``words``. + """Decode ``protocol`` (``i2c``/``uart``/``spi``/``usb``) from raw LA ``words``. Channel/param names match the protocol: * i2c: ``sda``, ``scl`` → list of :class:`~embeddedci.benchpod.i2c.I2CTransaction` * uart: ``rx``, ``baud`` (+ ``data_bits``, ``parity``, ``stop_bits``) → list of :class:`UartFrame` * spi: ``sclk`` (+ ``mosi``, ``miso``, ``cs``, ``mode``, ``bits``, ``msb_first``) → list of :class:`SpiFrame` + * usb: ``dp``, ``dm`` (+ ``speed`` ``full``/``low``/``auto``) → :class:`UsbDecode` (packets, + transactions, control transfers) """ proto = (protocol or "").lower() if proto == "i2c": @@ -255,4 +258,6 @@ def decode(words: Sequence[int], protocol: str = "i2c", *, sample_rate_hz: float return decode_uart(words, sample_rate_hz=sample_rate_hz, **channels) if proto == "spi": return decode_spi(words, sample_rate_hz=sample_rate_hz, **channels) - raise ValueError(f"unsupported protocol {protocol!r} (supported: i2c, uart, spi)") + if proto == "usb": + return decode_usb(words, sample_rate_hz=sample_rate_hz, **channels) + raise ValueError(f"unsupported protocol {protocol!r} (supported: i2c, uart, spi, usb)") diff --git a/packages/embeddedci/src/embeddedci/benchpod/results.py b/packages/embeddedci/src/embeddedci/benchpod/results.py index 6edbcd8..b5ea01e 100644 --- a/packages/embeddedci/src/embeddedci/benchpod/results.py +++ b/packages/embeddedci/src/embeddedci/benchpod/results.py @@ -350,7 +350,8 @@ def decode(self, protocol: str = "i2c", **channels): Examples: ``cap.decode("i2c", sda=2, scl=1)``, ``cap.decode("uart", rx=5, baud=115200)``, - ``cap.decode("spi", sclk=1, mosi=2, miso=3, cs=4)``. + ``cap.decode("spi", sclk=1, mosi=2, miso=3, cs=4)``, + ``cap.decode("usb", dp=5, dm=6)`` (capture at 48 MS/s for full speed). """ from .decode import decode as _decode diff --git a/packages/embeddedci/src/embeddedci/benchpod/usb_decode.py b/packages/embeddedci/src/embeddedci/benchpod/usb_decode.py new file mode 100644 index 0000000..c05cdfc --- /dev/null +++ b/packages/embeddedci/src/embeddedci/benchpod/usb_decode.py @@ -0,0 +1,662 @@ +"""USB full-speed (12 Mbit/s) and low-speed (1.5 Mbit/s) decoding from a passive D+/D- tap. + +The Python mirror of the EmbeddedCI server's ``decode/usb.go``: the same layers and field names, +so a capture decodes the same whether it goes through the server or stays client-side. + +* packets: SYNC, PID, token fields, data and CRC5/CRC16, errors flagged per packet; +* transactions: a token (SETUP/OUT/IN/PING) with its data packet and handshake; +* transfers: control transfers (SETUP, data stage, status stage) with the standard request and + the descriptors read back decoded, so an enumeration reads as a list. + +The bit clock is recovered from the transitions (NRZI, bit stuffing after six 1s). SE0 ends a +packet (EOP) or, at 2.5 us and longer, resets the bus. Full speed idles with D+ high, low speed +with D- high. Full speed needs 48 MS/s (decodes from about 32 MS/s), low speed 6 MS/s. +""" + +from __future__ import annotations + +import dataclasses +from dataclasses import dataclass, field +from typing import Dict, List, Optional, Sequence, Tuple + +FULL_SPEED_BPS = 12e6 +LOW_SPEED_BPS = 1.5e6 +RESET_US = 2.5 + +_SE0, _J, _K, _SE1 = 0, 1, 2, 3 + + +@dataclass +class UsbPacket: + """One packet, or a bus event: ``kind`` is ``packet``, ``reset``, ``keep_alive`` or ``se1``.""" + + index: int + start_us: float + end_us: float + kind: str + pid: str = "" + pid_value: int = 0 + addr: Optional[int] = None + endpoint: Optional[int] = None + frame: Optional[int] = None + data_hex: str = "" + crc: str = "" + ok: bool = True + error: str = "" + data: bytes = field(default=b"", repr=False) + + +@dataclass +class UsbSetup: + """A SETUP packet's 8 bytes, decoded.""" + + bm_request_type: int + b_request: int + w_value: int + w_index: int + w_length: int + direction: str + type: str + recipient: str + name: str + summary: str + + +@dataclass +class UsbTransaction: + """A token, its data packet and handshake. Repeated NAKed polls merge into one (``count``).""" + + index: int + start_us: float + end_us: float + type: str + addr: int = 0 + endpoint: int = 0 + data_pid: str = "" + data_hex: str = "" + data_len: int = 0 + handshake: str = "" + count: int = 1 + setup: Optional[UsbSetup] = None + packets: List[int] = field(default_factory=list) + ok: bool = True + error: str = "" + data: bytes = field(default=b"", repr=False) + + +@dataclass +class UsbTransfer: + """One control transfer; ``status`` is ``OK``, ``STALL`` or ``incomplete``.""" + + index: int + start_us: float + end_us: float + addr: int + endpoint: int + request: str + setup: UsbSetup + data_hex: str = "" + data_len: int = 0 + status: str = "" + detail: str = "" + ok: bool = False + data: bytes = field(default=b"", repr=False) + + +@dataclass +class UsbDecode: + """The whole decode, in the shape of the server's ``POST /analyzer/decode`` for ``usb``.""" + + speed: str + packets: List[UsbPacket] = field(default_factory=list) + transactions: List[UsbTransaction] = field(default_factory=list) + transfers: List[UsbTransfer] = field(default_factory=list) + sof_count: int = 0 + keep_alive_count: int = 0 + error_count: int = 0 + protocol: str = "usb" + + def __len__(self) -> int: + return len(self.packets) + + def as_dict(self) -> dict: + """JSON-ready, with the server's keys (no raw ``data`` bytes, no empty optional fields).""" + + def clean(obj): + d = dataclasses.asdict(obj) + d.pop("data", None) + return d + + out = {"protocol": "usb", "speed": self.speed, "sof_count": self.sof_count, + "keep_alive_count": self.keep_alive_count, "error_count": self.error_count} + out["packets"] = [{k: v for k, v in clean(p).items() if v not in (None, "")} for p in self.packets] + out["transactions"] = [clean(t) for t in self.transactions] + out["transfers"] = [clean(t) for t in self.transfers] + return out + + +def decode_usb(words: Sequence[int], *, dp: int, dm: int, sample_rate_hz: float, + speed: str = "auto") -> UsbDecode: + """Decode USB from LA channels ``dp`` (D+) and ``dm`` (D-), 1-based. + + ``speed`` is ``full``, ``low`` or ``auto`` (from the idle state). + """ + if not (1 <= dp <= 14 and 1 <= dm <= 14) or dp == dm: + raise ValueError("usb decode needs two different channels for D+ and D- in 1..14") + if sample_rate_hz <= 0: + raise ValueError("usb decode needs a positive sample rate") + sp = (speed or "auto").strip().lower() + if sp == "auto": + sp = _detect_speed(words, dp, dm) + elif sp in ("full", "fs", "12m"): + sp = "full" + elif sp in ("low", "ls", "1.5m"): + sp = "low" + else: + raise ValueError(f"usb speed must be full, low or auto, got {speed!r}") + bps = LOW_SPEED_BPS if sp == "low" else FULL_SPEED_BPS + spb = sample_rate_hz / bps + if spb < 2: + need = "6 MS/s" if sp == "low" else "48 MS/s" + raise ValueError(f"sample rate {sample_rate_hz:.0f} Hz is too low for {sp}-speed USB: " + f"capture at {need} or more") + runs = _merge_glitches(_runs(words, dp, dm, sp == "low"), spb) + res = UsbDecode(speed=sp) + _packets(res, runs, spb, 1e6 / sample_rate_hz) + res.transactions = _transactions(res.packets) + res.transfers = _transfers(res.transactions) + res.error_count = sum(1 for p in res.packets if not p.ok) + return res + + +def _detect_speed(words: Sequence[int], dp: int, dm: int) -> str: + pb, mb = dp - 1, dm - 1 + dp_high = dm_high = 0 + for w in words: + p, m = (w >> pb) & 1, (w >> mb) & 1 + if p and not m: + dp_high += 1 + elif m and not p: + dm_high += 1 + return "low" if dm_high > dp_high * 3 // 2 else "full" + + +def _runs(words: Sequence[int], dp: int, dm: int, low: bool) -> List[List[float]]: + """Runs of one line state: [state, start sample, samples].""" + pb, mb = dp - 1, dm - 1 + j_state, k_state = (_K, _J) if low else (_J, _K) + runs: List[List[float]] = [] + prev_w = None + for i, w in enumerate(words): + if w == prev_w: + runs[-1][2] += 1 + continue + prev_w = w + p, m = (w >> pb) & 1, (w >> mb) & 1 + s = _SE1 if p and m else j_state if p else k_state if m else _SE0 + if runs and runs[-1][0] == s: + runs[-1][2] += 1 + else: + runs.append([s, float(i), 1.0]) + return runs + + +def _merge_glitches(runs: List[List[float]], spb: float) -> List[List[float]]: + """Fold the short SE0/SE1 the lines show while they cross into their neighbors.""" + limit = max(1.0, float(int(spb / 2))) + out: List[List[float]] = [] + i = 0 + while i < len(runs): + r = runs[i] + short = r[0] in (_SE0, _SE1) and r[2] <= limit + if short and out and i + 1 < len(runs) and out[-1][0] in (_J, _K): + prev, nxt = out[-1], runs[i + 1] + if nxt[0] == prev[0]: + prev[2] += r[2] + nxt[2] + i += 2 + continue + if nxt[0] in (_J, _K): + prev[2] += r[2] / 2 + nxt[1] -= r[2] / 2 + nxt[2] += r[2] / 2 + i += 1 + continue + if out and out[-1][0] == r[0]: + out[-1][2] += r[2] + else: + out.append(list(r)) + i += 1 + return out + + +def _join(a: str, b: str) -> str: + return b if not a else f"{a}, {b}" + + +def _hex(b: bytes) -> str: + return " ".join(f"{v:02X}" for v in b) + + +_PID_NAMES = {0x1: "OUT", 0x9: "IN", 0x5: "SOF", 0xD: "SETUP", 0x3: "DATA0", 0xB: "DATA1", + 0x7: "DATA2", 0xF: "MDATA", 0x2: "ACK", 0xA: "NAK", 0xE: "STALL", 0x6: "NYET", + 0xC: "PRE", 0x8: "SPLIT", 0x4: "PING", 0x0: "RESERVED"} +_DATA = ("DATA0", "DATA1", "DATA2", "MDATA") +_HANDSHAKE = ("ACK", "NAK", "STALL", "NYET") + + +def crc5_field(field_: int) -> int: + """The CRC5 of an 11-bit token field as it sits in the packet's bits 11-15.""" + crc = 0x1F + for b in range(11): + bit = (field_ >> b) & 1 + crc = (((crc << 1) ^ 0x05) if ((crc >> 4) & 1) ^ bit else (crc << 1)) & 0x1F + crc = ~crc & 0x1F + return int(f"{crc:05b}"[::-1], 2) + + +def crc16(data: bytes) -> int: + """The data packet CRC16, sent low byte first.""" + crc = 0xFFFF + for b in data: + crc ^= b + for _ in range(8): + crc = (crc >> 1) ^ 0xA001 if crc & 1 else crc >> 1 + return ~crc & 0xFFFF + + +def _packets(res: UsbDecode, runs: List[List[float]], spb: float, us: float) -> None: + reset_samples = RESET_US / us + + def add(p: UsbPacket) -> None: + p.index = len(res.packets) + 1 + res.packets.append(p) + + i, n = 0, len(runs) + while i < n: + st, start, length = runs[i] + if st == _J: + i += 1 + continue + if st == _SE1: + if length > spb: + add(UsbPacket(0, start * us, (start + length) * us, "se1", ok=False, + error="SE1: D+ and D- both high")) + i += 1 + continue + if st == _SE0: + if length >= reset_samples: + add(UsbPacket(0, start * us, (start + length) * us, "reset")) + elif i > 0 and runs[i - 1][0] == _J and res.speed == "low": + res.keep_alive_count += 1 + add(UsbPacket(0, start * us, (start + length) * us, "keep_alive")) + i += 1 + continue + if i == 0: + while i < n and runs[i][0] != _SE0: + i += 1 + continue + if runs[i - 1][0] not in (_J, _SE0): + i += 1 + continue + j = i + while j < n and runs[j][0] in (_J, _K): + if runs[j][0] == _J and runs[j][2] > 8.5 * spb: + break + j += 1 + end = j + p = _packet_from_runs(runs[i:end], spb) + p.start_us = runs[i][1] * us + last = runs[end - 1] + end_sample = last[1] + last[2] + if end < n and runs[end][0] == _SE0 and runs[end][2] < reset_samples: + end_sample = runs[end][1] + runs[end][2] + elif end >= n: + p.ok = False + p.error = _join(p.error, "capture ended inside the packet") + elif runs[end][0] != _SE0: + p.ok = False + p.error = _join(p.error, "no EOP") + p.end_us = end_sample * us + if p.pid == "SOF": + res.sof_count += 1 + add(p) + i = end + if end < n and runs[end][0] == _SE0 and runs[end][2] < reset_samples: + i += 1 + + +def _packet_from_runs(runs: List[List[float]], spb: float) -> UsbPacket: + p = UsbPacket(0, 0.0, 0.0, "packet") + raw: List[int] = [] + for r in runs: + nb = max(1, int(_round(r[2] / spb))) + raw.append(0) + raw.extend([1] * (nb - 1)) + bits: List[int] = [] + ones = 0 + stuff_err = False + for b in raw: + if ones == 6: + ones = 0 + if b == 0: + continue + stuff_err = True + bits.append(b) + ones = ones + 1 if b else 0 + z = 0 + while z < len(bits) and bits[z] == 0: + z += 1 + if z >= len(bits): + p.ok, p.error = False, "no SYNC" + return p + err = "" + if z < 3 or z > 7: + err = _join(err, "bad SYNC") + payload = bits[z + 1:] + n_bytes, left = divmod(len(payload), 8) + if left > 1: + err = _join(err, "partial byte") + if stuff_err: + err = _join(err, "bit stuffing") + data = bytes(sum(payload[k * 8 + b] << b for b in range(8)) for k in range(n_bytes)) + if not data: + p.ok, p.error = False, _join(err, "no PID") + return p + pid = data[0] + p.pid_value = pid + p.pid = _PID_NAMES[pid & 0xF] + if pid >> 4 != (~pid) & 0xF: + err = _join(err, "bad PID check") + body = data[1:] + if p.pid in ("OUT", "IN", "SETUP", "PING", "SOF"): + if len(body) != 2: + err = _join(err, f"bad length: {len(body)} bytes after the PID, want 2") + else: + w = body[0] | body[1] << 8 + fld, crc = w & 0x7FF, w >> 11 + p.crc = f"0x{crc:02X}" + if p.pid == "SOF": + p.frame = fld + else: + p.addr, p.endpoint = fld & 0x7F, fld >> 7 + if crc5_field(fld) != crc: + err = _join(err, "bad CRC5") + elif p.pid in _DATA: + if len(body) < 2: + err = _join(err, "bad length: no CRC16") + else: + pay = bytes(body[:-2]) + got = body[-2] | body[-1] << 8 + p.crc = f"0x{got:04X}" + p.data = pay + p.data_hex = _hex(pay) + if crc16(pay) != got: + err = _join(err, "bad CRC16") + elif p.pid in _HANDSHAKE and body: + err = _join(err, f"bad length: {len(body)} bytes after a handshake") + p.error = err + p.ok = not err + return p + + +def _round(x: float) -> float: + """Round half away from zero, as Go's math.Round (Python's round() goes to even).""" + return float(int(x + 0.5)) if x >= 0 else -float(int(-x + 0.5)) + + +def _transactions(pk: List[UsbPacket]) -> List[UsbTransaction]: + out: List[UsbTransaction] = [] + lst = [p for p in pk if p.kind != "keep_alive" and p.pid != "SOF"] + + def add(t: UsbTransaction) -> None: + if out and t.handshake == "NAK" and t.ok and t.data_len == 0 and t.setup is None: + prev = out[-1] + if (prev.handshake == "NAK" and prev.ok and prev.type == t.type and prev.addr == t.addr + and prev.endpoint == t.endpoint and prev.data_len == 0): + prev.count += 1 + prev.end_us = t.end_us + prev.packets.extend(t.packets) + return + t.index = len(out) + 1 + out.append(t) + + li = 0 + while li < len(lst): + p = lst[li] + nxt = lst[li + 1] if li + 1 < len(lst) and lst[li + 1].kind == "packet" else None + if p.kind == "reset": + add(UsbTransaction(0, p.start_us, p.end_us, "RESET", packets=[p.index])) + elif p.kind != "packet": + add(UsbTransaction(0, p.start_us, p.end_us, p.kind.upper(), packets=[p.index], ok=False, + error=p.error)) + elif p.pid in ("SETUP", "OUT", "IN", "PING"): + t = UsbTransaction(0, p.start_us, p.end_us, p.pid, packets=[p.index], ok=p.ok, error=p.error) + if p.addr is not None: + t.addr, t.endpoint = p.addr, p.endpoint or 0 + if p.pid != "PING": + if nxt is not None and nxt.pid in _DATA: + li += 1 + t.data_pid, t.data, t.data_hex, t.data_len = nxt.pid, nxt.data, nxt.data_hex, len(nxt.data) + t.end_us = nxt.end_us + t.packets.append(nxt.index) + if not nxt.ok: + t.ok = False + t.error = _join(t.error, f"{nxt.pid}: {nxt.error}") + elif p.pid != "IN": + t.ok = False + t.error = _join(t.error, "no data packet") + nxt = lst[li + 1] if li + 1 < len(lst) and lst[li + 1].kind == "packet" else None + if nxt is not None and nxt.pid in _HANDSHAKE: + li += 1 + t.handshake = nxt.pid + t.end_us = nxt.end_us + t.packets.append(nxt.index) + if not nxt.ok: + t.ok = False + t.error = _join(t.error, f"{nxt.pid}: {nxt.error}") + if p.pid == "SETUP" and len(t.data) == 8: + t.setup = parse_setup(t.data) + add(t) + else: + t = UsbTransaction(0, p.start_us, p.end_us, p.pid, packets=[p.index], ok=False, + error=_join(p.error, f"no token before {p.pid}")) + if p.pid in _DATA: + t.data_pid, t.data, t.data_hex, t.data_len = p.pid, p.data, p.data_hex, len(p.data) + add(t) + li += 1 + return out + + +_STD_REQUESTS = {0: "GET_STATUS", 1: "CLEAR_FEATURE", 3: "SET_FEATURE", 5: "SET_ADDRESS", + 6: "GET_DESCRIPTOR", 7: "SET_DESCRIPTOR", 8: "GET_CONFIGURATION", + 9: "SET_CONFIGURATION", 10: "GET_INTERFACE", 11: "SET_INTERFACE", 12: "SYNCH_FRAME"} +_CLASS_REQUESTS = {0x01: "GET_REPORT", 0x02: "GET_IDLE", 0x03: "GET_PROTOCOL", 0x09: "SET_REPORT", + 0x0A: "SET_IDLE", 0x0B: "SET_PROTOCOL", 0x20: "SET_LINE_CODING", + 0x21: "GET_LINE_CODING", 0x22: "SET_CONTROL_LINE_STATE", 0x23: "SEND_BREAK", + 0xFE: "GET_MAX_LUN", 0xFF: "BULK_ONLY_RESET"} +_DESC_TYPES = {1: "DEVICE", 2: "CONFIGURATION", 3: "STRING", 4: "INTERFACE", 5: "ENDPOINT", + 6: "DEVICE_QUALIFIER", 7: "OTHER_SPEED_CONFIGURATION", 8: "INTERFACE_POWER", + 0x0B: "INTERFACE_ASSOCIATION", 0x0F: "BOS", 0x21: "HID", 0x22: "HID_REPORT", 0x29: "HUB"} + + +def _desc_name(t: int) -> str: + return _DESC_TYPES.get(t, f"type 0x{t:02X}") + + +def parse_setup(d: bytes) -> UsbSetup: + """Decode a SETUP packet's 8 bytes.""" + rt, rq = d[0], d[1] + value, index, length = d[2] | d[3] << 8, d[4] | d[5] << 8, d[6] | d[7] << 8 + direction = "in" if rt & 0x80 else "out" + typ = ("standard", "class", "vendor", "reserved")[(rt >> 5) & 3] + recipient = {0: "device", 1: "interface", 2: "endpoint"}.get(rt & 0x1F, "other") + if typ == "standard": + name = _STD_REQUESTS.get(rq, f"request 0x{rq:02X}") + elif typ == "class": + name = f"class {_CLASS_REQUESTS[rq]}" if rq in _CLASS_REQUESTS else f"class request 0x{rq:02X}" + else: + name = f"{typ} request 0x{rq:02X}" + s = name + if typ == "standard": + if rq in (6, 7): + dt, di = value >> 8, value & 0xFF + s += " " + _desc_name(dt) + if di != 0 or dt == 3: + s += f" index {di}" + if dt == 3 and index != 0: + s += f" lang 0x{index:04X}" + elif rq in (5, 9): + s += f" {value}" + elif rq == 11: + s += f" interface {index} alt {value}" + elif rq in (1, 3): + if recipient == "endpoint" and value == 0: + s += f" ENDPOINT_HALT ep 0x{index:02X}" + elif recipient == "device" and value == 1: + s += " DEVICE_REMOTE_WAKEUP" + else: + s += f" {value}" + elif rq in (0, 10) and recipient != "device": + s += f" {recipient} {index}" + if rq in (6, 0, 8, 10): + s += f" length {length}" + else: + s += f" value 0x{value:04X} index 0x{index:04X} length {length}" + return UsbSetup(rt, rq, value, index, length, direction, typ, recipient, name, s) + + +def _transfers(tx: List[UsbTransaction]) -> List[UsbTransfer]: + out: List[UsbTransfer] = [] + # (addr, endpoint) -> [transfer, last data PID, got data, data stage done, data] + open_: Dict[Tuple[int, int], list] = {} + + def finish(k: Tuple[int, int], status: str) -> None: + p = open_.pop(k, None) + if p is None: + return + t: UsbTransfer = p[0] + t.data = bytes(p[4]) + t.status, t.ok = status, status == "OK" + t.data_len, t.data_hex = len(t.data), _hex(t.data) + if t.ok and t.setup.direction == "in": + t.detail = describe(t.setup, t.data) + out.append(t) + + for t in tx: + if t.type == "RESET": + for k in list(open_): + finish(k, "incomplete") + continue + k = (t.addr, t.endpoint) + if t.type == "SETUP": + if t.setup is None or t.handshake != "ACK" or not t.ok: + continue + if k in open_: + finish(k, "incomplete") + open_[k] = [UsbTransfer(0, t.start_us, t.end_us, t.addr, t.endpoint, t.setup.summary, t.setup), + "", False, t.setup.w_length == 0, bytearray()] + continue + p = open_.get(k) + if p is None or t.type not in ("IN", "OUT") or not t.ok: + continue + xfer: UsbTransfer = p[0] + data_dir = xfer.setup.direction.upper() + if t.handshake == "STALL": + xfer.end_us = t.end_us + finish(k, "STALL") + continue + if t.handshake != "ACK": + continue + if not p[3] and t.type == data_dir: + if not (p[2] and t.data_pid == p[1]): + p[4].extend(t.data) + p[2], p[1] = True, t.data_pid + xfer.end_us = t.end_us + if len(p[4]) >= xfer.setup.w_length: + p[3] = True + continue + if (t.type != data_dir or p[3]) and t.data_len == 0 and (t.type != data_dir or xfer.setup.w_length == 0): + xfer.end_us = t.end_us + finish(k, "OK") + for k in list(open_): + finish(k, "incomplete") + out.sort(key=lambda x: x.start_us) + for n, x in enumerate(out): + x.index = n + 1 + return out + + +def describe(s: UsbSetup, d: bytes) -> str: + """A descriptor that GET_DESCRIPTOR read back, decoded.""" + if s.type != "standard" or s.b_request != 6 or len(d) < 2: + return "" + dt = s.w_value >> 8 + if dt == 1: + if len(d) < 8: + return "" + parts = [f"USB {d[3]:x}.{d[2]:02x}"] + if d[4]: + parts.append(f"class 0x{d[4]:02X}") + parts.append(f"max packet {d[7]}") + if len(d) >= 12: + parts.append(f"VID 0x{d[8] | d[9] << 8:04X} PID 0x{d[10] | d[11] << 8:04X}") + if len(d) >= 18: + parts.append(f"{d[17]} configuration(s)") + return ", ".join(parts) + if dt == 2: + if len(d) < 9: + return "" + parts = [f"total length {d[2] | d[3] << 8}, {d[4]} interface(s), {d[8] * 2} mA"] + o = d[0] + while o + 1 < len(d) and d[o] >= 2: + ln = d[o] + if o + ln > len(d): + break + if d[o + 1] == 4 and ln >= 9: + parts.append(f"interface {d[o + 2]} alt {d[o + 3]} class 0x{d[o + 5]:02X}") + elif d[o + 1] == 5 and ln >= 7: + kind = ("control", "isochronous", "bulk", "interrupt")[d[o + 3] & 3] + parts.append(f"endpoint 0x{d[o + 2]:02X} {kind} {d[o + 4] | d[o + 5] << 8} bytes") + o += ln + return "; ".join(parts) + if dt == 3: + units = [d[o] | d[o + 1] << 8 for o in range(2, len(d) - 1, 2) if o + 1 < d[0]] + if s.w_value & 0xFF == 0: + return "languages " + " ".join(f"0x{u:04X}" for u in units) + text = "".join(chr(u) for u in units) + return '"' + text.replace("\\", "\\\\").replace('"', '\\"') + '"' + return "" + + +def format_transfers(res: UsbDecode) -> List[str]: + """One line per control transfer: what an enumeration looks like.""" + lines = [] + for t in res.transfers: + line = f"{t.start_us / 1e6:.6f}s addr {t.addr} {t.request}: {t.status}" + if t.detail: + line += f" ({t.detail})" + elif t.data_hex: + line += f" data {t.data_hex}" + lines.append(line) + return lines + + +def format_transactions(res: UsbDecode) -> List[str]: + """One line per transaction (token, data, handshake), NAKed polls merged.""" + lines = [] + for t in res.transactions: + if t.type == "RESET": + lines.append(f"{t.start_us / 1e6:.6f}s bus reset {t.end_us - t.start_us:.1f} us") + continue + line = f"{t.start_us / 1e6:.6f}s {t.type} addr {t.addr} ep {t.endpoint}" + if t.data_pid: + line += f" {t.data_pid} [{t.data_len}] {t.data_hex}".rstrip() + line += f" {t.handshake or 'no handshake'}" + if t.count > 1: + line += f" x{t.count}" + if t.setup is not None: + line += f" ({t.setup.summary})" + if not t.ok: + line += f" error={t.error}" + lines.append(line) + return lines diff --git a/packages/embeddedci/tests/api_surface.json b/packages/embeddedci/tests/api_surface.json index 49311ef..c5e60ac 100644 --- a/packages/embeddedci/tests/api_surface.json +++ b/packages/embeddedci/tests/api_surface.json @@ -122,7 +122,7 @@ "current_out_range": "(self) -> 'CurrentOutput'", "dac_output": "(self, path: 'DacOutputPath', *, volts: 'Optional[float]' = None) -> 'DacOutput'", "dac_stop": "(self) -> 'None'", - "decode": "(self, source: 'Union[LaCapture, Sequence[int]]', protocol: 'DecodeProtocol' = 'i2c', *, sample_rate_hz: 'Optional[float]' = None, **channels: 'Any') -> 'list'", + "decode": "(self, source: 'Union[LaCapture, Sequence[int]]', protocol: 'DecodeProtocol' = 'i2c', *, sample_rate_hz: 'Optional[float]' = None, **channels: 'Any') -> 'Any'", "delete_wiring": "(self, name: 'str') -> 'None'", "diag": "(self) -> 'Dict[str, Any]'", "disable_pulldown": "(self, *las: 'Union[Pin, int]') -> 'None'", @@ -472,7 +472,7 @@ "DacPinoutMismatchError": { "__init__": "(self, message: 'str', *, cmd: 'Optional[str]' = None, digital: 'str' = '', module: 'str' = '') -> 'None'" }, - "DecodeProtocol": "Literal['i2c', 'uart', 'spi']", + "DecodeProtocol": "Literal['i2c', 'uart', 'spi', 'usb']", "DefinitionError": { "__init__": "(self, message: 'str', *, path: 'Optional[str]' = None) -> 'None'" }, @@ -1259,6 +1259,19 @@ ], "from_reply": "(cls, reply: 'Any') -> \"'UsbCcStatus'\"" }, + "UsbDecode": { + "__fields__": [ + "speed", + "packets", + "transactions", + "transfers", + "sof_count", + "keep_alive_count", + "error_count", + "protocol" + ], + "as_dict": "(self) -> 'dict'" + }, "Waveform": { "__fields__": [ "id", @@ -1501,6 +1514,7 @@ "UartTimeout", "UnsupportedFeatureError", "UsbCcStatus", + "UsbDecode", "Waveform", "WaveformLibrary", "Waveshape", diff --git a/packages/embeddedci/tests/test_usb_decode.py b/packages/embeddedci/tests/test_usb_decode.py new file mode 100644 index 0000000..8a711fa --- /dev/null +++ b/packages/embeddedci/tests/test_usb_decode.py @@ -0,0 +1,117 @@ +"""USB decode: Go<->Python parity and the decoder's own checks. + +``tests/testdata/usb_decode_vectors.json`` is a byte-identical copy of the EmbeddedCI server's +``testdata/shared/usb_decode_vectors.json``: synthetic full- and low-speed enumerations (NRZI, bit +stuffing, jitter, D+/D- skew, clock error) as run-length edges, and what the Go decoder +(``USBFromLA``) makes of them. Python must decode them the same, field for field. +""" + +from __future__ import annotations + +import json +import math +from pathlib import Path + +import pytest + +from embeddedci.benchpod.decode import decode +from embeddedci.benchpod.results import LaCapture +from embeddedci.benchpod.usb_decode import ( + crc5_field, + crc16, + decode_usb, + format_transactions, + format_transfers, +) + +VECTORS = Path(__file__).resolve().parent / "testdata" / "usb_decode_vectors.json" + + +def _cases(): + return json.loads(VECTORS.read_text())["cases"] + + +def _words(case) -> list: + words = [0] * case["count"] + edges = case["edges"] + for k, (at, w) in enumerate(edges): + end = edges[k + 1][0] if k + 1 < len(edges) else case["count"] + words[at:end] = [w] * (end - at) + return words + + +def _close(a, b, path="") -> None: + if isinstance(b, dict): + assert isinstance(a, dict) and set(a) == set(b), f"{path}: keys {sorted(a)} != {sorted(b)}" + for k in b: + _close(a[k], b[k], f"{path}.{k}") + elif isinstance(b, list): + assert isinstance(a, list) and len(a) == len(b), f"{path}: {len(a)} items, want {len(b)}" + for k, (x, y) in enumerate(zip(a, b)): + _close(x, y, f"{path}[{k}]") + elif isinstance(b, float) or isinstance(a, float): + assert math.isclose(a, b, rel_tol=1e-9, abs_tol=1e-9), f"{path}: {a} != {b}" + else: + assert a == b, f"{path}: {a!r} != {b!r}" + + +def _go_shape(d: dict) -> dict: + """The Go JSON leaves out empty optional fields: do the same for transactions/transfers.""" + for t in d["transactions"]: + for k in ("data_pid", "data_hex", "handshake", "error", "setup"): + if t.get(k) in ("", None): + t.pop(k, None) + for t in d["transfers"]: + for k in ("data_hex", "detail"): + if t.get(k) == "": + t.pop(k) + return d + + +@pytest.mark.parametrize("case", _cases(), ids=lambda c: c["name"]) +def test_go_parity(case): + p = case["params"] + res = decode_usb(_words(case), dp=p["dp"], dm=p["dm"], sample_rate_hz=case["sample_rate_hz"], + speed=p["speed"]) + _close(_go_shape(res.as_dict()), case["expect"]) + + +def test_crc(): + assert crc5_field(0) == 0x02 # SETUP 0/0 is 2D 00 10 on the wire + assert crc16(b"123456789") == 0xB4C8 + assert crc16(b"") == 0 + + +def test_enumeration_reads_as_a_list(): + case = _cases()[0] + cap = LaCapture(words=_words(case), sample_rate_hz=case["sample_rate_hz"]) + res = cap.decode("usb", dp=1, dm=2) + assert res.speed == "full" and res.error_count == 0 + lines = format_transfers(res) + assert any("SET_ADDRESS 5: OK" in ln for ln in lines) + assert any("VID 0x0483 PID 0x5740" in ln for ln in lines) + assert any('"BenchPod"' in ln for ln in lines) + assert any("class SET_IDLE" in ln and "STALL" in ln for ln in lines) + assert any("bus reset" in ln for ln in format_transactions(res)) + + +def test_errors_flagged_per_packet(): + case = next(c for c in _cases() if "errors" in c["name"]) + res = decode(_words(case), "usb", sample_rate_hz=case["sample_rate_hz"], dp=1, dm=2, speed="full") + assert [p.error for p in res.packets[:2]] == ["bad CRC16", "bad PID check"] + assert res.packets[-1].pid == "NAK" and res.packets[-1].ok + + +@pytest.mark.parametrize("kwargs, msg", [ + ({"dp": 1, "dm": 1, "sample_rate_hz": 48e6}, "two different channels"), + ({"dp": 1, "dm": 2, "sample_rate_hz": 12e6, "speed": "full"}, "48 MS/s"), + ({"dp": 1, "dm": 2, "sample_rate_hz": 48e6, "speed": "high"}, "full, low or auto"), +]) +def test_bad_arguments(kwargs, msg): + with pytest.raises(ValueError, match=msg): + decode_usb([], **kwargs) + + +def test_se0_only_is_a_reset(): + res = decode_usb([0] * 200, dp=1, dm=2, sample_rate_hz=48e6) + assert [p.kind for p in res.packets] == ["reset"] diff --git a/packages/embeddedci/tests/testdata/usb_decode_vectors.json b/packages/embeddedci/tests/testdata/usb_decode_vectors.json new file mode 100644 index 0000000..890329e --- /dev/null +++ b/packages/embeddedci/tests/testdata/usb_decode_vectors.json @@ -0,0 +1 @@ +{"_comment":"Shared USB decode parity vectors: synthetic D+/D- captures as run-length edges [sample, word] from sample 0, the decoder parameters and the expected result. Generated from the Go decoder (USBFromLA); verified by the Go server and the Python SDK (decode_usb).","cases":[{"name":"full_speed_enumeration_48msps_jitter","sample_rate_hz":48000000,"params":{"dp":1,"dm":2,"speed":"auto"},"count":39273,"edges":[[0,1],[400,0],[2794,1],[3432,2],[3436,1],[3440,2],[3444,1],[3448,2],[3452,1],[3456,2],[3468,1],[3476,2],[3480,1],[3488,2],[3496,1],[3500,2],[3508,1],[3512,2],[3524,1],[3527,3],[3528,2],[3531,0],[3532,1],[3536,2],[3560,0],[3568,1],[3747,2],[3751,1],[3755,2],[3759,1],[3763,2],[3767,1],[3771,2],[3783,1],[3795,2],[3803,1],[3807,2],[3811,1],[3815,2],[3819,1],[3823,2],[3827,1],[3831,2],[3835,1],[3839,2],[3843,1],[3847,2],[3851,1],[3855,2],[3863,1],[3867,2],[3871,1],[3875,0],[3883,1],[3903,2],[3906,0],[3907,1],[3911,2],[3914,0],[3915,1],[3918,3],[3919,2],[3923,1],[3926,3],[3927,2],[3942,0],[3943,1],[3947,2],[3951,1],[3955,2],[3967,1],[3970,3],[3971,2],[3974,0],[3975,1],[3979,2],[3983,1],[3987,2],[3991,1],[3998,2],[4010,0],[4011,1],[4015,2],[4019,1],[4022,2],[4026,0],[4027,1],[4030,3],[4031,2],[4034,0],[4035,1],[4038,3],[4039,2],[4042,0],[4043,1],[4046,3],[4047,2],[4050,1],[4054,2],[4058,0],[4059,1],[4066,3],[4067,2],[4070,1],[4074,2],[4078,1],[4082,2],[4086,1],[4090,2],[4094,1],[4098,2],[4102,1],[4106,2],[4110,1],[4114,2],[4118,1],[4122,2],[4126,1],[4130,2],[4134,1],[4138,2],[4142,1],[4146,2],[4150,1],[4154,2],[4158,1],[4162,2],[4166,1],[4170,2],[4174,1],[4178,2],[4186,1],[4190,2],[4194,1],[4198,2],[4202,1],[4206,2],[4210,1],[4214,2],[4218,1],[4226,2],[4242,1],[4254,2],[4258,1],[4266,2],[4274,1],[4278,2],[4286,0],[4294,1],[4313,3],[4314,2],[4318,1],[4322,2],[4326,1],[4329,3],[4330,2],[4334,1],[4337,3],[4338,2],[4345,0],[4346,1],[4354,2],[4357,0],[4358,1],[4366,2],[4377,0],[4385,1],[4565,2],[4569,1],[4573,2],[4577,1],[4581,2],[4585,1],[4589,2],[4601,1],[4605,2],[4613,1],[4625,2],[4629,1],[4633,2],[4637,1],[4641,2],[4645,1],[4649,2],[4653,1],[4657,2],[4661,1],[4665,2],[4669,1],[4673,2],[4681,1],[4685,2],[4689,1],[4693,0],[4701,1],[4721,2],[4725,1],[4729,2],[4733,1],[4737,2],[4741,1],[4745,2],[4753,1],[4760,3],[4761,2],[4772,1],[4780,2],[4784,0],[4793,1],[4972,2],[4976,1],[4980,2],[4984,1],[4988,2],[4992,1],[4996,2],[5008,1],[5012,2],[5020,1],[5032,2],[5036,1],[5040,2],[5044,1],[5048,2],[5052,1],[5056,2],[5060,1],[5064,2],[5068,1],[5072,2],[5076,1],[5080,2],[5087,0],[5088,1],[5092,2],[5096,1],[5100,0],[5108,1],[5128,2],[5132,1],[5135,3],[5136,2],[5140,1],[5144,2],[5148,1],[5152,2],[5159,0],[5160,1],[5167,3],[5168,2],[5179,0],[5180,1],[5187,2],[5191,0],[5200,1],[5379,2],[5383,1],[5387,2],[5391,1],[5395,2],[5399,1],[5403,2],[5415,1],[5419,2],[5427,1],[5439,2],[5443,1],[5447,2],[5451,1],[5455,2],[5459,1],[5463,2],[5467,1],[5471,2],[5475,1],[5479,2],[5483,1],[5486,3],[5487,2],[5495,1],[5498,3],[5499,2],[5503,1],[5507,0],[5515,1],[5535,2],[5538,0],[5539,1],[5543,2],[5547,1],[5550,3],[5551,2],[5554,0],[5555,1],[5559,2],[5575,1],[5582,3],[5583,2],[5587,1],[5594,3],[5595,2],[5598,0],[5599,1],[5606,3],[5607,2],[5611,1],[5619,2],[5622,1],[5626,3],[5627,2],[5634,1],[5638,2],[5642,1],[5646,3],[5647,2],[5650,0],[5651,1],[5654,2],[5658,0],[5659,1],[5662,2],[5666,1],[5670,3],[5671,2],[5674,1],[5678,2],[5682,1],[5686,3],[5687,2],[5690,1],[5694,2],[5702,0],[5703,1],[5706,2],[5710,1],[5714,2],[5718,1],[5722,2],[5726,1],[5730,2],[5734,1],[5738,2],[5742,1],[5746,2],[5750,1],[5754,2],[5758,1],[5762,2],[5766,1],[5770,2],[5774,1],[5778,2],[5782,1],[5786,2],[5790,1],[5794,2],[5798,1],[5802,2],[5806,1],[5810,2],[5814,1],[5818,2],[5822,1],[5826,2],[5830,1],[5838,2],[5842,1],[5846,2],[5850,1],[5866,2],[5874,1],[5882,2],[5898,1],[5902,2],[5918,0],[5926,1],[5945,3],[5946,2],[5950,1],[5954,2],[5957,0],[5958,1],[5961,3],[5962,2],[5966,1],[5970,2],[5977,0],[5978,1],[5986,2],[5990,1],[5997,3],[5998,2],[6009,0],[6018,1],[6197,2],[6201,1],[6205,2],[6209,1],[6213,2],[6217,1],[6221,2],[6233,1],[6237,2],[6241,1],[6245,2],[6261,1],[6265,2],[6269,1],[6273,2],[6277,1],[6281,2],[6285,1],[6289,2],[6293,1],[6297,2],[6301,1],[6305,2],[6312,0],[6313,1],[6317,2],[6321,1],[6325,0],[6333,1],[6352,3],[6353,2],[6357,1],[6360,2],[6365,1],[6368,3],[6369,2],[6372,1],[6377,2],[6393,1],[6401,2],[6404,1],[6412,3],[6413,2],[6416,1],[6420,3],[6421,2],[6424,0],[6425,1],[6428,2],[6432,1],[6436,3],[6437,2],[6440,1],[6444,3],[6445,2],[6448,0],[6449,1],[6452,3],[6453,2],[6456,1],[6460,3],[6461,2],[6464,0],[6465,1],[6468,2],[6472,1],[6476,2],[6480,0],[6488,1],[6508,2],[6512,1],[6516,2],[6520,1],[6524,2],[6528,1],[6532,2],[6540,1],[6548,2],[6552,1],[6560,2],[6572,0],[6580,1],[6760,0],[9154,1],[9792,2],[9796,1],[9800,2],[9804,1],[9808,2],[9812,1],[9816,2],[9828,1],[9840,2],[9848,1],[9852,2],[9856,1],[9860,2],[9864,1],[9868,2],[9872,1],[9876,2],[9880,1],[9884,2],[9888,1],[9892,2],[9896,1],[9900,2],[9908,1],[9912,2],[9916,1],[9920,0],[9928,1],[9948,2],[9951,0],[9952,1],[9955,3],[9956,2],[9960,1],[9963,3],[9964,2],[9967,0],[9968,1],[9971,3],[9972,2],[9987,0],[9988,1],[9992,2],[9995,0],[9996,1],[9999,3],[10000,2],[10011,0],[10012,1],[10015,3],[10016,2],[10019,1],[10023,3],[10024,2],[10027,0],[10028,1],[10031,2],[10035,0],[10036,1],[10039,2],[10047,0],[10048,1],[10055,3],[10056,2],[10059,1],[10063,2],[10067,1],[10071,3],[10072,2],[10079,1],[10087,2],[10091,1],[10095,2],[10099,1],[10103,2],[10107,1],[10111,2],[10115,1],[10119,2],[10123,1],[10127,2],[10131,1],[10135,2],[10139,1],[10143,2],[10147,1],[10151,2],[10155,1],[10159,2],[10163,1],[10167,2],[10171,1],[10175,2],[10179,1],[10183,2],[10187,1],[10191,2],[10195,1],[10199,2],[10203,1],[10207,2],[10211,1],[10215,2],[10219,1],[10223,2],[10227,1],[10231,2],[10235,1],[10239,2],[10243,1],[10247,2],[10251,1],[10255,2],[10259,1],[10263,2],[10267,1],[10275,2],[10283,1],[10303,2],[10306,0],[10307,1],[10311,2],[10315,1],[10322,3],[10323,2],[10331,0],[10339,1],[10359,2],[10362,0],[10363,1],[10366,3],[10367,2],[10371,1],[10375,2],[10378,1],[10382,3],[10383,2],[10390,0],[10391,1],[10398,3],[10399,2],[10402,1],[10410,3],[10411,2],[10422,0],[10431,1],[10610,2],[10614,1],[10618,2],[10622,1],[10626,2],[10630,1],[10634,2],[10646,1],[10650,2],[10658,1],[10670,2],[10674,1],[10678,2],[10682,1],[10686,2],[10690,1],[10694,2],[10698,1],[10702,2],[10706,1],[10710,2],[10713,0],[10714,1],[10718,2],[10726,1],[10730,2],[10734,1],[10738,0],[10746,1],[10765,3],[10766,2],[10769,0],[10770,1],[10773,3],[10774,2],[10777,0],[10778,1],[10781,2],[10786,1],[10790,2],[10805,1],[10814,2],[10817,0],[10818,1],[10825,3],[10826,2],[10829,1],[10833,3],[10834,2],[10837,1],[10841,2],[10845,1],[10849,2],[10853,1],[10857,2],[10861,0],[10862,1],[10865,2],[10869,0],[10870,1],[10873,2],[10877,0],[10878,1],[10881,2],[10885,1],[10889,2],[10893,0],[10902,1],[10921,2],[10925,1],[10929,2],[10933,1],[10937,2],[10941,1],[10945,2],[10953,1],[10961,2],[10965,1],[10973,2],[10985,0],[10993,1],[11172,3],[11173,2],[11177,1],[11180,3],[11181,2],[11185,1],[11188,3],[11189,2],[11193,1],[11196,3],[11197,2],[11208,0],[11209,1],[11216,3],[11217,2],[11220,1],[11228,3],[11229,2],[11240,0],[11241,1],[11248,2],[11252,0],[11253,1],[11264,2],[11268,1],[11272,2],[11276,1],[11280,2],[11284,1],[11288,2],[11292,1],[11296,3],[11297,2],[11300,0],[11308,1],[11488,2],[11492,1],[11496,2],[11500,1],[11504,2],[11508,1],[11512,2],[11524,1],[11536,2],[11544,1],[11548,2],[11555,0],[11556,1],[11563,2],[11567,1],[11571,3],[11572,2],[11575,0],[11576,1],[11580,2],[11583,0],[11584,1],[11587,3],[11588,2],[11591,0],[11592,1],[11595,2],[11603,0],[11604,1],[11616,0],[11624,1],[11643,2],[11647,0],[11648,1],[11651,2],[11655,1],[11659,2],[11663,1],[11667,2],[11683,1],[11687,2],[11691,1],[11695,2],[11707,1],[11711,2],[11715,1],[11719,2],[11723,1],[11727,2],[11731,1],[11739,2],[11751,1],[11755,2],[11759,1],[11763,2],[11767,1],[11771,2],[11775,1],[11779,2],[11783,1],[11787,2],[11791,1],[11795,2],[11799,1],[11807,2],[11811,1],[11815,2],[11819,1],[11823,2],[11827,1],[11831,2],[11835,1],[11839,2],[11843,1],[11847,2],[11851,1],[11855,2],[11859,1],[11863,2],[11867,1],[11871,2],[11875,1],[11879,2],[11883,1],[11887,2],[11891,1],[11895,2],[11899,1],[11907,2],[11911,1],[11918,3],[11919,2],[11922,0],[11923,1],[11926,3],[11927,2],[11931,1],[11935,2],[11939,1],[11942,3],[11943,2],[11946,0],[11947,1],[11950,3],[11951,2],[11955,1],[11959,2],[11963,1],[11966,3],[11967,2],[11970,1],[11974,3],[11975,2],[11979,1],[11995,2],[11998,0],[11999,1],[12006,3],[12007,2],[12027,0],[12035,1],[12054,2],[12058,1],[12062,2],[12066,1],[12070,2],[12074,1],[12078,2],[12086,1],[12094,2],[12098,1],[12106,2],[12118,0],[12126,1],[12306,2],[12310,1],[12314,2],[12317,0],[12318,1],[12322,2],[12326,1],[12330,2],[12342,1],[12345,3],[12346,2],[12354,1],[12365,3],[12366,2],[12373,0],[12374,1],[12382,2],[12386,1],[12389,2],[12394,1],[12397,3],[12398,2],[12401,1],[12405,3],[12406,2],[12409,1],[12413,2],[12421,1],[12433,0],[12441,1],[12461,2],[12465,1],[12469,3],[12470,2],[12473,0],[12474,1],[12477,2],[12481,1],[12485,2],[12493,1],[12501,2],[12513,1],[12521,2],[12525,0],[12533,1],[12713,2],[12717,1],[12721,2],[12725,1],[12729,2],[12732,0],[12733,1],[12737,2],[12748,0],[12749,1],[12753,2],[12760,0],[12761,1],[12772,3],[12773,2],[12780,0],[12781,1],[12788,2],[12792,0],[12793,1],[12796,3],[12797,2],[12801,1],[12804,3],[12805,2],[12808,1],[12812,2],[12816,0],[12817,1],[12820,3],[12821,2],[12829,1],[12840,0],[12849,1],[12868,2],[12872,1],[12876,3],[12877,2],[12880,1],[12884,2],[12888,1],[12892,2],[12900,1],[12908,2],[12920,1],[12928,2],[12932,0],[12940,1],[13120,2],[13123,0],[13124,1],[13128,2],[13131,0],[13132,1],[13136,2],[13140,1],[13144,2],[13156,1],[13159,3],[13160,2],[13168,1],[13180,2],[13187,0],[13188,1],[13195,2],[13199,0],[13200,1],[13203,3],[13204,2],[13208,1],[13211,2],[13215,0],[13216,1],[13219,2],[13224,1],[13227,3],[13228,2],[13235,0],[13236,1],[13248,0],[13255,1],[13275,2],[13279,1],[13283,2],[13287,1],[13291,2],[13295,1],[13299,2],[13315,1],[13323,2],[13327,1],[13335,2],[13339,1],[13347,2],[13351,1],[13359,2],[13363,1],[13367,2],[13375,1],[13379,2],[13383,1],[13387,2],[13391,1],[13395,2],[13399,1],[13403,2],[13407,1],[13411,2],[13415,1],[13419,2],[13423,1],[13427,2],[13431,1],[13435,2],[13443,1],[13447,2],[13451,1],[13455,2],[13459,1],[13463,2],[13467,1],[13471,2],[13475,1],[13479,2],[13483,1],[13487,2],[13490,0],[13491,1],[13495,2],[13499,1],[13503,2],[13507,1],[13511,2],[13515,1],[13519,2],[13523,1],[13527,2],[13531,1],[13535,2],[13539,1],[13542,3],[13543,2],[13546,0],[13547,1],[13551,2],[13555,1],[13559,2],[13563,1],[13567,2],[13570,1],[13578,3],[13579,2],[13582,1],[13586,2],[13591,1],[13607,2],[13614,1],[13622,2],[13638,1],[13642,2],[13658,0],[13666,1],[13686,2],[13690,1],[13694,2],[13698,1],[13702,2],[13706,1],[13710,2],[13718,1],[13726,2],[13730,1],[13738,2],[13750,0],[13758,1],[13937,3],[13938,2],[13942,1],[13946,2],[13949,0],[13950,1],[13954,2],[13958,1],[13961,3],[13962,2],[13973,0],[13974,1],[13978,2],[13986,1],[13998,2],[14005,0],[14006,1],[14013,2],[14017,1],[14021,3],[14022,2],[14025,1],[14029,2],[14033,0],[14034,1],[14037,2],[14041,0],[14042,1],[14045,2],[14053,1],[14065,0],[14073,1],[14093,2],[14097,1],[14101,2],[14105,1],[14109,2],[14113,1],[14117,2],[14133,1],[14137,2],[14141,1],[14145,2],[14165,1],[14169,2],[14173,1],[14177,2],[14181,1],[14189,2],[14193,1],[14201,2],[14205,1],[14209,2],[14213,1],[14217,2],[14221,1],[14225,2],[14229,1],[14233,2],[14237,1],[14241,2],[14249,1],[14265,2],[14273,1],[14281,2],[14285,1],[14289,2],[14293,1],[14297,2],[14301,1],[14305,2],[14309,1],[14313,2],[14321,1],[14325,2],[14328,0],[14329,1],[14333,2],[14337,1],[14340,3],[14341,2],[14345,1],[14353,2],[14356,0],[14357,1],[14360,3],[14361,2],[14364,0],[14365,1],[14369,2],[14372,0],[14373,1],[14376,3],[14377,2],[14380,0],[14381,1],[14389,2],[14393,1],[14396,3],[14397,2],[14400,0],[14401,1],[14404,2],[14408,0],[14409,1],[14412,3],[14413,2],[14416,1],[14420,2],[14432,0],[14433,1],[14436,3],[14437,2],[14440,0],[14441,1],[14444,2],[14448,1],[14464,2],[14476,0],[14484,1],[14504,2],[14508,1],[14512,2],[14516,1],[14520,2],[14524,1],[14528,2],[14536,1],[14544,2],[14548,1],[14556,2],[14568,0],[14576,1],[14756,2],[14760,1],[14764,2],[14767,0],[14768,1],[14772,2],[14775,0],[14776,1],[14779,2],[14792,1],[14795,2],[14804,1],[14815,2],[14824,1],[14831,3],[14832,2],[14835,0],[14836,1],[14839,2],[14843,1],[14847,2],[14851,1],[14855,3],[14856,2],[14859,0],[14860,1],[14863,2],[14871,1],[14883,0],[14891,1],[14911,2],[14915,1],[14919,2],[14923,1],[14927,2],[14931,1],[14935,2],[14951,1],[14955,2],[14959,1],[14963,2],[14983,1],[14987,2],[14991,1],[14995,2],[14999,1],[15007,2],[15011,1],[15019,2],[15023,1],[15027,2],[15031,1],[15035,2],[15039,1],[15043,2],[15047,1],[15051,2],[15055,1],[15059,2],[15067,1],[15083,2],[15091,1],[15099,2],[15103,1],[15107,2],[15111,1],[15115,2],[15119,1],[15123,2],[15126,0],[15127,1],[15130,3],[15131,2],[15139,1],[15142,3],[15143,2],[15146,0],[15147,1],[15150,3],[15151,2],[15154,0],[15155,1],[15159,2],[15163,1],[15170,2],[15174,0],[15175,1],[15179,2],[15183,1],[15187,2],[15190,0],[15191,1],[15194,2],[15199,1],[15206,3],[15207,2],[15210,0],[15211,1],[15215,2],[15218,1],[15222,2],[15226,1],[15230,3],[15231,2],[15234,0],[15235,1],[15238,2],[15250,0],[15251,1],[15254,3],[15255,2],[15258,1],[15262,2],[15266,1],[15282,2],[15294,0],[15302,1],[15322,2],[15326,1],[15330,2],[15334,1],[15338,2],[15342,1],[15346,2],[15354,1],[15362,2],[15366,1],[15374,2],[15386,0],[15394,1],[15574,2],[15577,0],[15578,1],[15581,2],[15586,1],[15589,3],[15590,2],[15593,1],[15597,3],[15598,2],[15609,1],[15613,3],[15614,2],[15621,1],[15633,2],[15641,1],[15649,2],[15653,0],[15654,1],[15657,2],[15661,1],[15665,2],[15669,0],[15670,1],[15673,3],[15674,2],[15677,0],[15678,1],[15681,3],[15682,2],[15689,1],[15702,0],[15709,1],[15729,2],[15733,1],[15737,2],[15741,1],[15745,2],[15749,1],[15753,2],[15769,1],[15777,2],[15781,1],[15789,2],[15801,1],[15805,2],[15809,1],[15813,2],[15817,1],[15821,2],[15829,1],[15833,2],[15837,1],[15841,2],[15845,1],[15849,2],[15853,1],[15881,2],[15885,1],[15889,2],[15917,1],[15925,2],[15929,0],[15937,1],[15957,2],[15960,0],[15961,1],[15964,3],[15965,2],[15969,1],[15973,2],[15977,1],[15981,2],[15988,0],[15989,1],[15997,2],[16000,1],[16009,2],[16020,0],[16029,1],[16208,2],[16212,1],[16216,2],[16220,1],[16224,2],[16228,1],[16232,2],[16244,1],[16248,2],[16252,1],[16256,2],[16276,1],[16284,2],[16288,1],[16292,2],[16296,1],[16300,2],[16304,1],[16308,2],[16312,1],[16316,2],[16324,1],[16336,0],[16344,1],[16364,2],[16368,1],[16371,3],[16372,2],[16375,0],[16376,1],[16380,2],[16384,1],[16387,3],[16388,2],[16403,1],[16411,2],[16416,1],[16423,3],[16424,2],[16427,0],[16428,1],[16431,2],[16435,1],[16439,3],[16440,2],[16443,1],[16447,3],[16448,2],[16451,1],[16455,2],[16459,1],[16463,3],[16464,2],[16467,1],[16471,2],[16475,1],[16479,3],[16480,2],[16483,1],[16487,2],[16491,0],[16499,1],[16519,2],[16523,1],[16527,2],[16531,1],[16535,2],[16539,1],[16543,2],[16551,1],[16559,2],[16563,1],[16571,2],[16583,0],[16591,1],[16771,2],[16775,1],[16778,3],[16779,2],[16782,0],[16783,1],[16786,3],[16787,2],[16791,1],[16794,3],[16795,2],[16806,0],[16807,1],[16818,3],[16819,2],[16826,0],[16827,1],[16830,3],[16831,2],[16838,1],[16846,3],[16847,2],[16850,0],[16851,1],[16854,2],[16858,1],[16862,2],[16866,1],[16870,2],[16874,1],[16878,3],[16879,2],[16886,1],[16898,0],[16906,1],[16926,2],[16930,1],[16934,2],[16938,1],[16942,2],[16946,1],[16950,2],[16966,1],[16970,2],[16974,1],[16978,2],[16990,1],[16994,2],[16998,1],[17002,2],[17006,1],[17010,2],[17014,1],[17022,2],[17034,1],[17038,2],[17042,1],[17046,2],[17050,1],[17054,2],[17058,1],[17062,2],[17066,1],[17070,2],[17074,1],[17078,2],[17082,1],[17086,2],[17094,1],[17098,2],[17102,1],[17106,2],[17110,1],[17114,2],[17118,1],[17122,2],[17126,1],[17130,2],[17133,0],[17134,1],[17138,2],[17142,1],[17146,2],[17150,1],[17153,3],[17154,2],[17158,1],[17162,2],[17165,0],[17166,1],[17169,3],[17170,2],[17173,0],[17174,1],[17177,2],[17185,0],[17186,1],[17189,3],[17190,2],[17198,1],[17202,2],[17206,1],[17209,2],[17213,0],[17214,1],[17218,2],[17221,1],[17225,3],[17226,2],[17229,0],[17230,1],[17233,3],[17234,2],[17237,1],[17241,2],[17245,0],[17246,1],[17261,3],[17262,2],[17269,1],[17277,2],[17281,1],[17289,2],[17293,1],[17297,2],[17301,1],[17305,2],[17309,0],[17317,1],[17337,2],[17341,1],[17345,2],[17349,1],[17353,2],[17357,1],[17361,2],[17369,1],[17377,2],[17381,1],[17389,2],[17401,0],[17409,1],[17588,3],[17589,2],[17593,1],[17597,2],[17600,0],[17601,1],[17605,2],[17609,1],[17612,3],[17613,2],[17624,1],[17628,2],[17636,1],[17648,3],[17649,2],[17656,0],[17657,1],[17664,2],[17668,1],[17672,2],[17676,1],[17680,2],[17684,1],[17688,2],[17692,1],[17696,2],[17704,1],[17716,0],[17724,1],[17744,2],[17748,1],[17752,2],[17756,1],[17760,2],[17764,1],[17768,2],[17776,1],[17784,2],[17796,1],[17804,2],[17808,0],[17816,1],[17995,3],[17996,2],[17999,0],[18000,1],[18004,2],[18007,0],[18008,1],[18012,2],[18015,1],[18019,3],[18020,2],[18031,1],[18035,2],[18043,0],[18044,1],[18055,3],[18056,2],[18063,0],[18064,1],[18071,3],[18072,2],[18075,0],[18076,1],[18079,3],[18080,2],[18083,1],[18087,2],[18091,1],[18095,2],[18099,1],[18103,2],[18111,1],[18123,0],[18131,1],[18151,2],[18155,1],[18159,2],[18163,1],[18167,2],[18171,1],[18175,2],[18183,1],[18191,2],[18203,1],[18211,2],[18215,0],[18223,1],[18402,3],[18403,2],[18406,1],[18410,2],[18414,0],[18415,1],[18418,2],[18423,1],[18426,2],[18438,0],[18439,1],[18442,3],[18443,2],[18450,0],[18451,1],[18462,2],[18470,1],[18478,2],[18482,1],[18486,2],[18490,1],[18494,3],[18495,2],[18498,1],[18502,2],[18506,1],[18510,2],[18518,1],[18530,0],[18538,1],[18558,2],[18562,1],[18566,2],[18570,1],[18574,2],[18578,1],[18582,2],[18598,1],[18606,2],[18610,1],[18618,2],[18626,1],[18630,2],[18638,1],[18642,2],[18646,1],[18650,2],[18654,1],[18662,2],[18666,1],[18670,2],[18674,1],[18678,2],[18682,1],[18686,2],[18694,1],[18698,2],[18702,1],[18710,2],[18714,1],[18717,3],[18718,2],[18722,1],[18726,2],[18730,1],[18734,2],[18738,1],[18742,2],[18746,1],[18753,3],[18754,2],[18757,0],[18758,1],[18761,3],[18762,2],[18765,0],[18766,1],[18769,3],[18770,2],[18773,0],[18774,1],[18777,2],[18786,1],[18789,3],[18790,2],[18794,1],[18797,2],[18801,1],[18805,3],[18806,2],[18809,1],[18813,2],[18817,1],[18821,2],[18826,1],[18829,3],[18830,2],[18833,1],[18837,2],[18841,1],[18845,3],[18846,2],[18849,1],[18853,2],[18857,1],[18861,2],[18865,0],[18866,1],[18869,2],[18885,1],[18893,2],[18897,1],[18901,2],[18905,1],[18909,2],[18913,1],[18917,2],[18921,1],[18925,2],[18929,1],[18937,2],[18941,0],[18949,1],[18969,2],[18973,1],[18977,2],[18981,1],[18985,2],[18989,1],[18993,2],[19001,1],[19009,2],[19013,1],[19021,2],[19033,0],[19041,1],[19220,2],[19224,0],[19225,1],[19228,3],[19229,2],[19232,1],[19236,2],[19240,0],[19241,1],[19244,3],[19245,2],[19256,1],[19260,2],[19268,0],[19269,1],[19280,3],[19281,2],[19288,1],[19296,2],[19300,1],[19304,2],[19308,1],[19312,2],[19316,1],[19320,2],[19324,1],[19328,2],[19336,1],[19348,0],[19356,1],[19376,2],[19380,1],[19384,2],[19388,1],[19392,2],[19396,1],[19400,2],[19416,1],[19420,2],[19424,1],[19428,2],[19440,1],[19448,2],[19452,1],[19464,2],[19468,1],[19476,2],[19480,1],[19484,2],[19488,1],[19492,2],[19504,1],[19512,2],[19520,1],[19532,2],[19536,0],[19544,1],[19563,3],[19564,2],[19568,1],[19571,3],[19572,2],[19575,1],[19580,2],[19583,1],[19587,3],[19588,2],[19595,0],[19596,1],[19603,2],[19607,1],[19615,2],[19628,0],[19636,1],[19815,2],[19819,1],[19823,2],[19827,1],[19831,2],[19835,1],[19839,2],[19851,1],[19855,2],[19859,1],[19863,2],[19883,1],[19891,2],[19895,1],[19899,2],[19903,1],[19907,2],[19911,1],[19915,2],[19919,1],[19923,2],[19931,1],[19943,0],[19951,1],[19971,2],[19974,1],[19978,3],[19979,2],[19982,0],[19983,1],[19987,2],[19990,0],[19991,1],[19994,3],[19995,2],[20010,1],[20018,3],[20019,2],[20022,1],[20030,3],[20031,2],[20034,1],[20038,2],[20042,0],[20043,1],[20046,2],[20050,1],[20054,2],[20058,1],[20062,2],[20066,1],[20070,2],[20074,1],[20078,2],[20082,1],[20086,2],[20090,1],[20094,2],[20098,0],[20106,1],[20126,2],[20130,1],[20134,2],[20138,1],[20142,2],[20146,1],[20150,2],[20158,1],[20166,2],[20170,1],[20178,2],[20190,0],[20198,1],[20377,3],[20378,2],[20381,0],[20382,1],[20386,2],[20389,0],[20390,1],[20393,2],[20397,1],[20401,3],[20402,2],[20414,1],[20426,2],[20433,1],[20437,2],[20445,0],[20446,1],[20453,2],[20457,0],[20458,1],[20461,3],[20462,2],[20465,1],[20469,3],[20470,2],[20473,1],[20477,2],[20481,1],[20485,2],[20493,1],[20505,0],[20513,1],[20533,2],[20537,1],[20541,2],[20545,1],[20549,2],[20553,1],[20557,2],[20573,1],[20577,2],[20581,1],[20585,2],[20597,1],[20601,2],[20605,1],[20609,2],[20613,1],[20617,2],[20621,1],[20629,2],[20641,1],[20645,2],[20649,1],[20653,2],[20657,1],[20661,2],[20665,1],[20669,2],[20673,1],[20677,2],[20681,1],[20685,2],[20689,1],[20693,2],[20701,1],[20705,2],[20709,1],[20713,2],[20717,1],[20721,2],[20725,1],[20729,2],[20733,1],[20737,2],[20740,0],[20741,1],[20745,2],[20749,1],[20753,2],[20756,0],[20757,1],[20761,2],[20765,1],[20768,3],[20769,2],[20773,1],[20776,3],[20777,2],[20780,0],[20781,1],[20784,3],[20785,2],[20788,0],[20789,1],[20797,2],[20801,1],[20804,3],[20805,2],[20812,0],[20813,1],[20816,3],[20817,2],[20820,0],[20821,1],[20824,3],[20825,2],[20828,0],[20829,1],[20832,2],[20836,0],[20837,1],[20840,3],[20841,2],[20844,1],[20848,3],[20849,2],[20852,0],[20853,1],[20856,3],[20857,2],[20860,0],[20861,1],[20864,2],[20876,1],[20884,2],[20888,1],[20896,2],[20916,0],[20924,1],[20944,2],[20948,1],[20952,2],[20956,1],[20960,2],[20964,1],[20968,2],[20976,1],[20984,2],[20988,1],[20996,2],[21008,0],[21016,1],[21195,3],[21196,2],[21199,0],[21200,1],[21203,3],[21204,2],[21208,1],[21211,3],[21212,2],[21215,0],[21216,1],[21219,3],[21220,2],[21231,0],[21232,1],[21235,3],[21236,2],[21243,1],[21255,2],[21263,0],[21264,1],[21271,2],[21275,0],[21276,1],[21279,3],[21280,2],[21283,0],[21284,1],[21287,2],[21291,1],[21295,3],[21296,2],[21299,1],[21303,2],[21311,1],[21323,0],[21331,1],[21351,2],[21355,1],[21359,2],[21363,1],[21367,2],[21371,1],[21375,2],[21383,1],[21391,2],[21403,1],[21411,2],[21415,0],[21423,1],[21602,2],[21606,1],[21610,2],[21615,1],[21618,2],[21622,0],[21623,1],[21627,2],[21638,1],[21642,3],[21643,2],[21650,0],[21651,1],[21662,2],[21670,1],[21678,2],[21682,0],[21683,1],[21686,2],[21690,1],[21694,2],[21698,1],[21702,2],[21706,1],[21710,2],[21718,1],[21730,0],[21738,1],[21758,2],[21762,1],[21766,2],[21770,1],[21774,2],[21778,1],[21782,2],[21790,1],[21798,2],[21810,1],[21818,2],[21822,0],[21830,1],[22009,2],[22013,1],[22017,2],[22021,1],[22025,3],[22026,2],[22029,1],[22033,2],[22045,1],[22049,2],[22057,1],[22069,2],[22077,1],[22085,3],[22086,2],[22089,1],[22093,2],[22097,1],[22101,2],[22105,1],[22109,2],[22113,1],[22117,2],[22125,1],[22137,0],[22145,1],[22165,2],[22169,1],[22173,2],[22177,1],[22181,2],[22185,1],[22189,2],[22205,1],[22213,2],[22217,1],[22225,2],[22233,1],[22237,2],[22245,1],[22249,2],[22253,1],[22257,2],[22261,1],[22269,2],[22273,1],[22277,2],[22281,1],[22285,2],[22289,1],[22293,2],[22301,1],[22305,2],[22309,1],[22317,2],[22321,1],[22324,3],[22325,2],[22328,0],[22329,1],[22333,2],[22336,0],[22337,1],[22341,2],[22344,0],[22345,1],[22348,3],[22349,2],[22353,1],[22361,2],[22364,0],[22365,1],[22368,2],[22372,0],[22373,1],[22377,2],[22380,0],[22381,1],[22384,2],[22393,1],[22396,3],[22397,2],[22401,1],[22404,2],[22408,0],[22409,1],[22412,3],[22413,2],[22416,1],[22420,2],[22425,1],[22428,3],[22429,2],[22433,1],[22436,3],[22437,2],[22440,0],[22441,1],[22444,3],[22445,2],[22448,1],[22452,3],[22453,2],[22456,1],[22460,2],[22464,1],[22468,2],[22472,1],[22476,2],[22492,1],[22500,2],[22504,1],[22508,2],[22512,1],[22516,2],[22520,1],[22524,2],[22528,1],[22532,2],[22536,1],[22544,2],[22548,0],[22556,1],[22576,2],[22580,1],[22584,2],[22588,1],[22592,2],[22596,1],[22600,2],[22608,1],[22616,2],[22620,1],[22628,2],[22640,0],[22648,1],[22827,3],[22828,2],[22831,1],[22835,2],[22839,1],[22843,2],[22847,1],[22851,3],[22852,2],[22863,0],[22864,1],[22867,2],[22875,1],[22887,2],[22895,1],[22903,2],[22907,1],[22911,2],[22915,1],[22919,2],[22923,1],[22927,2],[22931,1],[22935,2],[22943,1],[22955,0],[22963,1],[22983,2],[22987,1],[22991,2],[22995,1],[22999,2],[23003,1],[23007,2],[23023,1],[23027,2],[23031,1],[23035,2],[23047,1],[23055,2],[23059,1],[23071,2],[23075,1],[23083,2],[23087,1],[23095,2],[23099,1],[23103,2],[23107,1],[23111,2],[23115,1],[23123,2],[23126,0],[23127,1],[23131,2],[23134,0],[23135,1],[23139,2],[23143,1],[23147,2],[23151,1],[23154,3],[23155,2],[23159,1],[23162,3],[23163,2],[23166,0],[23167,1],[23171,2],[23175,1],[23179,2],[23183,1],[23186,3],[23187,2],[23191,1],[23194,3],[23195,2],[23199,1],[23202,3],[23203,2],[23210,0],[23211,1],[23214,3],[23215,2],[23218,0],[23219,1],[23222,2],[23226,0],[23227,1],[23230,3],[23231,2],[23234,1],[23246,2],[23250,1],[23254,2],[23258,1],[23262,2],[23266,0],[23267,1],[23270,2],[23274,1],[23278,2],[23282,0],[23283,1],[23286,2],[23290,1],[23294,2],[23298,1],[23302,2],[23306,1],[23314,2],[23338,1],[23350,2],[23354,1],[23358,2],[23366,0],[23374,1],[23394,2],[23398,1],[23402,2],[23406,1],[23410,2],[23414,1],[23418,2],[23426,1],[23434,2],[23438,1],[23446,2],[23458,0],[23466,1],[23645,2],[23649,0],[23650,1],[23653,2],[23657,0],[23658,1],[23661,2],[23665,0],[23666,1],[23669,2],[23681,1],[23685,3],[23686,2],[23693,1],[23705,2],[23713,1],[23721,2],[23725,1],[23729,2],[23733,1],[23737,2],[23741,1],[23745,2],[23749,1],[23753,2],[23761,1],[23773,0],[23781,1],[23801,2],[23805,1],[23809,2],[23813,1],[23817,2],[23821,1],[23825,2],[23841,1],[23849,2],[23853,1],[23861,2],[23865,1],[23869,2],[23873,1],[23877,2],[23881,1],[23885,2],[23889,1],[23893,2],[23897,1],[23901,2],[23905,1],[23909,2],[23912,0],[23913,1],[23917,2],[23921,1],[23925,2],[23932,0],[23933,1],[23937,2],[23945,1],[23948,3],[23949,2],[23952,0],[23953,1],[23957,2],[23965,1],[23969,2],[23972,0],[23973,1],[23977,2],[23985,1],[23988,3],[23989,2],[23996,0],[23997,1],[24000,3],[24001,2],[24005,1],[24012,2],[24017,1],[24020,2],[24028,1],[24032,3],[24033,2],[24036,0],[24037,1],[24040,3],[24041,2],[24044,1],[24048,2],[24052,1],[24056,2],[24060,1],[24064,2],[24068,1],[24072,3],[24073,2],[24076,1],[24080,3],[24081,2],[24084,1],[24092,2],[24096,0],[24097,1],[24100,2],[24104,1],[24108,3],[24109,2],[24112,1],[24116,2],[24120,1],[24132,2],[24140,1],[24144,2],[24152,1],[24164,2],[24172,1],[24180,2],[24184,0],[24192,1],[24212,2],[24216,1],[24220,2],[24224,1],[24228,2],[24232,1],[24236,2],[24244,1],[24252,2],[24256,1],[24264,2],[24276,0],[24284,1],[24463,2],[24467,1],[24471,3],[24472,2],[24475,1],[24479,2],[24483,1],[24487,3],[24488,2],[24499,1],[24503,2],[24511,1],[24523,2],[24531,1],[24539,2],[24543,1],[24547,2],[24551,1],[24555,2],[24559,1],[24563,2],[24567,1],[24571,2],[24579,1],[24591,0],[24599,1],[24619,2],[24623,1],[24627,2],[24631,1],[24635,2],[24639,1],[24643,2],[24659,1],[24663,2],[24667,1],[24671,2],[24683,1],[24691,2],[24695,1],[24699,2],[24706,0],[24707,1],[24711,2],[24739,1],[24742,3],[24743,2],[24747,1],[24750,3],[24751,2],[24754,0],[24755,1],[24758,3],[24759,2],[24762,0],[24763,1],[24767,2],[24770,0],[24771,1],[24774,3],[24775,2],[24779,1],[24795,2],[24798,1],[24802,3],[24803,2],[24807,1],[24810,2],[24818,0],[24819,1],[24826,2],[24830,0],[24831,1],[24834,3],[24835,2],[24838,0],[24839,1],[24842,2],[24850,0],[24851,1],[24854,2],[24858,1],[24862,2],[24866,1],[24870,2],[24886,0],[24887,1],[24890,2],[24894,1],[24898,3],[24899,2],[24902,1],[24906,2],[24910,1],[24914,2],[24918,1],[24926,2],[24930,1],[24934,2],[24938,1],[24954,2],[24962,1],[24966,2],[24970,1],[24974,2],[24978,1],[24986,2],[24990,1],[24998,2],[25002,1],[25006,0],[25014,1],[25034,2],[25038,1],[25042,2],[25046,1],[25050,2],[25054,1],[25058,2],[25066,1],[25074,2],[25078,1],[25086,2],[25098,0],[25106,1],[25285,2],[25289,0],[25290,1],[25293,2],[25297,1],[25301,2],[25305,1],[25309,3],[25310,2],[25321,1],[25325,2],[25333,1],[25345,2],[25353,1],[25361,2],[25365,1],[25369,2],[25373,1],[25377,2],[25381,1],[25385,2],[25389,1],[25393,2],[25401,1],[25413,0],[25421,1],[25441,2],[25445,1],[25449,2],[25453,1],[25457,2],[25461,1],[25465,2],[25481,1],[25489,2],[25493,1],[25501,2],[25504,0],[25505,1],[25509,2],[25513,1],[25517,2],[25521,1],[25525,2],[25529,1],[25533,2],[25537,1],[25544,3],[25545,2],[25553,1],[25556,3],[25557,2],[25560,0],[25561,1],[25565,2],[25568,0],[25569,1],[25597,2],[25600,1],[25604,3],[25605,2],[25608,1],[25612,2],[25620,0],[25621,1],[25624,3],[25625,2],[25632,0],[25633,1],[25636,0],[25645,1],[25664,3],[25665,2],[25668,1],[25672,2],[25676,0],[25677,1],[25680,2],[25684,1],[25688,2],[25696,1],[25704,2],[25708,1],[25716,2],[25728,0],[25736,1],[25916,2],[25920,1],[25924,2],[25928,1],[25931,3],[25932,2],[25935,0],[25936,1],[25940,2],[25951,0],[25952,1],[25956,2],[25960,1],[25964,2],[25983,0],[25984,1],[25991,3],[25992,2],[25995,1],[25999,2],[26004,1],[26007,3],[26008,2],[26012,1],[26015,3],[26016,2],[26019,1],[26023,2],[26031,1],[26043,0],[26051,1],[26071,2],[26075,0],[26076,1],[26079,2],[26083,1],[26087,2],[26091,0],[26092,1],[26095,2],[26111,1],[26119,2],[26123,1],[26131,2],[26135,1],[26139,2],[26143,1],[26147,2],[26151,1],[26155,2],[26159,1],[26163,2],[26167,1],[26171,2],[26175,1],[26179,2],[26183,1],[26187,2],[26191,1],[26195,2],[26199,0],[26207,1],[26227,2],[26231,1],[26235,2],[26239,1],[26243,2],[26247,1],[26251,2],[26259,1],[26267,2],[26271,1],[26279,2],[26291,0],[26299,1],[26478,3],[26479,2],[26482,1],[26486,2],[26490,1],[26494,2],[26498,1],[26502,2],[26514,1],[26526,2],[26534,1],[26538,2],[26546,1],[26554,2],[26558,1],[26562,2],[26566,1],[26570,2],[26574,1],[26578,2],[26582,1],[26586,2],[26594,1],[26606,0],[26614,1],[26634,2],[26638,1],[26642,2],[26646,1],[26650,2],[26654,1],[26658,2],[26674,1],[26678,2],[26682,1],[26686,2],[26698,1],[26702,2],[26706,1],[26709,3],[26710,2],[26714,1],[26718,2],[26722,1],[26730,2],[26742,1],[26745,3],[26746,2],[26749,0],[26750,1],[26754,2],[26758,1],[26761,3],[26762,2],[26765,0],[26766,1],[26770,2],[26774,1],[26777,3],[26778,2],[26782,1],[26785,3],[26786,2],[26789,1],[26802,2],[26805,1],[26809,3],[26810,2],[26813,1],[26817,2],[26821,0],[26822,1],[26825,3],[26826,2],[26829,0],[26830,1],[26833,3],[26834,2],[26837,0],[26838,1],[26841,3],[26842,2],[26845,1],[26849,2],[26853,0],[26854,1],[26857,2],[26861,1],[26865,2],[26869,1],[26873,2],[26877,1],[26881,2],[26885,0],[26886,1],[26913,2],[26925,1],[26929,2],[26933,1],[26937,2],[26941,1],[26945,2],[26949,1],[26953,2],[26957,1],[26961,2],[26969,1],[26977,2],[26989,1],[26993,2],[27001,1],[27005,2],[27017,1],[27021,0],[27029,1],[27049,2],[27053,1],[27057,2],[27061,1],[27065,2],[27069,1],[27073,2],[27081,1],[27089,2],[27093,1],[27101,2],[27112,0],[27121,1],[27300,2],[27304,1],[27308,2],[27312,1],[27316,2],[27320,1],[27324,2],[27336,1],[27340,2],[27348,1],[27360,2],[27368,1],[27376,2],[27380,1],[27384,2],[27388,1],[27392,2],[27396,1],[27400,2],[27404,1],[27408,2],[27416,1],[27428,0],[27436,1],[27456,2],[27460,1],[27464,2],[27468,1],[27472,2],[27476,1],[27480,2],[27488,1],[27496,2],[27508,1],[27515,3],[27516,2],[27520,0],[27528,1],[27707,3],[27708,2],[27711,1],[27715,2],[27719,1],[27723,2],[27727,1],[27731,2],[27743,1],[27747,2],[27755,1],[27767,2],[27775,1],[27783,2],[27787,1],[27791,2],[27795,1],[27799,2],[27803,1],[27807,2],[27811,1],[27815,2],[27823,1],[27835,0],[27843,1],[27863,2],[27867,1],[27871,2],[27875,1],[27879,2],[27883,1],[27887,2],[27895,1],[27903,2],[27915,1],[27923,2],[27927,0],[27935,1],[28114,2],[28118,1],[28122,2],[28126,1],[28130,2],[28134,1],[28138,2],[28150,1],[28154,2],[28162,1],[28174,2],[28182,1],[28190,2],[28194,1],[28198,2],[28202,1],[28206,2],[28210,1],[28214,2],[28218,1],[28222,2],[28230,1],[28242,0],[28250,1],[28270,2],[28274,1],[28278,2],[28282,1],[28286,2],[28290,1],[28294,2],[28310,1],[28318,2],[28322,1],[28330,2],[28334,1],[28337,3],[28338,2],[28346,1],[28350,2],[28353,0],[28354,1],[28358,2],[28361,0],[28362,1],[28373,3],[28374,2],[28378,1],[28382,2],[28385,0],[28386,1],[28390,2],[28393,0],[28394,1],[28402,2],[28405,1],[28414,2],[28418,1],[28421,3],[28422,2],[28425,1],[28430,2],[28433,1],[28441,3],[28442,2],[28445,1],[28449,2],[28453,1],[28457,2],[28465,1],[28469,2],[28477,1],[28481,2],[28485,0],[28486,1],[28489,2],[28493,1],[28497,2],[28501,1],[28521,2],[28525,0],[28533,1],[28553,2],[28557,1],[28561,2],[28565,1],[28569,2],[28573,1],[28577,2],[28585,1],[28593,2],[28597,1],[28605,2],[28617,0],[28625,1],[28805,2],[28808,0],[28809,1],[28813,2],[28817,1],[28820,3],[28821,2],[28824,0],[28825,1],[28828,3],[28829,2],[28840,1],[28844,2],[28848,0],[28849,1],[28852,3],[28853,2],[28872,0],[28873,1],[28880,2],[28884,0],[28885,1],[28888,2],[28892,1],[28896,3],[28897,2],[28900,1],[28904,2],[28908,1],[28912,2],[28920,1],[28932,0],[28940,1],[28960,2],[28964,1],[28968,2],[28972,1],[28976,2],[28980,1],[28984,2],[29000,1],[29008,2],[29012,1],[29020,2],[29024,1],[29028,2],[29032,1],[29036,2],[29040,1],[29044,2],[29048,1],[29052,2],[29056,1],[29060,2],[29064,1],[29068,2],[29072,1],[29076,2],[29080,1],[29084,2],[29088,0],[29096,1],[29115,3],[29116,2],[29120,1],[29123,3],[29124,2],[29127,0],[29128,1],[29132,2],[29136,1],[29140,2],[29148,1],[29155,3],[29156,2],[29160,1],[29168,2],[29180,0],[29188,1],[29367,2],[29371,1],[29375,2],[29379,1],[29383,2],[29387,1],[29391,2],[29403,1],[29415,2],[29423,1],[29427,2],[29435,1],[29443,2],[29447,1],[29451,2],[29455,1],[29459,2],[29463,1],[29467,2],[29471,1],[29475,2],[29483,1],[29495,0],[29503,1],[29523,2],[29527,1],[29531,2],[29534,0],[29535,1],[29539,2],[29542,0],[29543,1],[29546,3],[29547,2],[29562,0],[29563,1],[29566,2],[29570,0],[29571,1],[29574,3],[29575,2],[29586,1],[29590,2],[29595,1],[29598,2],[29602,1],[29606,2],[29611,1],[29618,3],[29619,2],[29630,1],[29634,3],[29635,2],[29638,1],[29642,2],[29646,1],[29650,3],[29651,2],[29658,0],[29659,1],[29662,3],[29663,2],[29666,1],[29670,3],[29671,2],[29674,0],[29675,1],[29678,3],[29679,2],[29690,1],[29694,2],[29698,1],[29702,2],[29706,1],[29710,2],[29718,1],[29722,2],[29730,1],[29734,2],[29738,1],[29742,2],[29746,1],[29750,2],[29758,1],[29762,2],[29766,1],[29770,2],[29774,1],[29802,2],[29814,1],[29818,2],[29822,1],[29826,2],[29830,1],[29834,2],[29838,1],[29842,2],[29858,1],[29866,2],[29870,1],[29886,2],[29898,1],[29910,0],[29918,1],[29938,2],[29942,1],[29946,2],[29950,1],[29954,2],[29957,0],[29958,1],[29961,3],[29962,2],[29970,1],[29978,2],[29982,1],[29989,2],[30001,0],[30009,1],[30189,2],[30193,1],[30197,2],[30201,1],[30205,2],[30209,1],[30213,2],[30225,1],[30229,2],[30237,1],[30249,2],[30257,1],[30265,2],[30269,1],[30273,2],[30277,1],[30281,2],[30285,1],[30289,2],[30293,1],[30297,2],[30305,1],[30317,0],[30325,1],[30344,3],[30345,2],[30348,0],[30349,1],[30352,3],[30353,2],[30357,1],[30360,3],[30361,2],[30365,1],[30369,2],[30377,1],[30384,3],[30385,2],[30396,1],[30405,2],[30408,0],[30416,1],[30596,2],[30600,1],[30604,2],[30608,1],[30612,2],[30616,1],[30620,2],[30632,1],[30636,2],[30644,1],[30656,2],[30664,1],[30672,2],[30676,1],[30680,2],[30684,1],[30688,2],[30692,1],[30696,2],[30699,0],[30700,1],[30704,2],[30712,1],[30724,0],[30732,1],[30751,3],[30752,2],[30756,1],[30760,2],[30763,0],[30764,1],[30767,3],[30768,2],[30772,1],[30776,2],[30783,0],[30784,1],[30791,3],[30792,2],[30803,1],[30811,2],[30815,0],[30823,1],[31003,2],[31007,1],[31011,2],[31015,1],[31019,2],[31023,1],[31027,2],[31039,1],[31043,2],[31051,1],[31063,2],[31071,1],[31079,2],[31083,1],[31087,2],[31091,1],[31095,2],[31099,1],[31103,2],[31107,1],[31111,2],[31119,1],[31131,0],[31139,1],[31159,2],[31162,0],[31163,1],[31167,2],[31171,1],[31174,3],[31175,2],[31178,0],[31179,1],[31182,2],[31198,0],[31199,1],[31207,2],[31211,1],[31218,3],[31219,2],[31222,1],[31230,3],[31231,2],[31234,1],[31242,3],[31243,2],[31246,0],[31247,1],[31250,3],[31251,2],[31262,1],[31266,2],[31270,1],[31274,3],[31275,2],[31278,1],[31282,2],[31286,0],[31287,1],[31294,2],[31298,1],[31302,2],[31306,0],[31307,1],[31314,2],[31318,1],[31322,2],[31326,1],[31330,2],[31334,1],[31338,2],[31342,1],[31346,2],[31354,1],[31362,2],[31366,1],[31378,2],[31382,1],[31386,2],[31390,1],[31394,2],[31398,1],[31402,2],[31406,1],[31410,2],[31414,1],[31430,2],[31442,1],[31446,2],[31450,1],[31454,2],[31458,1],[31462,2],[31466,1],[31470,2],[31474,1],[31482,2],[31486,1],[31490,2],[31502,1],[31506,2],[31526,1],[31534,2],[31541,0],[31550,1],[31569,3],[31570,2],[31573,0],[31574,1],[31577,3],[31578,2],[31581,0],[31582,1],[31585,3],[31586,2],[31589,0],[31590,1],[31593,2],[31601,0],[31602,1],[31609,3],[31610,2],[31613,0],[31614,1],[31621,3],[31622,2],[31633,0],[31641,1],[31821,2],[31825,1],[31829,2],[31833,1],[31837,2],[31841,1],[31845,2],[31857,1],[31861,2],[31869,1],[31881,2],[31889,1],[31897,2],[31901,1],[31905,2],[31909,1],[31913,2],[31917,1],[31920,3],[31921,2],[31925,1],[31929,2],[31936,0],[31937,1],[31949,0],[31957,1],[31976,2],[31980,1],[31984,3],[31985,2],[31989,1],[31992,3],[31993,2],[31996,0],[31997,1],[32000,3],[32001,2],[32016,1],[32021,2],[32024,1],[32028,2],[32048,1],[32052,2],[32056,0],[32057,1],[32068,2],[32072,1],[32076,3],[32077,2],[32080,1],[32084,2],[32088,1],[32092,2],[32096,1],[32100,2],[32104,1],[32108,2],[32112,1],[32120,2],[32132,1],[32136,2],[32140,1],[32144,2],[32148,1],[32152,2],[32156,1],[32160,2],[32164,1],[32168,2],[32172,1],[32176,2],[32180,1],[32188,2],[32196,1],[32200,2],[32204,1],[32208,2],[32212,1],[32216,2],[32220,1],[32224,2],[32228,1],[32248,2],[32260,1],[32264,2],[32268,1],[32272,2],[32276,1],[32280,2],[32284,1],[32288,2],[32292,1],[32300,2],[32312,1],[32316,2],[32331,0],[32332,1],[32335,3],[32336,2],[32340,1],[32348,2],[32359,0],[32368,1],[32388,2],[32391,1],[32396,2],[32399,1],[32404,2],[32407,0],[32408,1],[32411,2],[32419,1],[32427,3],[32428,2],[32431,0],[32432,1],[32439,3],[32440,2],[32451,0],[32460,1],[32639,2],[32643,1],[32647,2],[32651,1],[32655,2],[32659,1],[32663,2],[32675,1],[32679,2],[32686,0],[32687,1],[32699,2],[32707,1],[32714,3],[32715,2],[32719,1],[32723,2],[32727,1],[32731,2],[32734,0],[32735,1],[32739,2],[32742,0],[32743,1],[32747,2],[32754,0],[32755,1],[32767,0],[32775,1],[32794,3],[32795,2],[32798,1],[32802,3],[32803,2],[32807,1],[32810,3],[32811,2],[32814,0],[32815,1],[32818,3],[32819,2],[32834,1],[32842,2],[32846,0],[32847,1],[32854,2],[32858,0],[32859,1],[32862,2],[32870,1],[32874,2],[32886,1],[32890,2],[32894,1],[32898,2],[32902,1],[32906,2],[32910,1],[32914,2],[32918,1],[32922,2],[32926,1],[32934,2],[32942,1],[32970,2],[32974,1],[32978,2],[32982,1],[32990,0],[32998,1],[33018,2],[33022,1],[33026,2],[33030,1],[33034,2],[33038,1],[33042,2],[33050,1],[33058,2],[33062,1],[33070,2],[33082,0],[33090,1],[33269,2],[33273,0],[33274,1],[33277,3],[33278,2],[33281,1],[33285,2],[33289,1],[33293,2],[33305,1],[33309,2],[33313,1],[33317,2],[33337,1],[33345,2],[33349,1],[33353,2],[33357,1],[33361,2],[33365,1],[33369,2],[33373,1],[33377,2],[33385,1],[33397,0],[33405,1],[33425,2],[33429,1],[33433,2],[33437,1],[33441,2],[33445,1],[33449,2],[33465,1],[33473,2],[33477,1],[33485,2],[33489,1],[33493,2],[33496,0],[33497,1],[33501,2],[33505,1],[33509,2],[33513,1],[33517,2],[33521,1],[33525,2],[33528,0],[33529,1],[33533,2],[33536,0],[33537,1],[33540,3],[33541,2],[33544,0],[33545,1],[33548,3],[33549,2],[33553,0],[33561,1],[33581,2],[33584,0],[33585,1],[33589,2],[33592,1],[33597,2],[33600,0],[33601,1],[33604,3],[33605,2],[33612,1],[33621,2],[33624,0],[33625,1],[33632,3],[33633,2],[33644,0],[33653,1],[33832,2],[33836,1],[33840,2],[33844,1],[33848,2],[33852,1],[33856,2],[33868,1],[33880,2],[33888,1],[33892,2],[33900,1],[33908,2],[33911,0],[33912,1],[33915,3],[33916,2],[33920,1],[33924,2],[33927,0],[33928,1],[33932,2],[33936,1],[33939,3],[33940,2],[33948,1],[33960,0],[33968,1],[33987,2],[33991,0],[33992,1],[33996,2],[33999,1],[34003,3],[34004,2],[34007,1],[34011,2],[34027,0],[34028,1],[34031,2],[34035,1],[34039,3],[34040,2],[34051,1],[34055,2],[34059,0],[34060,1],[34063,2],[34067,1],[34071,2],[34075,1],[34079,2],[34087,0],[34088,1],[34091,2],[34099,1],[34103,2],[34107,1],[34111,2],[34119,1],[34123,2],[34127,1],[34131,2],[34135,1],[34139,2],[34143,1],[34147,2],[34151,1],[34155,2],[34159,1],[34163,2],[34167,1],[34171,2],[34175,1],[34179,2],[34183,1],[34187,2],[34191,1],[34195,2],[34199,1],[34203,2],[34207,1],[34211,2],[34215,1],[34219,2],[34223,1],[34227,2],[34231,1],[34235,2],[34239,1],[34243,2],[34247,1],[34251,2],[34255,1],[34259,2],[34263,1],[34267,2],[34271,1],[34275,2],[34279,1],[34283,2],[34287,1],[34291,2],[34295,1],[34299,2],[34303,1],[34318,3],[34319,2],[34322,0],[34323,1],[34330,3],[34331,2],[34334,0],[34335,1],[34342,3],[34343,2],[34351,1],[34354,3],[34355,2],[34363,1],[34367,2],[34370,0],[34379,1],[34399,2],[34402,0],[34403,1],[34406,2],[34410,0],[34411,1],[34414,2],[34418,0],[34419,1],[34422,3],[34423,2],[34430,1],[34438,2],[34442,0],[34443,1],[34450,2],[34462,0],[34470,1],[34650,2],[34654,1],[34658,2],[34662,1],[34666,2],[34670,1],[34674,2],[34686,1],[34690,2],[34698,1],[34710,2],[34718,1],[34726,2],[34730,1],[34733,3],[34734,2],[34738,1],[34742,2],[34746,1],[34750,2],[34754,1],[34757,3],[34758,2],[34765,0],[34766,1],[34778,0],[34786,1],[34806,2],[34809,1],[34814,2],[34817,1],[34821,2],[34825,1],[34829,2],[34845,0],[34846,1],[34853,2],[34857,1],[34865,2],[34869,1],[34873,2],[34877,1],[34881,2],[34885,1],[34889,3],[34890,2],[34893,1],[34897,2],[34901,1],[34905,2],[34909,1],[34913,2],[34917,1],[34921,2],[34925,1],[34929,2],[34933,0],[34941,1],[34961,2],[34965,1],[34969,2],[34973,1],[34977,2],[34981,1],[34985,2],[34993,1],[35001,2],[35005,1],[35013,2],[35025,0],[35033,1],[35212,2],[35216,0],[35217,1],[35220,2],[35224,0],[35225,1],[35228,3],[35229,2],[35232,1],[35236,2],[35248,1],[35260,2],[35268,1],[35272,3],[35273,2],[35280,1],[35288,2],[35292,1],[35296,2],[35300,0],[35301,1],[35304,2],[35308,1],[35312,2],[35316,1],[35320,2],[35328,1],[35340,0],[35348,1],[35368,2],[35372,1],[35376,2],[35380,1],[35384,2],[35388,1],[35392,2],[35408,1],[35412,2],[35416,1],[35420,2],[35436,1],[35440,2],[35444,1],[35448,2],[35456,1],[35460,2],[35464,1],[35472,2],[35480,1],[35484,2],[35488,1],[35492,2],[35496,1],[35500,2],[35504,1],[35508,2],[35512,1],[35515,3],[35516,2],[35519,0],[35520,1],[35524,2],[35528,1],[35532,2],[35535,0],[35536,1],[35540,2],[35544,1],[35547,3],[35548,2],[35552,1],[35556,2],[35560,1],[35563,3],[35564,2],[35567,0],[35568,1],[35571,3],[35572,2],[35575,0],[35576,1],[35579,3],[35580,2],[35583,0],[35584,1],[35587,3],[35588,2],[35591,0],[35592,1],[35596,2],[35600,1],[35603,2],[35607,1],[35612,2],[35615,1],[35620,2],[35623,1],[35627,2],[35631,0],[35632,1],[35635,3],[35636,2],[35639,0],[35640,1],[35643,3],[35644,2],[35647,0],[35648,1],[35651,3],[35652,2],[35655,1],[35659,2],[35663,0],[35664,1],[35667,2],[35671,1],[35675,2],[35679,0],[35680,1],[35683,2],[35687,1],[35699,2],[35707,1],[35719,2],[35723,1],[35727,2],[35731,1],[35735,2],[35743,1],[35747,2],[35751,0],[35759,1],[35779,2],[35783,1],[35787,2],[35791,1],[35795,2],[35799,1],[35803,2],[35811,1],[35819,2],[35823,1],[35831,2],[35843,0],[35851,1],[36030,3],[36031,2],[36034,1],[36038,2],[36042,1],[36046,3],[36047,2],[36050,0],[36051,1],[36054,2],[36066,0],[36067,1],[36070,2],[36078,0],[36079,1],[36090,2],[36098,1],[36106,2],[36110,1],[36114,2],[36118,1],[36122,2],[36126,1],[36130,2],[36134,1],[36138,2],[36146,1],[36158,0],[36166,1],[36186,2],[36190,1],[36194,2],[36198,1],[36202,2],[36206,1],[36210,2],[36218,1],[36238,2],[36242,1],[36246,2],[36250,0],[36258,1],[36437,2],[36441,0],[36442,1],[36445,2],[36449,0],[36450,1],[36453,2],[36457,0],[36458,1],[36461,2],[36473,1],[36477,2],[36485,1],[36497,2],[36505,0],[36506,1],[36513,2],[36517,1],[36521,2],[36525,1],[36533,2],[36537,1],[36541,2],[36545,1],[36549,2],[36561,1],[36565,0],[36573,1],[36593,2],[36597,1],[36601,2],[36605,1],[36609,2],[36613,1],[36617,2],[36625,1],[36633,2],[36645,1],[36653,2],[36657,0],[36665,1],[36844,2],[36848,1],[36852,2],[36856,0],[36857,1],[36860,3],[36861,2],[36864,1],[36868,2],[36880,1],[36884,2],[36892,0],[36893,1],[36904,3],[36905,2],[36912,1],[36920,2],[36924,1],[36928,2],[36932,1],[36940,2],[36944,1],[36948,2],[36952,1],[36956,2],[36968,1],[36972,0],[36980,1],[37000,2],[37004,1],[37008,2],[37012,1],[37016,2],[37020,1],[37024,2],[37032,1],[37040,2],[37052,1],[37060,2],[37064,0],[37072,1],[37251,2],[37255,0],[37256,1],[37259,2],[37263,1],[37267,2],[37271,1],[37275,2],[37287,1],[37291,2],[37299,1],[37311,2],[37319,1],[37327,2],[37331,1],[37335,2],[37339,1],[37347,2],[37351,1],[37355,2],[37359,1],[37363,2],[37375,1],[37379,0],[37387,1],[37407,2],[37411,1],[37415,2],[37419,1],[37423,2],[37427,1],[37431,2],[37439,1],[37447,2],[37459,1],[37467,2],[37471,0],[37479,1],[37658,2],[37662,0],[37663,1],[37666,3],[37667,2],[37670,1],[37674,3],[37675,2],[37678,1],[37682,2],[37694,0],[37695,1],[37698,2],[37706,1],[37718,2],[37726,1],[37734,2],[37738,1],[37742,2],[37746,1],[37754,2],[37758,1],[37762,2],[37766,1],[37770,2],[37782,1],[37786,0],[37794,1],[37814,2],[37818,1],[37822,2],[37826,1],[37830,2],[37834,1],[37838,2],[37854,1],[37858,2],[37862,1],[37866,2],[37878,1],[37882,2],[37886,1],[37890,2],[37894,1],[37898,2],[37902,1],[37906,2],[37909,0],[37910,1],[37914,2],[37918,1],[37922,2],[37926,1],[37929,3],[37930,2],[37933,0],[37934,1],[37938,2],[37942,1],[37946,2],[37954,1],[37958,2],[37962,1],[37966,2],[37969,1],[37974,2],[37977,0],[37978,1],[37982,2],[37985,0],[37986,1],[37990,2],[37993,1],[37997,3],[37998,2],[38002,1],[38005,2],[38009,0],[38010,1],[38013,3],[38014,2],[38017,1],[38021,2],[38025,0],[38026,1],[38029,3],[38030,2],[38033,0],[38034,1],[38037,3],[38038,2],[38041,1],[38045,3],[38046,2],[38049,1],[38053,3],[38054,2],[38057,0],[38058,1],[38061,2],[38065,0],[38066,1],[38069,2],[38073,1],[38077,2],[38081,0],[38082,1],[38085,2],[38089,1],[38093,2],[38097,1],[38101,2],[38105,1],[38109,2],[38113,1],[38117,2],[38121,1],[38125,2],[38129,1],[38133,2],[38157,1],[38165,2],[38169,1],[38173,2],[38177,1],[38193,2],[38197,0],[38205,1],[38225,2],[38229,1],[38233,2],[38237,1],[38241,2],[38245,1],[38249,2],[38257,1],[38265,2],[38269,1],[38277,2],[38289,0],[38297,1]],"expect":{"protocol":"usb","speed":"full","packets":[{"index":1,"start_us":8.333333333333332,"end_us":58.20833333333333,"kind":"reset","pid_value":0,"ok":true},{"index":2,"start_us":71.5,"end_us":74.33333333333333,"kind":"packet","pid":"SOF","pid_value":165,"frame":100,"crc":"0x1F","ok":true},{"index":3,"start_us":78.0625,"end_us":80.89583333333333,"kind":"packet","pid":"SETUP","pid_value":45,"addr":0,"endpoint":0,"crc":"0x02","ok":true},{"index":4,"start_us":81.3125,"end_us":89.45833333333333,"kind":"packet","pid":"DATA0","pid_value":195,"data_hex":"80 06 00 01 00 00 40 00","crc":"0x94DD","ok":true},{"index":5,"start_us":89.86458333333333,"end_us":91.35416666666666,"kind":"packet","pid":"ACK","pid_value":210,"ok":true},{"index":6,"start_us":95.10416666666666,"end_us":97.9375,"kind":"packet","pid":"IN","pid_value":105,"addr":0,"endpoint":0,"crc":"0x02","ok":true},{"index":7,"start_us":98.35416666666666,"end_us":99.85416666666666,"kind":"packet","pid":"NAK","pid_value":90,"ok":true},{"index":8,"start_us":103.58333333333333,"end_us":106.41666666666666,"kind":"packet","pid":"IN","pid_value":105,"addr":0,"endpoint":0,"crc":"0x02","ok":true},{"index":9,"start_us":106.83333333333333,"end_us":108.33333333333333,"kind":"packet","pid":"NAK","pid_value":90,"ok":true},{"index":10,"start_us":112.0625,"end_us":114.89583333333333,"kind":"packet","pid":"IN","pid_value":105,"addr":0,"endpoint":0,"crc":"0x02","ok":true},{"index":11,"start_us":115.3125,"end_us":123.45833333333333,"kind":"packet","pid":"DATA1","pid_value":75,"data_hex":"12 01 00 02 00 00 00 08","crc":"0xE757","ok":true},{"index":12,"start_us":123.86458333333333,"end_us":125.375,"kind":"packet","pid":"ACK","pid_value":210,"ok":true},{"index":13,"start_us":129.10416666666666,"end_us":131.9375,"kind":"packet","pid":"OUT","pid_value":225,"addr":0,"endpoint":0,"crc":"0x02","ok":true},{"index":14,"start_us":132.34375,"end_us":135.16666666666666,"kind":"packet","pid":"DATA1","pid_value":75,"crc":"0x0000","ok":true},{"index":15,"start_us":135.58333333333331,"end_us":137.08333333333331,"kind":"packet","pid":"ACK","pid_value":210,"ok":true},{"index":16,"start_us":140.83333333333331,"end_us":190.70833333333331,"kind":"reset","pid_value":0,"ok":true},{"index":17,"start_us":204,"end_us":206.83333333333331,"kind":"packet","pid":"SETUP","pid_value":45,"addr":0,"endpoint":0,"crc":"0x02","ok":true},{"index":18,"start_us":207.25,"end_us":215.39583333333331,"kind":"packet","pid":"DATA0","pid_value":195,"data_hex":"00 05 05 00 00 00 00 00","crc":"0xA1EA","ok":true},{"index":19,"start_us":215.8125,"end_us":217.3125,"kind":"packet","pid":"ACK","pid_value":210,"ok":true},{"index":20,"start_us":221.04166666666666,"end_us":223.875,"kind":"packet","pid":"IN","pid_value":105,"addr":0,"endpoint":0,"crc":"0x02","ok":true},{"index":21,"start_us":224.28125,"end_us":227.125,"kind":"packet","pid":"DATA1","pid_value":75,"crc":"0x0000","ok":true},{"index":22,"start_us":227.52083333333331,"end_us":229.02083333333331,"kind":"packet","pid":"ACK","pid_value":210,"ok":true},{"index":23,"start_us":232.76041666666666,"end_us":235.58333333333331,"kind":"packet","pid":"SOF","pid_value":165,"frame":101,"crc":"0x00","ok":true},{"index":24,"start_us":239.33333333333331,"end_us":242.16666666666666,"kind":"packet","pid":"SETUP","pid_value":45,"addr":5,"endpoint":0,"crc":"0x1A","ok":true},{"index":25,"start_us":242.5625,"end_us":250.72916666666666,"kind":"packet","pid":"DATA0","pid_value":195,"data_hex":"80 06 00 01 00 00 12 00","crc":"0xF4E0","ok":true},{"index":26,"start_us":251.125,"end_us":252.625,"kind":"packet","pid":"ACK","pid_value":210,"ok":true},{"index":27,"start_us":256.375,"end_us":259.1875,"kind":"packet","pid":"IN","pid_value":105,"addr":5,"endpoint":0,"crc":"0x1A","ok":true},{"index":28,"start_us":259.60416666666663,"end_us":261.10416666666663,"kind":"packet","pid":"NAK","pid_value":90,"ok":true},{"index":29,"start_us":264.85416666666663,"end_us":267.6875,"kind":"packet","pid":"IN","pid_value":105,"addr":5,"endpoint":0,"crc":"0x1A","ok":true},{"index":30,"start_us":268.0833333333333,"end_us":269.5833333333333,"kind":"packet","pid":"NAK","pid_value":90,"ok":true},{"index":31,"start_us":273.3333333333333,"end_us":276.1458333333333,"kind":"packet","pid":"IN","pid_value":105,"addr":5,"endpoint":0,"crc":"0x1A","ok":true},{"index":32,"start_us":276.5625,"end_us":284.7083333333333,"kind":"packet","pid":"DATA1","pid_value":75,"data_hex":"12 01 00 02 00 00 00 08","crc":"0xE757","ok":true},{"index":33,"start_us":285.125,"end_us":286.625,"kind":"packet","pid":"ACK","pid_value":210,"ok":true},{"index":34,"start_us":290.3645833333333,"end_us":293.1875,"kind":"packet","pid":"IN","pid_value":105,"addr":5,"endpoint":0,"crc":"0x1A","ok":true},{"index":35,"start_us":293.60416666666663,"end_us":301.75,"kind":"packet","pid":"DATA0","pid_value":195,"data_hex":"83 04 40 57 00 01 01 02","crc":"0xDC18","ok":true},{"index":36,"start_us":302.16666666666663,"end_us":303.66666666666663,"kind":"packet","pid":"ACK","pid_value":210,"ok":true},{"index":37,"start_us":307.41666666666663,"end_us":310.22916666666663,"kind":"packet","pid":"IN","pid_value":105,"addr":5,"endpoint":0,"crc":"0x1A","ok":true},{"index":38,"start_us":310.6458333333333,"end_us":318.79166666666663,"kind":"packet","pid":"DATA0","pid_value":195,"data_hex":"83 04 40 57 00 01 01 02","crc":"0xDC18","ok":true},{"index":39,"start_us":319.2083333333333,"end_us":320.7083333333333,"kind":"packet","pid":"ACK","pid_value":210,"ok":true},{"index":40,"start_us":324.4583333333333,"end_us":327.2708333333333,"kind":"packet","pid":"IN","pid_value":105,"addr":5,"endpoint":0,"crc":"0x1A","ok":true},{"index":41,"start_us":327.6875,"end_us":332.0208333333333,"kind":"packet","pid":"DATA1","pid_value":75,"data_hex":"03 01","crc":"0x7F3F","ok":true},{"index":42,"start_us":332.4375,"end_us":333.9375,"kind":"packet","pid":"ACK","pid_value":210,"ok":true},{"index":43,"start_us":337.66666666666663,"end_us":340.5,"kind":"packet","pid":"OUT","pid_value":225,"addr":5,"endpoint":0,"crc":"0x1A","ok":true},{"index":44,"start_us":340.91666666666663,"end_us":343.72916666666663,"kind":"packet","pid":"DATA1","pid_value":75,"crc":"0x0000","ok":true},{"index":45,"start_us":344.1458333333333,"end_us":345.6458333333333,"kind":"packet","pid":"ACK","pid_value":210,"ok":true},{"index":46,"start_us":349.3958333333333,"end_us":352.2083333333333,"kind":"packet","pid":"SETUP","pid_value":45,"addr":5,"endpoint":0,"crc":"0x1A","ok":true},{"index":47,"start_us":352.625,"end_us":360.7708333333333,"kind":"packet","pid":"DATA0","pid_value":195,"data_hex":"80 06 00 02 00 00 09 00","crc":"0x04AE","ok":true},{"index":48,"start_us":361.1875,"end_us":362.6875,"kind":"packet","pid":"ACK","pid_value":210,"ok":true},{"index":49,"start_us":366.4270833333333,"end_us":369.25,"kind":"packet","pid":"IN","pid_value":105,"addr":5,"endpoint":0,"crc":"0x1A","ok":true},{"index":50,"start_us":369.66666666666663,"end_us":371.16666666666663,"kind":"packet","pid":"NAK","pid_value":90,"ok":true},{"index":51,"start_us":374.90625,"end_us":377.72916666666663,"kind":"packet","pid":"IN","pid_value":105,"addr":5,"endpoint":0,"crc":"0x1A","ok":true},{"index":52,"start_us":378.1458333333333,"end_us":379.6458333333333,"kind":"packet","pid":"NAK","pid_value":90,"ok":true},{"index":53,"start_us":383.38541666666663,"end_us":386.2083333333333,"kind":"packet","pid":"IN","pid_value":105,"addr":5,"endpoint":0,"crc":"0x1A","ok":true},{"index":54,"start_us":386.625,"end_us":394.7708333333333,"kind":"packet","pid":"DATA1","pid_value":75,"data_hex":"09 02 22 00 01 01 00 80","crc":"0x400B","ok":true},{"index":55,"start_us":395.1875,"end_us":396.6875,"kind":"packet","pid":"ACK","pid_value":210,"ok":true},{"index":56,"start_us":400.41666666666663,"end_us":403.25,"kind":"packet","pid":"IN","pid_value":105,"addr":5,"endpoint":0,"crc":"0x1A","ok":true},{"index":57,"start_us":403.66666666666663,"end_us":407.16666666666663,"kind":"packet","pid":"DATA0","pid_value":195,"data_hex":"32","crc":"0x6AC1","ok":true},{"index":58,"start_us":407.57291666666663,"end_us":409.0833333333333,"kind":"packet","pid":"ACK","pid_value":210,"ok":true},{"index":59,"start_us":412.8125,"end_us":415.6458333333333,"kind":"packet","pid":"OUT","pid_value":225,"addr":5,"endpoint":0,"crc":"0x1A","ok":true},{"index":60,"start_us":416.0625,"end_us":418.875,"kind":"packet","pid":"DATA1","pid_value":75,"crc":"0x0000","ok":true},{"index":61,"start_us":419.29166666666663,"end_us":420.79166666666663,"kind":"packet","pid":"ACK","pid_value":210,"ok":true},{"index":62,"start_us":424.53125,"end_us":427.35416666666663,"kind":"packet","pid":"SETUP","pid_value":45,"addr":5,"endpoint":0,"crc":"0x1A","ok":true},{"index":63,"start_us":427.7708333333333,"end_us":435.91666666666663,"kind":"packet","pid":"DATA0","pid_value":195,"data_hex":"80 06 00 02 00 00 22 00","crc":"0xF4B0","ok":true},{"index":64,"start_us":436.3333333333333,"end_us":437.8333333333333,"kind":"packet","pid":"ACK","pid_value":210,"ok":true},{"index":65,"start_us":441.57291666666663,"end_us":444.3958333333333,"kind":"packet","pid":"IN","pid_value":105,"addr":5,"endpoint":0,"crc":"0x1A","ok":true},{"index":66,"start_us":444.8125,"end_us":446.3125,"kind":"packet","pid":"NAK","pid_value":90,"ok":true},{"index":67,"start_us":450.04166666666663,"end_us":452.875,"kind":"packet","pid":"IN","pid_value":105,"addr":5,"endpoint":0,"crc":"0x1A","ok":true},{"index":68,"start_us":453.29166666666663,"end_us":454.79166666666663,"kind":"packet","pid":"NAK","pid_value":90,"ok":true},{"index":69,"start_us":458.5208333333333,"end_us":461.35416666666663,"kind":"packet","pid":"IN","pid_value":105,"addr":5,"endpoint":0,"crc":"0x1A","ok":true},{"index":70,"start_us":461.7708333333333,"end_us":469.91666666666663,"kind":"packet","pid":"DATA1","pid_value":75,"data_hex":"09 02 22 00 01 01 00 80","crc":"0x400B","ok":true},{"index":71,"start_us":470.3333333333333,"end_us":471.8333333333333,"kind":"packet","pid":"ACK","pid_value":210,"ok":true},{"index":72,"start_us":475.57291666666663,"end_us":478.3958333333333,"kind":"packet","pid":"IN","pid_value":105,"addr":5,"endpoint":0,"crc":"0x1A","ok":true},{"index":73,"start_us":478.8125,"end_us":486.9583333333333,"kind":"packet","pid":"DATA0","pid_value":195,"data_hex":"32 09 04 00 00 01 03 00","crc":"0x8DF4","ok":true},{"index":74,"start_us":487.375,"end_us":488.875,"kind":"packet","pid":"ACK","pid_value":210,"ok":true},{"index":75,"start_us":492.60416666666663,"end_us":495.4375,"kind":"packet","pid":"IN","pid_value":105,"addr":5,"endpoint":0,"crc":"0x1A","ok":true},{"index":76,"start_us":495.85416666666663,"end_us":504,"kind":"packet","pid":"DATA1","pid_value":75,"data_hex":"00 00 09 21 11 01 00 01","crc":"0x5696","ok":true},{"index":77,"start_us":504.41666666666663,"end_us":505.91666666666663,"kind":"packet","pid":"ACK","pid_value":210,"ok":true},{"index":78,"start_us":509.6458333333333,"end_us":512.4791666666666,"kind":"packet","pid":"IN","pid_value":105,"addr":5,"endpoint":0,"crc":"0x1A","ok":true},{"index":79,"start_us":512.8958333333333,"end_us":521.125,"kind":"packet","pid":"DATA0","pid_value":195,"data_hex":"22 3F 00 07 05 81 03 08","crc":"0x2417","ok":true},{"index":80,"start_us":521.5416666666666,"end_us":523.0416666666666,"kind":"packet","pid":"ACK","pid_value":210,"ok":true},{"index":81,"start_us":526.7708333333333,"end_us":529.6041666666666,"kind":"packet","pid":"IN","pid_value":105,"addr":5,"endpoint":0,"crc":"0x1A","ok":true},{"index":82,"start_us":530.0208333333333,"end_us":534.2708333333333,"kind":"packet","pid":"DATA1","pid_value":75,"data_hex":"00 0A","crc":"0x487E","ok":true},{"index":83,"start_us":534.6770833333333,"end_us":536.1666666666666,"kind":"packet","pid":"ACK","pid_value":210,"ok":true},{"index":84,"start_us":539.9166666666666,"end_us":542.7291666666666,"kind":"packet","pid":"OUT","pid_value":225,"addr":5,"endpoint":0,"crc":"0x1A","ok":true},{"index":85,"start_us":543.1458333333333,"end_us":545.9791666666666,"kind":"packet","pid":"DATA1","pid_value":75,"crc":"0x0000","ok":true},{"index":86,"start_us":546.3958333333333,"end_us":547.8958333333333,"kind":"packet","pid":"ACK","pid_value":210,"ok":true},{"index":87,"start_us":551.6354166666666,"end_us":554.4583333333333,"kind":"packet","pid":"SETUP","pid_value":45,"addr":5,"endpoint":0,"crc":"0x1A","ok":true},{"index":88,"start_us":554.875,"end_us":563.1041666666666,"kind":"packet","pid":"DATA0","pid_value":195,"data_hex":"80 06 00 03 00 00 FF 00","crc":"0x64D4","ok":true},{"index":89,"start_us":563.5208333333333,"end_us":565.0208333333333,"kind":"packet","pid":"ACK","pid_value":210,"ok":true},{"index":90,"start_us":568.75,"end_us":571.5833333333333,"kind":"packet","pid":"IN","pid_value":105,"addr":5,"endpoint":0,"crc":"0x1A","ok":true},{"index":91,"start_us":572,"end_us":573.5,"kind":"packet","pid":"NAK","pid_value":90,"ok":true},{"index":92,"start_us":577.2395833333333,"end_us":580.0625,"kind":"packet","pid":"IN","pid_value":105,"addr":5,"endpoint":0,"crc":"0x1A","ok":true},{"index":93,"start_us":580.4791666666666,"end_us":581.9791666666666,"kind":"packet","pid":"NAK","pid_value":90,"ok":true},{"index":94,"start_us":585.7083333333333,"end_us":588.5416666666666,"kind":"packet","pid":"IN","pid_value":105,"addr":5,"endpoint":0,"crc":"0x1A","ok":true},{"index":95,"start_us":588.9583333333333,"end_us":594.4375,"kind":"packet","pid":"DATA1","pid_value":75,"data_hex":"04 03 09 04","crc":"0x7809","ok":true},{"index":96,"start_us":594.8541666666666,"end_us":596.3541666666666,"kind":"packet","pid":"ACK","pid_value":210,"ok":true},{"index":97,"start_us":600.1041666666666,"end_us":602.9166666666666,"kind":"packet","pid":"OUT","pid_value":225,"addr":5,"endpoint":0,"crc":"0x1A","ok":true},{"index":98,"start_us":603.3333333333333,"end_us":606.1666666666666,"kind":"packet","pid":"DATA1","pid_value":75,"crc":"0x0000","ok":true},{"index":99,"start_us":606.5729166666666,"end_us":608.0833333333333,"kind":"packet","pid":"ACK","pid_value":210,"ok":true},{"index":100,"start_us":611.8125,"end_us":614.6458333333333,"kind":"packet","pid":"SETUP","pid_value":45,"addr":5,"endpoint":0,"crc":"0x1A","ok":true},{"index":101,"start_us":615.0625,"end_us":623.2916666666666,"kind":"packet","pid":"DATA0","pid_value":195,"data_hex":"80 06 02 03 09 04 FF 00","crc":"0xDB97","ok":true},{"index":102,"start_us":623.7083333333333,"end_us":625.1875,"kind":"packet","pid":"ACK","pid_value":210,"ok":true},{"index":103,"start_us":628.9375,"end_us":631.7708333333333,"kind":"packet","pid":"IN","pid_value":105,"addr":5,"endpoint":0,"crc":"0x1A","ok":true},{"index":104,"start_us":632.1770833333333,"end_us":633.6666666666666,"kind":"packet","pid":"NAK","pid_value":90,"ok":true},{"index":105,"start_us":637.4166666666666,"end_us":640.25,"kind":"packet","pid":"IN","pid_value":105,"addr":5,"endpoint":0,"crc":"0x1A","ok":true},{"index":106,"start_us":640.65625,"end_us":642.1458333333333,"kind":"packet","pid":"NAK","pid_value":90,"ok":true},{"index":107,"start_us":645.8958333333333,"end_us":648.7291666666666,"kind":"packet","pid":"IN","pid_value":105,"addr":5,"endpoint":0,"crc":"0x1A","ok":true},{"index":108,"start_us":649.1458333333333,"end_us":657.2916666666666,"kind":"packet","pid":"DATA1","pid_value":75,"data_hex":"12 03 42 00 65 00 6E 00","crc":"0xAF31","ok":true},{"index":109,"start_us":657.6979166666666,"end_us":659.1875,"kind":"packet","pid":"ACK","pid_value":210,"ok":true},{"index":110,"start_us":662.9375,"end_us":665.7708333333333,"kind":"packet","pid":"IN","pid_value":105,"addr":5,"endpoint":0,"crc":"0x1A","ok":true},{"index":111,"start_us":666.1666666666666,"end_us":674.3333333333333,"kind":"packet","pid":"DATA0","pid_value":195,"data_hex":"63 00 68 00 50 00 6F 00","crc":"0xD1CD","ok":true},{"index":112,"start_us":674.75,"end_us":676.25,"kind":"packet","pid":"ACK","pid_value":210,"ok":true},{"index":113,"start_us":679.9791666666666,"end_us":682.8125,"kind":"packet","pid":"IN","pid_value":105,"addr":5,"endpoint":0,"crc":"0x1A","ok":true},{"index":114,"start_us":683.21875,"end_us":687.4583333333333,"kind":"packet","pid":"DATA1","pid_value":75,"data_hex":"64 00","crc":"0x8FD4","ok":true},{"index":115,"start_us":687.875,"end_us":689.375,"kind":"packet","pid":"ACK","pid_value":210,"ok":true},{"index":116,"start_us":693.1041666666666,"end_us":695.9375,"kind":"packet","pid":"OUT","pid_value":225,"addr":5,"endpoint":0,"crc":"0x1A","ok":true},{"index":117,"start_us":696.3541666666666,"end_us":699.1875,"kind":"packet","pid":"DATA1","pid_value":75,"crc":"0x0000","ok":true},{"index":118,"start_us":699.6041666666666,"end_us":701.1041666666666,"kind":"packet","pid":"ACK","pid_value":210,"ok":true},{"index":119,"start_us":704.8333333333333,"end_us":707.6666666666666,"kind":"packet","pid":"SETUP","pid_value":45,"addr":5,"endpoint":0,"crc":"0x1A","ok":true},{"index":120,"start_us":708.0625,"end_us":716.2291666666666,"kind":"packet","pid":"DATA0","pid_value":195,"data_hex":"00 09 01 00 00 00 00 00","crc":"0x2527","ok":true},{"index":121,"start_us":716.6458333333333,"end_us":718.125,"kind":"packet","pid":"ACK","pid_value":210,"ok":true},{"index":122,"start_us":721.875,"end_us":724.7083333333333,"kind":"packet","pid":"IN","pid_value":105,"addr":5,"endpoint":0,"crc":"0x1A","ok":true},{"index":123,"start_us":725.125,"end_us":727.9375,"kind":"packet","pid":"DATA1","pid_value":75,"crc":"0x0000","ok":true},{"index":124,"start_us":728.3541666666666,"end_us":729.8541666666666,"kind":"packet","pid":"ACK","pid_value":210,"ok":true},{"index":125,"start_us":733.5833333333333,"end_us":736.4166666666666,"kind":"packet","pid":"SETUP","pid_value":45,"addr":5,"endpoint":0,"crc":"0x1A","ok":true},{"index":126,"start_us":736.8333333333333,"end_us":744.9791666666666,"kind":"packet","pid":"DATA0","pid_value":195,"data_hex":"21 0A 00 00 00 00 00 00","crc":"0x20D6","ok":true},{"index":127,"start_us":745.3958333333333,"end_us":746.8958333333333,"kind":"packet","pid":"ACK","pid_value":210,"ok":true},{"index":128,"start_us":750.6354166666666,"end_us":753.4583333333333,"kind":"packet","pid":"IN","pid_value":105,"addr":5,"endpoint":0,"crc":"0x1A","ok":true},{"index":129,"start_us":753.875,"end_us":755.375,"kind":"packet","pid":"STALL","pid_value":30,"ok":true},{"index":130,"start_us":759.1041666666666,"end_us":761.9375,"kind":"packet","pid":"IN","pid_value":105,"addr":5,"endpoint":1,"crc":"0x0C","ok":true},{"index":131,"start_us":762.3541666666666,"end_us":763.8541666666666,"kind":"packet","pid":"NAK","pid_value":90,"ok":true},{"index":132,"start_us":767.5833333333333,"end_us":770.4166666666666,"kind":"packet","pid":"IN","pid_value":105,"addr":5,"endpoint":1,"crc":"0x0C","ok":true},{"index":133,"start_us":770.8333333333333,"end_us":772.3333333333333,"kind":"packet","pid":"NAK","pid_value":90,"ok":true},{"index":134,"start_us":776.0625,"end_us":778.8958333333333,"kind":"packet","pid":"IN","pid_value":105,"addr":5,"endpoint":1,"crc":"0x0C","ok":true},{"index":135,"start_us":779.3125,"end_us":780.8125,"kind":"packet","pid":"NAK","pid_value":90,"ok":true},{"index":136,"start_us":784.5416666666666,"end_us":787.375,"kind":"packet","pid":"IN","pid_value":105,"addr":5,"endpoint":1,"crc":"0x0C","ok":true},{"index":137,"start_us":787.7916666666666,"end_us":795.9375,"kind":"packet","pid":"DATA0","pid_value":195,"data_hex":"00 00 04 00 00 00 00 00","crc":"0x70BE","ok":true},{"index":138,"start_us":796.3541666666666,"end_us":797.8541666666666,"kind":"packet","pid":"ACK","pid_value":210,"ok":true}],"transactions":[{"index":1,"start_us":8.333333333333332,"end_us":58.20833333333333,"type":"RESET","addr":0,"endpoint":0,"data_len":0,"count":1,"packets":[1],"ok":true},{"index":2,"start_us":78.0625,"end_us":91.35416666666666,"type":"SETUP","addr":0,"endpoint":0,"data_pid":"DATA0","data_hex":"80 06 00 01 00 00 40 00","data_len":8,"handshake":"ACK","count":1,"setup":{"bm_request_type":128,"b_request":6,"w_value":256,"w_index":0,"w_length":64,"direction":"in","type":"standard","recipient":"device","name":"GET_DESCRIPTOR","summary":"GET_DESCRIPTOR DEVICE length 64"},"packets":[3,4,5],"ok":true},{"index":3,"start_us":95.10416666666666,"end_us":108.33333333333333,"type":"IN","addr":0,"endpoint":0,"data_len":0,"handshake":"NAK","count":2,"packets":[6,7,8,9],"ok":true},{"index":4,"start_us":112.0625,"end_us":125.375,"type":"IN","addr":0,"endpoint":0,"data_pid":"DATA1","data_hex":"12 01 00 02 00 00 00 08","data_len":8,"handshake":"ACK","count":1,"packets":[10,11,12],"ok":true},{"index":5,"start_us":129.10416666666666,"end_us":137.08333333333331,"type":"OUT","addr":0,"endpoint":0,"data_pid":"DATA1","data_len":0,"handshake":"ACK","count":1,"packets":[13,14,15],"ok":true},{"index":6,"start_us":140.83333333333331,"end_us":190.70833333333331,"type":"RESET","addr":0,"endpoint":0,"data_len":0,"count":1,"packets":[16],"ok":true},{"index":7,"start_us":204,"end_us":217.3125,"type":"SETUP","addr":0,"endpoint":0,"data_pid":"DATA0","data_hex":"00 05 05 00 00 00 00 00","data_len":8,"handshake":"ACK","count":1,"setup":{"bm_request_type":0,"b_request":5,"w_value":5,"w_index":0,"w_length":0,"direction":"out","type":"standard","recipient":"device","name":"SET_ADDRESS","summary":"SET_ADDRESS 5"},"packets":[17,18,19],"ok":true},{"index":8,"start_us":221.04166666666666,"end_us":229.02083333333331,"type":"IN","addr":0,"endpoint":0,"data_pid":"DATA1","data_len":0,"handshake":"ACK","count":1,"packets":[20,21,22],"ok":true},{"index":9,"start_us":239.33333333333331,"end_us":252.625,"type":"SETUP","addr":5,"endpoint":0,"data_pid":"DATA0","data_hex":"80 06 00 01 00 00 12 00","data_len":8,"handshake":"ACK","count":1,"setup":{"bm_request_type":128,"b_request":6,"w_value":256,"w_index":0,"w_length":18,"direction":"in","type":"standard","recipient":"device","name":"GET_DESCRIPTOR","summary":"GET_DESCRIPTOR DEVICE length 18"},"packets":[24,25,26],"ok":true},{"index":10,"start_us":256.375,"end_us":269.5833333333333,"type":"IN","addr":5,"endpoint":0,"data_len":0,"handshake":"NAK","count":2,"packets":[27,28,29,30],"ok":true},{"index":11,"start_us":273.3333333333333,"end_us":286.625,"type":"IN","addr":5,"endpoint":0,"data_pid":"DATA1","data_hex":"12 01 00 02 00 00 00 08","data_len":8,"handshake":"ACK","count":1,"packets":[31,32,33],"ok":true},{"index":12,"start_us":290.3645833333333,"end_us":303.66666666666663,"type":"IN","addr":5,"endpoint":0,"data_pid":"DATA0","data_hex":"83 04 40 57 00 01 01 02","data_len":8,"handshake":"ACK","count":1,"packets":[34,35,36],"ok":true},{"index":13,"start_us":307.41666666666663,"end_us":320.7083333333333,"type":"IN","addr":5,"endpoint":0,"data_pid":"DATA0","data_hex":"83 04 40 57 00 01 01 02","data_len":8,"handshake":"ACK","count":1,"packets":[37,38,39],"ok":true},{"index":14,"start_us":324.4583333333333,"end_us":333.9375,"type":"IN","addr":5,"endpoint":0,"data_pid":"DATA1","data_hex":"03 01","data_len":2,"handshake":"ACK","count":1,"packets":[40,41,42],"ok":true},{"index":15,"start_us":337.66666666666663,"end_us":345.6458333333333,"type":"OUT","addr":5,"endpoint":0,"data_pid":"DATA1","data_len":0,"handshake":"ACK","count":1,"packets":[43,44,45],"ok":true},{"index":16,"start_us":349.3958333333333,"end_us":362.6875,"type":"SETUP","addr":5,"endpoint":0,"data_pid":"DATA0","data_hex":"80 06 00 02 00 00 09 00","data_len":8,"handshake":"ACK","count":1,"setup":{"bm_request_type":128,"b_request":6,"w_value":512,"w_index":0,"w_length":9,"direction":"in","type":"standard","recipient":"device","name":"GET_DESCRIPTOR","summary":"GET_DESCRIPTOR CONFIGURATION length 9"},"packets":[46,47,48],"ok":true},{"index":17,"start_us":366.4270833333333,"end_us":379.6458333333333,"type":"IN","addr":5,"endpoint":0,"data_len":0,"handshake":"NAK","count":2,"packets":[49,50,51,52],"ok":true},{"index":18,"start_us":383.38541666666663,"end_us":396.6875,"type":"IN","addr":5,"endpoint":0,"data_pid":"DATA1","data_hex":"09 02 22 00 01 01 00 80","data_len":8,"handshake":"ACK","count":1,"packets":[53,54,55],"ok":true},{"index":19,"start_us":400.41666666666663,"end_us":409.0833333333333,"type":"IN","addr":5,"endpoint":0,"data_pid":"DATA0","data_hex":"32","data_len":1,"handshake":"ACK","count":1,"packets":[56,57,58],"ok":true},{"index":20,"start_us":412.8125,"end_us":420.79166666666663,"type":"OUT","addr":5,"endpoint":0,"data_pid":"DATA1","data_len":0,"handshake":"ACK","count":1,"packets":[59,60,61],"ok":true},{"index":21,"start_us":424.53125,"end_us":437.8333333333333,"type":"SETUP","addr":5,"endpoint":0,"data_pid":"DATA0","data_hex":"80 06 00 02 00 00 22 00","data_len":8,"handshake":"ACK","count":1,"setup":{"bm_request_type":128,"b_request":6,"w_value":512,"w_index":0,"w_length":34,"direction":"in","type":"standard","recipient":"device","name":"GET_DESCRIPTOR","summary":"GET_DESCRIPTOR CONFIGURATION length 34"},"packets":[62,63,64],"ok":true},{"index":22,"start_us":441.57291666666663,"end_us":454.79166666666663,"type":"IN","addr":5,"endpoint":0,"data_len":0,"handshake":"NAK","count":2,"packets":[65,66,67,68],"ok":true},{"index":23,"start_us":458.5208333333333,"end_us":471.8333333333333,"type":"IN","addr":5,"endpoint":0,"data_pid":"DATA1","data_hex":"09 02 22 00 01 01 00 80","data_len":8,"handshake":"ACK","count":1,"packets":[69,70,71],"ok":true},{"index":24,"start_us":475.57291666666663,"end_us":488.875,"type":"IN","addr":5,"endpoint":0,"data_pid":"DATA0","data_hex":"32 09 04 00 00 01 03 00","data_len":8,"handshake":"ACK","count":1,"packets":[72,73,74],"ok":true},{"index":25,"start_us":492.60416666666663,"end_us":505.91666666666663,"type":"IN","addr":5,"endpoint":0,"data_pid":"DATA1","data_hex":"00 00 09 21 11 01 00 01","data_len":8,"handshake":"ACK","count":1,"packets":[75,76,77],"ok":true},{"index":26,"start_us":509.6458333333333,"end_us":523.0416666666666,"type":"IN","addr":5,"endpoint":0,"data_pid":"DATA0","data_hex":"22 3F 00 07 05 81 03 08","data_len":8,"handshake":"ACK","count":1,"packets":[78,79,80],"ok":true},{"index":27,"start_us":526.7708333333333,"end_us":536.1666666666666,"type":"IN","addr":5,"endpoint":0,"data_pid":"DATA1","data_hex":"00 0A","data_len":2,"handshake":"ACK","count":1,"packets":[81,82,83],"ok":true},{"index":28,"start_us":539.9166666666666,"end_us":547.8958333333333,"type":"OUT","addr":5,"endpoint":0,"data_pid":"DATA1","data_len":0,"handshake":"ACK","count":1,"packets":[84,85,86],"ok":true},{"index":29,"start_us":551.6354166666666,"end_us":565.0208333333333,"type":"SETUP","addr":5,"endpoint":0,"data_pid":"DATA0","data_hex":"80 06 00 03 00 00 FF 00","data_len":8,"handshake":"ACK","count":1,"setup":{"bm_request_type":128,"b_request":6,"w_value":768,"w_index":0,"w_length":255,"direction":"in","type":"standard","recipient":"device","name":"GET_DESCRIPTOR","summary":"GET_DESCRIPTOR STRING index 0 length 255"},"packets":[87,88,89],"ok":true},{"index":30,"start_us":568.75,"end_us":581.9791666666666,"type":"IN","addr":5,"endpoint":0,"data_len":0,"handshake":"NAK","count":2,"packets":[90,91,92,93],"ok":true},{"index":31,"start_us":585.7083333333333,"end_us":596.3541666666666,"type":"IN","addr":5,"endpoint":0,"data_pid":"DATA1","data_hex":"04 03 09 04","data_len":4,"handshake":"ACK","count":1,"packets":[94,95,96],"ok":true},{"index":32,"start_us":600.1041666666666,"end_us":608.0833333333333,"type":"OUT","addr":5,"endpoint":0,"data_pid":"DATA1","data_len":0,"handshake":"ACK","count":1,"packets":[97,98,99],"ok":true},{"index":33,"start_us":611.8125,"end_us":625.1875,"type":"SETUP","addr":5,"endpoint":0,"data_pid":"DATA0","data_hex":"80 06 02 03 09 04 FF 00","data_len":8,"handshake":"ACK","count":1,"setup":{"bm_request_type":128,"b_request":6,"w_value":770,"w_index":1033,"w_length":255,"direction":"in","type":"standard","recipient":"device","name":"GET_DESCRIPTOR","summary":"GET_DESCRIPTOR STRING index 2 lang 0x0409 length 255"},"packets":[100,101,102],"ok":true},{"index":34,"start_us":628.9375,"end_us":642.1458333333333,"type":"IN","addr":5,"endpoint":0,"data_len":0,"handshake":"NAK","count":2,"packets":[103,104,105,106],"ok":true},{"index":35,"start_us":645.8958333333333,"end_us":659.1875,"type":"IN","addr":5,"endpoint":0,"data_pid":"DATA1","data_hex":"12 03 42 00 65 00 6E 00","data_len":8,"handshake":"ACK","count":1,"packets":[107,108,109],"ok":true},{"index":36,"start_us":662.9375,"end_us":676.25,"type":"IN","addr":5,"endpoint":0,"data_pid":"DATA0","data_hex":"63 00 68 00 50 00 6F 00","data_len":8,"handshake":"ACK","count":1,"packets":[110,111,112],"ok":true},{"index":37,"start_us":679.9791666666666,"end_us":689.375,"type":"IN","addr":5,"endpoint":0,"data_pid":"DATA1","data_hex":"64 00","data_len":2,"handshake":"ACK","count":1,"packets":[113,114,115],"ok":true},{"index":38,"start_us":693.1041666666666,"end_us":701.1041666666666,"type":"OUT","addr":5,"endpoint":0,"data_pid":"DATA1","data_len":0,"handshake":"ACK","count":1,"packets":[116,117,118],"ok":true},{"index":39,"start_us":704.8333333333333,"end_us":718.125,"type":"SETUP","addr":5,"endpoint":0,"data_pid":"DATA0","data_hex":"00 09 01 00 00 00 00 00","data_len":8,"handshake":"ACK","count":1,"setup":{"bm_request_type":0,"b_request":9,"w_value":1,"w_index":0,"w_length":0,"direction":"out","type":"standard","recipient":"device","name":"SET_CONFIGURATION","summary":"SET_CONFIGURATION 1"},"packets":[119,120,121],"ok":true},{"index":40,"start_us":721.875,"end_us":729.8541666666666,"type":"IN","addr":5,"endpoint":0,"data_pid":"DATA1","data_len":0,"handshake":"ACK","count":1,"packets":[122,123,124],"ok":true},{"index":41,"start_us":733.5833333333333,"end_us":746.8958333333333,"type":"SETUP","addr":5,"endpoint":0,"data_pid":"DATA0","data_hex":"21 0A 00 00 00 00 00 00","data_len":8,"handshake":"ACK","count":1,"setup":{"bm_request_type":33,"b_request":10,"w_value":0,"w_index":0,"w_length":0,"direction":"out","type":"class","recipient":"interface","name":"class SET_IDLE","summary":"class SET_IDLE value 0x0000 index 0x0000 length 0"},"packets":[125,126,127],"ok":true},{"index":42,"start_us":750.6354166666666,"end_us":755.375,"type":"IN","addr":5,"endpoint":0,"data_len":0,"handshake":"STALL","count":1,"packets":[128,129],"ok":true},{"index":43,"start_us":759.1041666666666,"end_us":780.8125,"type":"IN","addr":5,"endpoint":1,"data_len":0,"handshake":"NAK","count":3,"packets":[130,131,132,133,134,135],"ok":true},{"index":44,"start_us":784.5416666666666,"end_us":797.8541666666666,"type":"IN","addr":5,"endpoint":1,"data_pid":"DATA0","data_hex":"00 00 04 00 00 00 00 00","data_len":8,"handshake":"ACK","count":1,"packets":[136,137,138],"ok":true}],"transfers":[{"index":1,"start_us":78.0625,"end_us":137.08333333333331,"addr":0,"endpoint":0,"request":"GET_DESCRIPTOR DEVICE length 64","setup":{"bm_request_type":128,"b_request":6,"w_value":256,"w_index":0,"w_length":64,"direction":"in","type":"standard","recipient":"device","name":"GET_DESCRIPTOR","summary":"GET_DESCRIPTOR DEVICE length 64"},"data_hex":"12 01 00 02 00 00 00 08","data_len":8,"status":"OK","detail":"USB 2.00, max packet 8","ok":true},{"index":2,"start_us":204,"end_us":229.02083333333331,"addr":0,"endpoint":0,"request":"SET_ADDRESS 5","setup":{"bm_request_type":0,"b_request":5,"w_value":5,"w_index":0,"w_length":0,"direction":"out","type":"standard","recipient":"device","name":"SET_ADDRESS","summary":"SET_ADDRESS 5"},"data_len":0,"status":"OK","ok":true},{"index":3,"start_us":239.33333333333331,"end_us":345.6458333333333,"addr":5,"endpoint":0,"request":"GET_DESCRIPTOR DEVICE length 18","setup":{"bm_request_type":128,"b_request":6,"w_value":256,"w_index":0,"w_length":18,"direction":"in","type":"standard","recipient":"device","name":"GET_DESCRIPTOR","summary":"GET_DESCRIPTOR DEVICE length 18"},"data_hex":"12 01 00 02 00 00 00 08 83 04 40 57 00 01 01 02 03 01","data_len":18,"status":"OK","detail":"USB 2.00, max packet 8, VID 0x0483 PID 0x5740, 1 configuration(s)","ok":true},{"index":4,"start_us":349.3958333333333,"end_us":420.79166666666663,"addr":5,"endpoint":0,"request":"GET_DESCRIPTOR CONFIGURATION length 9","setup":{"bm_request_type":128,"b_request":6,"w_value":512,"w_index":0,"w_length":9,"direction":"in","type":"standard","recipient":"device","name":"GET_DESCRIPTOR","summary":"GET_DESCRIPTOR CONFIGURATION length 9"},"data_hex":"09 02 22 00 01 01 00 80 32","data_len":9,"status":"OK","detail":"total length 34, 1 interface(s), 100 mA","ok":true},{"index":5,"start_us":424.53125,"end_us":547.8958333333333,"addr":5,"endpoint":0,"request":"GET_DESCRIPTOR CONFIGURATION length 34","setup":{"bm_request_type":128,"b_request":6,"w_value":512,"w_index":0,"w_length":34,"direction":"in","type":"standard","recipient":"device","name":"GET_DESCRIPTOR","summary":"GET_DESCRIPTOR CONFIGURATION length 34"},"data_hex":"09 02 22 00 01 01 00 80 32 09 04 00 00 01 03 00 00 00 09 21 11 01 00 01 22 3F 00 07 05 81 03 08 00 0A","data_len":34,"status":"OK","detail":"total length 34, 1 interface(s), 100 mA; interface 0 alt 0 class 0x03; endpoint 0x81 interrupt 8 bytes","ok":true},{"index":6,"start_us":551.6354166666666,"end_us":608.0833333333333,"addr":5,"endpoint":0,"request":"GET_DESCRIPTOR STRING index 0 length 255","setup":{"bm_request_type":128,"b_request":6,"w_value":768,"w_index":0,"w_length":255,"direction":"in","type":"standard","recipient":"device","name":"GET_DESCRIPTOR","summary":"GET_DESCRIPTOR STRING index 0 length 255"},"data_hex":"04 03 09 04","data_len":4,"status":"OK","detail":"languages 0x0409","ok":true},{"index":7,"start_us":611.8125,"end_us":701.1041666666666,"addr":5,"endpoint":0,"request":"GET_DESCRIPTOR STRING index 2 lang 0x0409 length 255","setup":{"bm_request_type":128,"b_request":6,"w_value":770,"w_index":1033,"w_length":255,"direction":"in","type":"standard","recipient":"device","name":"GET_DESCRIPTOR","summary":"GET_DESCRIPTOR STRING index 2 lang 0x0409 length 255"},"data_hex":"12 03 42 00 65 00 6E 00 63 00 68 00 50 00 6F 00 64 00","data_len":18,"status":"OK","detail":"\"BenchPod\"","ok":true},{"index":8,"start_us":704.8333333333333,"end_us":729.8541666666666,"addr":5,"endpoint":0,"request":"SET_CONFIGURATION 1","setup":{"bm_request_type":0,"b_request":9,"w_value":1,"w_index":0,"w_length":0,"direction":"out","type":"standard","recipient":"device","name":"SET_CONFIGURATION","summary":"SET_CONFIGURATION 1"},"data_len":0,"status":"OK","ok":true},{"index":9,"start_us":733.5833333333333,"end_us":755.375,"addr":5,"endpoint":0,"request":"class SET_IDLE value 0x0000 index 0x0000 length 0","setup":{"bm_request_type":33,"b_request":10,"w_value":0,"w_index":0,"w_length":0,"direction":"out","type":"class","recipient":"interface","name":"class SET_IDLE","summary":"class SET_IDLE value 0x0000 index 0x0000 length 0"},"data_len":0,"status":"STALL","ok":false}],"sof_count":2,"keep_alive_count":0,"error_count":0}},{"name":"low_speed_enumeration_6msps_jitter","sample_rate_hz":6000000,"params":{"dp":1,"dm":2,"speed":"low"},"count":39192,"edges":[[0,2],[394,0],[2759,2],[3389,0],[3390,1],[3394,2],[3398,1],[3401,3],[3402,2],[3405,1],[3409,2],[3413,1],[3425,2],[3433,1],[3437,2],[3445,1],[3453,2],[3457,1],[3464,3],[3465,2],[3468,1],[3480,2],[3484,1],[3488,2],[3492,1],[3516,0],[3524,2],[3701,1],[3705,2],[3709,1],[3713,2],[3717,1],[3721,2],[3725,1],[3736,2],[3748,1],[3756,2],[3760,1],[3764,2],[3768,1],[3772,2],[3776,1],[3780,2],[3784,1],[3788,2],[3791,0],[3792,1],[3796,2],[3799,0],[3800,1],[3803,2],[3807,1],[3815,2],[3819,1],[3823,2],[3827,0],[3835,2],[3855,1],[3858,3],[3859,2],[3863,1],[3866,2],[3870,1],[3874,2],[3878,1],[3894,2],[3898,1],[3902,2],[3906,1],[3918,2],[3922,1],[3926,2],[3930,1],[3933,2],[3937,0],[3938,1],[3941,2],[3949,1],[3961,2],[3965,1],[3969,2],[3973,1],[3977,2],[3981,1],[3985,2],[3989,1],[3993,2],[3997,1],[4001,2],[4004,0],[4005,1],[4008,3],[4009,2],[4016,1],[4020,2],[4024,1],[4028,2],[4032,1],[4036,2],[4040,1],[4044,2],[4048,1],[4052,2],[4056,1],[4060,2],[4064,1],[4068,2],[4071,0],[4072,1],[4075,2],[4079,1],[4083,2],[4087,1],[4091,2],[4095,1],[4099,2],[4103,1],[4107,2],[4111,1],[4115,2],[4119,1],[4123,2],[4127,1],[4135,2],[4138,1],[4142,2],[4146,1],[4150,2],[4154,1],[4158,2],[4162,1],[4166,2],[4174,1],[4190,2],[4201,1],[4205,2],[4213,1],[4221,2],[4225,1],[4233,0],[4241,2],[4261,1],[4264,2],[4268,1],[4272,3],[4273,2],[4276,1],[4280,2],[4284,1],[4292,2],[4300,1],[4304,2],[4312,1],[4324,0],[4332,2],[4509,1],[4513,2],[4517,1],[4521,2],[4525,1],[4528,3],[4529,2],[4532,0],[4533,1],[4544,2],[4548,1],[4556,2],[4568,1],[4572,2],[4576,1],[4580,2],[4584,1],[4588,2],[4591,0],[4592,1],[4596,2],[4599,0],[4600,1],[4603,2],[4607,0],[4608,1],[4611,2],[4615,1],[4623,2],[4627,1],[4631,2],[4635,0],[4643,2],[4662,1],[4667,2],[4670,1],[4674,2],[4678,1],[4682,2],[4686,1],[4694,2],[4702,1],[4714,2],[4721,0],[4722,1],[4726,0],[4733,2],[4911,1],[4915,2],[4919,1],[4923,2],[4927,1],[4930,2],[4935,1],[4946,2],[4950,1],[4958,2],[4970,1],[4974,2],[4978,1],[4982,2],[4986,1],[4990,2],[4993,0],[4994,1],[4997,3],[4998,2],[5001,0],[5002,1],[5005,2],[5009,0],[5010,1],[5013,2],[5017,1],[5025,2],[5029,1],[5033,2],[5037,0],[5045,2],[5064,0],[5065,1],[5068,3],[5069,2],[5072,0],[5073,1],[5076,2],[5080,1],[5084,2],[5088,1],[5096,2],[5104,1],[5116,2],[5124,1],[5128,0],[5135,2],[5313,1],[5317,2],[5321,1],[5325,2],[5329,1],[5333,2],[5336,0],[5337,1],[5348,2],[5352,1],[5360,2],[5372,1],[5376,2],[5380,1],[5384,2],[5388,1],[5392,2],[5395,0],[5396,1],[5399,3],[5400,2],[5404,1],[5407,2],[5411,1],[5415,2],[5419,1],[5427,2],[5431,1],[5435,2],[5439,0],[5447,2],[5466,1],[5470,3],[5471,2],[5474,1],[5478,2],[5482,1],[5486,2],[5490,1],[5506,2],[5514,1],[5518,2],[5526,1],[5529,3],[5530,2],[5537,1],[5541,2],[5549,1],[5553,2],[5557,1],[5565,2],[5569,1],[5573,2],[5577,1],[5581,2],[5585,1],[5588,3],[5589,2],[5593,1],[5597,2],[5600,0],[5601,1],[5604,3],[5605,2],[5608,1],[5612,2],[5616,1],[5620,2],[5624,1],[5632,2],[5636,1],[5640,2],[5644,1],[5648,2],[5652,1],[5656,2],[5660,1],[5663,3],[5664,2],[5667,0],[5668,1],[5671,2],[5675,1],[5679,2],[5683,1],[5687,2],[5691,1],[5695,2],[5699,1],[5703,2],[5707,1],[5711,2],[5715,1],[5719,2],[5723,1],[5726,3],[5727,2],[5731,1],[5735,2],[5738,0],[5739,1],[5742,3],[5743,2],[5746,1],[5750,2],[5754,1],[5758,2],[5766,1],[5770,2],[5774,1],[5778,2],[5794,1],[5802,2],[5809,0],[5810,1],[5825,2],[5829,1],[5845,0],[5853,2],[5872,1],[5876,2],[5880,1],[5884,2],[5888,1],[5892,2],[5896,1],[5904,2],[5912,1],[5916,2],[5924,1],[5936,0],[5943,2],[6121,1],[6125,2],[6129,1],[6133,2],[6136,1],[6140,2],[6144,1],[6156,2],[6160,1],[6164,2],[6168,1],[6184,2],[6188,1],[6191,3],[6192,2],[6195,1],[6200,2],[6203,0],[6204,1],[6207,2],[6211,0],[6212,1],[6215,2],[6219,1],[6223,2],[6227,1],[6235,2],[6239,1],[6243,2],[6247,0],[6255,2],[6274,1],[6278,2],[6282,1],[6286,2],[6290,1],[6294,2],[6298,1],[6314,2],[6322,1],[6326,2],[6333,1],[6337,3],[6338,2],[6341,0],[6342,1],[6345,2],[6349,1],[6353,2],[6357,1],[6361,2],[6365,1],[6369,2],[6373,1],[6377,2],[6381,1],[6385,2],[6389,1],[6393,2],[6397,1],[6401,0],[6408,2],[6428,1],[6432,2],[6436,1],[6440,2],[6444,1],[6448,2],[6452,1],[6459,3],[6460,2],[6467,1],[6471,2],[6479,1],[6491,0],[6499,2],[6676,0],[9041,2],[9672,1],[9675,3],[9676,2],[9679,1],[9683,2],[9687,1],[9691,2],[9695,1],[9707,2],[9719,1],[9727,2],[9731,1],[9734,2],[9738,1],[9742,2],[9746,1],[9750,2],[9754,1],[9758,2],[9762,1],[9766,2],[9770,1],[9774,2],[9778,1],[9786,2],[9790,1],[9794,2],[9797,0],[9805,2],[9825,1],[9829,2],[9833,1],[9837,2],[9841,1],[9845,2],[9849,1],[9864,3],[9865,2],[9868,1],[9872,2],[9876,0],[9877,1],[9888,2],[9892,1],[9896,2],[9900,1],[9904,2],[9908,1],[9912,2],[9916,1],[9924,2],[9932,1],[9935,3],[9936,2],[9940,1],[9943,2],[9947,1],[9955,2],[9963,1],[9967,2],[9971,1],[9975,2],[9979,1],[9983,2],[9987,1],[9991,2],[9994,0],[9995,1],[9999,2],[10003,1],[10006,3],[10007,2],[10010,1],[10014,2],[10018,1],[10022,2],[10026,1],[10030,2],[10034,1],[10038,2],[10042,1],[10046,2],[10050,1],[10054,2],[10058,1],[10062,2],[10065,0],[10066,1],[10069,3],[10070,2],[10073,0],[10074,1],[10077,2],[10081,1],[10085,2],[10089,1],[10093,2],[10097,1],[10101,2],[10105,1],[10109,2],[10113,1],[10117,2],[10121,1],[10124,3],[10125,2],[10129,1],[10133,2],[10136,0],[10137,1],[10140,2],[10148,1],[10156,2],[10176,1],[10180,2],[10184,1],[10188,2],[10196,1],[10203,0],[10211,2],[10231,1],[10235,2],[10239,1],[10243,2],[10247,1],[10251,2],[10255,1],[10263,2],[10271,1],[10274,3],[10275,2],[10282,1],[10294,0],[10302,2],[10479,1],[10483,2],[10487,1],[10491,2],[10495,1],[10499,2],[10503,1],[10515,2],[10519,1],[10527,2],[10538,1],[10542,3],[10543,2],[10546,1],[10550,2],[10554,1],[10558,2],[10562,1],[10566,2],[10570,1],[10574,2],[10578,1],[10582,2],[10586,1],[10594,2],[10597,0],[10598,1],[10602,2],[10605,0],[10613,2],[10633,1],[10637,2],[10641,1],[10645,2],[10649,1],[10653,2],[10657,1],[10672,2],[10680,1],[10684,2],[10692,1],[10696,2],[10700,1],[10704,2],[10708,1],[10712,2],[10716,1],[10720,2],[10724,1],[10728,2],[10732,1],[10735,2],[10739,1],[10743,2],[10747,1],[10751,2],[10755,1],[10759,0],[10767,2],[10787,1],[10791,2],[10794,1],[10799,2],[10802,0],[10803,1],[10806,3],[10807,2],[10810,1],[10818,2],[10826,1],[10830,2],[10838,1],[10850,0],[10858,2],[11035,1],[11039,2],[11043,1],[11047,2],[11051,1],[11055,2],[11059,1],[11070,2],[11078,1],[11082,2],[11090,1],[11102,2],[11110,1],[11114,2],[11126,1],[11130,2],[11133,1],[11137,2],[11141,0],[11142,1],[11145,2],[11149,1],[11153,2],[11157,1],[11161,0],[11169,2],[11346,1],[11350,2],[11354,1],[11358,2],[11362,1],[11366,2],[11370,1],[11382,2],[11394,1],[11401,2],[11405,0],[11406,1],[11413,2],[11421,1],[11425,2],[11429,1],[11433,2],[11437,1],[11441,2],[11445,1],[11449,2],[11453,1],[11460,2],[11472,0],[11480,2],[11500,1],[11504,2],[11508,1],[11512,2],[11516,1],[11520,2],[11524,1],[11540,2],[11543,1],[11547,2],[11551,1],[11563,2],[11567,1],[11571,2],[11575,1],[11579,2],[11583,1],[11587,2],[11595,1],[11606,3],[11607,2],[11610,1],[11614,2],[11618,1],[11622,2],[11626,1],[11630,2],[11634,1],[11638,2],[11642,1],[11646,2],[11650,1],[11654,2],[11662,1],[11666,2],[11669,1],[11673,2],[11677,1],[11681,2],[11685,1],[11689,2],[11693,1],[11697,2],[11701,1],[11705,2],[11709,1],[11713,2],[11717,1],[11721,2],[11724,0],[11725,1],[11728,2],[11732,1],[11736,2],[11741,1],[11744,2],[11748,1],[11752,2],[11760,1],[11764,2],[11772,1],[11776,2],[11780,1],[11784,2],[11788,1],[11792,2],[11796,1],[11800,2],[11803,1],[11807,2],[11811,1],[11815,2],[11819,1],[11823,2],[11827,1],[11831,2],[11847,1],[11851,2],[11859,1],[11878,0],[11886,2],[11906,1],[11910,2],[11914,1],[11918,2],[11922,1],[11925,3],[11926,2],[11930,1],[11937,3],[11938,2],[11945,1],[11949,2],[11957,1],[11969,0],[11977,2],[12154,1],[12158,2],[12162,1],[12166,2],[12170,1],[12174,2],[12178,1],[12190,2],[12193,0],[12194,1],[12201,3],[12202,2],[12213,1],[12221,2],[12229,1],[12233,2],[12237,1],[12241,2],[12245,1],[12249,2],[12253,1],[12257,2],[12260,1],[12268,2],[12280,0],[12288,2],[12308,1],[12312,2],[12316,1],[12320,2],[12324,1],[12327,3],[12328,2],[12331,1],[12339,3],[12340,2],[12347,1],[12359,2],[12367,1],[12371,0],[12379,2],[12556,1],[12560,2],[12564,1],[12568,2],[12572,1],[12576,2],[12580,1],[12591,3],[12592,2],[12595,0],[12596,1],[12603,2],[12615,1],[12623,2],[12631,1],[12635,2],[12639,1],[12643,2],[12647,1],[12651,2],[12655,1],[12659,2],[12662,1],[12670,2],[12682,0],[12690,2],[12710,1],[12714,2],[12718,1],[12722,2],[12725,0],[12726,1],[12729,2],[12733,1],[12741,3],[12742,2],[12749,1],[12761,2],[12769,1],[12773,0],[12781,2],[12958,1],[12962,2],[12966,1],[12970,2],[12974,1],[12978,2],[12982,1],[12993,3],[12994,2],[12997,0],[12998,1],[13005,3],[13006,2],[13017,1],[13025,2],[13033,1],[13037,2],[13041,1],[13045,2],[13049,1],[13053,2],[13056,0],[13057,1],[13061,2],[13065,1],[13072,2],[13084,0],[13092,2],[13112,1],[13116,2],[13120,1],[13124,2],[13128,1],[13132,2],[13135,0],[13136,1],[13151,2],[13159,1],[13163,2],[13171,1],[13175,2],[13183,1],[13187,2],[13194,0],[13195,1],[13198,2],[13202,1],[13210,2],[13214,1],[13218,2],[13222,1],[13226,2],[13230,1],[13234,2],[13238,1],[13242,2],[13246,1],[13250,2],[13254,1],[13257,3],[13258,2],[13262,1],[13265,3],[13266,2],[13269,0],[13270,1],[13277,2],[13281,1],[13285,2],[13289,1],[13293,2],[13297,1],[13301,2],[13305,1],[13309,2],[13313,1],[13317,2],[13321,1],[13325,2],[13329,1],[13332,3],[13333,2],[13336,1],[13341,2],[13344,1],[13348,2],[13352,1],[13356,2],[13360,1],[13364,2],[13368,1],[13372,2],[13376,1],[13380,2],[13384,1],[13388,2],[13392,1],[13395,3],[13396,2],[13400,1],[13403,2],[13411,1],[13415,2],[13419,1],[13423,2],[13439,1],[13447,2],[13455,1],[13470,3],[13471,2],[13474,0],[13475,1],[13490,0],[13498,2],[13518,1],[13522,2],[13526,1],[13529,3],[13530,2],[13533,0],[13534,1],[13537,2],[13541,1],[13549,2],[13557,1],[13561,2],[13569,1],[13581,0],[13589,2],[13766,1],[13770,2],[13774,1],[13778,2],[13782,1],[13786,2],[13789,0],[13790,1],[13802,2],[13805,0],[13806,1],[13813,2],[13825,1],[13833,2],[13841,1],[13845,2],[13849,1],[13853,2],[13857,1],[13861,2],[13865,1],[13868,2],[13872,1],[13880,2],[13892,0],[13900,2],[13920,1],[13924,2],[13928,1],[13931,3],[13932,2],[13935,1],[13939,2],[13943,1],[13959,2],[13963,1],[13967,2],[13971,1],[13991,2],[13994,1],[13998,2],[14002,0],[14003,1],[14006,2],[14014,1],[14018,2],[14026,1],[14030,2],[14034,1],[14038,2],[14042,1],[14046,2],[14050,1],[14054,2],[14058,1],[14062,2],[14066,1],[14073,3],[14074,2],[14089,1],[14097,2],[14105,1],[14109,2],[14113,1],[14117,2],[14121,1],[14125,2],[14129,1],[14132,3],[14133,2],[14136,1],[14144,2],[14148,1],[14152,2],[14156,1],[14160,2],[14164,1],[14168,2],[14176,1],[14180,2],[14184,1],[14188,2],[14192,1],[14195,3],[14196,2],[14199,0],[14200,1],[14204,2],[14211,0],[14212,1],[14215,2],[14219,1],[14223,2],[14227,1],[14231,2],[14235,1],[14239,2],[14243,1],[14255,2],[14259,1],[14262,2],[14267,1],[14270,3],[14271,2],[14286,1],[14298,0],[14306,2],[14326,1],[14329,3],[14330,2],[14333,1],[14337,2],[14341,0],[14342,1],[14345,2],[14349,1],[14357,2],[14365,1],[14369,2],[14377,1],[14389,0],[14397,2],[14574,1],[14578,2],[14582,1],[14586,2],[14590,1],[14594,2],[14598,1],[14609,2],[14613,1],[14621,2],[14633,1],[14641,2],[14649,1],[14653,2],[14657,1],[14660,3],[14661,2],[14665,1],[14668,3],[14669,2],[14672,0],[14673,1],[14676,2],[14680,1],[14688,2],[14700,0],[14708,2],[14727,0],[14728,1],[14731,3],[14732,2],[14735,1],[14739,3],[14740,2],[14743,1],[14747,2],[14751,1],[14767,2],[14771,1],[14775,2],[14779,1],[14799,2],[14803,1],[14806,2],[14810,1],[14814,2],[14822,1],[14826,2],[14834,1],[14838,2],[14842,1],[14846,2],[14850,1],[14854,2],[14858,1],[14861,3],[14862,2],[14865,1],[14869,2],[14873,1],[14881,2],[14897,1],[14905,2],[14913,1],[14917,2],[14921,1],[14925,2],[14929,1],[14932,3],[14933,2],[14936,0],[14937,1],[14940,3],[14941,2],[14944,1],[14952,2],[14956,1],[14960,2],[14964,1],[14968,2],[14972,1],[14976,2],[14984,1],[14988,2],[14992,1],[14996,2],[15000,1],[15004,2],[15007,0],[15008,1],[15011,2],[15019,1],[15023,2],[15027,1],[15031,2],[15035,1],[15039,2],[15043,1],[15047,2],[15051,1],[15063,2],[15067,1],[15071,2],[15074,1],[15078,2],[15094,1],[15106,0],[15114,2],[15133,1],[15137,2],[15141,0],[15142,1],[15145,2],[15149,1],[15153,2],[15157,1],[15165,2],[15173,1],[15177,2],[15185,1],[15197,0],[15205,2],[15382,1],[15386,2],[15390,1],[15393,3],[15394,2],[15397,0],[15398,1],[15401,2],[15405,1],[15417,2],[15421,1],[15429,2],[15441,1],[15449,2],[15457,1],[15460,3],[15461,2],[15464,0],[15465,1],[15468,2],[15472,1],[15476,2],[15480,1],[15484,2],[15488,1],[15496,2],[15508,0],[15516,2],[15535,1],[15539,3],[15540,2],[15543,1],[15547,2],[15551,1],[15555,2],[15559,1],[15575,2],[15583,1],[15587,2],[15594,0],[15595,1],[15606,2],[15610,1],[15614,2],[15618,1],[15622,2],[15626,1],[15634,2],[15638,1],[15642,2],[15646,1],[15650,2],[15654,1],[15658,2],[15685,1],[15689,2],[15693,1],[15721,2],[15729,1],[15733,0],[15740,2],[15760,1],[15764,2],[15768,1],[15772,2],[15776,1],[15780,2],[15784,1],[15792,2],[15800,1],[15803,2],[15811,1],[15823,0],[15831,2],[16008,0],[16009,1],[16012,2],[16016,1],[16020,2],[16024,1],[16028,2],[16032,1],[16044,2],[16048,1],[16052,2],[16056,1],[16075,3],[16076,2],[16083,1],[16087,2],[16091,1],[16095,2],[16099,1],[16103,2],[16107,1],[16111,2],[16115,1],[16123,2],[16134,0],[16142,2],[16162,1],[16166,2],[16170,1],[16174,2],[16178,1],[16182,2],[16186,1],[16201,3],[16202,2],[16209,0],[16210,1],[16213,2],[16221,1],[16225,2],[16229,1],[16233,2],[16237,1],[16241,2],[16245,1],[16249,2],[16253,1],[16256,3],[16257,2],[16260,0],[16261,1],[16264,3],[16265,2],[16268,1],[16272,2],[16276,1],[16280,2],[16284,1],[16288,0],[16296,2],[16316,1],[16320,2],[16323,0],[16324,1],[16328,2],[16332,1],[16335,3],[16336,2],[16339,1],[16347,2],[16355,1],[16359,2],[16367,1],[16379,0],[16387,2],[16564,1],[16568,2],[16572,1],[16576,2],[16580,1],[16584,2],[16588,1],[16600,2],[16611,1],[16619,2],[16623,1],[16631,2],[16639,1],[16643,2],[16647,1],[16651,2],[16655,1],[16659,2],[16663,1],[16667,2],[16671,1],[16678,2],[16690,0],[16698,2],[16718,1],[16722,2],[16726,1],[16730,2],[16733,1],[16737,3],[16738,2],[16741,1],[16757,2],[16761,1],[16765,2],[16769,1],[16781,2],[16785,1],[16789,2],[16793,1],[16797,2],[16800,1],[16804,2],[16812,1],[16824,2],[16828,1],[16832,2],[16836,1],[16840,2],[16844,1],[16848,2],[16852,1],[16856,2],[16860,1],[16863,3],[16864,2],[16868,1],[16871,2],[16875,1],[16883,2],[16887,1],[16891,2],[16895,1],[16899,2],[16903,1],[16907,2],[16911,1],[16915,2],[16919,1],[16923,2],[16927,1],[16931,2],[16934,0],[16935,1],[16938,3],[16939,2],[16942,1],[16946,2],[16950,1],[16954,2],[16958,1],[16962,2],[16966,1],[16974,2],[16978,1],[16986,2],[16990,1],[16994,2],[16997,0],[16998,1],[17001,3],[17002,2],[17006,1],[17009,2],[17013,1],[17017,2],[17021,1],[17025,2],[17029,1],[17033,2],[17049,1],[17057,2],[17065,1],[17068,3],[17069,2],[17076,0],[17077,1],[17080,2],[17084,1],[17088,2],[17092,1],[17096,0],[17104,2],[17124,1],[17128,2],[17131,0],[17132,1],[17135,3],[17136,2],[17139,1],[17143,2],[17147,1],[17155,2],[17163,1],[17167,2],[17175,1],[17187,0],[17195,2],[17372,1],[17376,2],[17380,1],[17384,2],[17388,1],[17392,2],[17396,1],[17407,2],[17411,1],[17419,2],[17431,1],[17439,2],[17447,1],[17451,2],[17454,0],[17455,1],[17459,2],[17463,1],[17466,2],[17470,1],[17474,2],[17478,1],[17486,2],[17498,0],[17506,2],[17525,0],[17526,1],[17530,2],[17533,0],[17534,1],[17537,2],[17541,1],[17545,2],[17549,1],[17557,2],[17565,1],[17577,2],[17585,1],[17589,0],[17597,2],[17774,1],[17778,2],[17782,1],[17786,2],[17790,1],[17793,3],[17794,2],[17798,1],[17809,2],[17813,1],[17821,2],[17833,1],[17841,2],[17849,1],[17853,2],[17857,1],[17861,2],[17865,1],[17869,2],[17872,0],[17873,1],[17876,2],[17880,1],[17888,2],[17900,0],[17908,2],[17928,1],[17931,3],[17932,2],[17935,0],[17936,1],[17939,2],[17943,1],[17947,2],[17951,1],[17959,2],[17967,1],[17979,2],[17987,1],[17991,0],[17999,2],[18176,1],[18180,2],[18184,1],[18188,2],[18192,1],[18196,2],[18200,1],[18211,2],[18215,1],[18223,2],[18235,1],[18243,2],[18251,1],[18255,2],[18259,1],[18263,2],[18266,1],[18271,2],[18274,1],[18278,2],[18282,1],[18290,2],[18302,0],[18310,2],[18329,0],[18330,1],[18333,2],[18337,0],[18338,1],[18341,2],[18345,1],[18349,2],[18353,1],[18369,2],[18377,1],[18381,2],[18389,1],[18397,2],[18400,1],[18408,2],[18412,0],[18413,1],[18416,2],[18420,1],[18424,2],[18432,1],[18436,2],[18440,1],[18444,2],[18448,1],[18452,2],[18456,1],[18464,2],[18467,0],[18468,1],[18471,2],[18479,1],[18483,2],[18487,1],[18491,2],[18495,1],[18499,2],[18503,1],[18507,2],[18511,1],[18515,2],[18523,1],[18526,3],[18527,2],[18531,1],[18535,2],[18539,1],[18542,2],[18546,1],[18554,2],[18558,1],[18562,2],[18566,1],[18570,2],[18574,1],[18578,2],[18582,1],[18586,2],[18589,0],[18590,1],[18593,2],[18597,1],[18601,3],[18602,2],[18605,0],[18606,1],[18609,3],[18610,2],[18613,1],[18617,2],[18621,1],[18625,2],[18629,1],[18633,2],[18637,1],[18653,2],[18660,0],[18661,1],[18665,2],[18668,0],[18669,1],[18673,2],[18676,1],[18680,2],[18684,1],[18688,2],[18692,1],[18696,2],[18704,1],[18708,0],[18716,2],[18735,1],[18739,3],[18740,2],[18743,1],[18747,2],[18751,1],[18755,2],[18759,1],[18767,2],[18775,1],[18779,2],[18787,1],[18799,0],[18806,2],[18984,1],[18988,2],[18992,1],[18996,2],[18999,0],[19000,1],[19004,2],[19007,0],[19008,1],[19019,2],[19023,1],[19031,2],[19043,1],[19051,2],[19059,1],[19063,2],[19066,1],[19070,2],[19074,1],[19078,2],[19082,1],[19086,2],[19090,1],[19098,2],[19110,0],[19118,2],[19137,1],[19141,2],[19145,0],[19146,1],[19149,2],[19153,1],[19157,2],[19161,1],[19177,2],[19181,1],[19185,2],[19189,1],[19200,2],[19208,1],[19212,2],[19224,1],[19228,2],[19236,1],[19240,2],[19244,1],[19248,2],[19252,1],[19263,2],[19271,1],[19279,2],[19291,1],[19295,0],[19303,2],[19323,1],[19327,2],[19331,1],[19334,3],[19335,2],[19338,0],[19339,1],[19342,2],[19346,1],[19354,2],[19362,1],[19366,2],[19374,1],[19386,0],[19394,2],[19571,1],[19575,2],[19579,1],[19583,2],[19587,1],[19591,2],[19595,1],[19606,2],[19610,1],[19614,2],[19618,1],[19638,2],[19646,1],[19650,2],[19654,1],[19658,2],[19661,0],[19662,1],[19666,2],[19669,0],[19670,1],[19673,3],[19674,2],[19677,1],[19685,2],[19697,0],[19705,2],[19724,0],[19725,1],[19729,2],[19732,1],[19736,3],[19737,2],[19740,1],[19744,3],[19745,2],[19748,1],[19764,2],[19772,1],[19776,2],[19784,1],[19788,2],[19791,0],[19792,1],[19796,2],[19800,1],[19803,2],[19807,1],[19811,2],[19815,1],[19819,2],[19823,1],[19827,2],[19831,1],[19835,2],[19839,1],[19843,2],[19847,1],[19851,0],[19859,2],[19878,1],[19882,2],[19886,1],[19890,2],[19894,1],[19898,2],[19902,1],[19910,2],[19918,1],[19922,2],[19930,1],[19941,0],[19949,2],[20126,0],[20127,1],[20131,2],[20134,0],[20135,1],[20138,2],[20142,1],[20146,2],[20150,1],[20162,2],[20174,1],[20182,2],[20186,1],[20193,3],[20194,2],[20202,1],[20206,2],[20209,1],[20213,2],[20217,1],[20221,2],[20225,1],[20229,2],[20233,1],[20241,2],[20253,0],[20261,2],[20280,1],[20284,2],[20288,1],[20292,2],[20296,1],[20300,2],[20304,1],[20320,2],[20324,1],[20327,3],[20328,2],[20332,1],[20343,3],[20344,2],[20347,1],[20351,2],[20355,1],[20359,2],[20363,1],[20367,2],[20375,1],[20387,2],[20391,1],[20395,2],[20399,1],[20402,2],[20406,0],[20407,1],[20410,2],[20414,1],[20418,2],[20422,1],[20426,2],[20430,1],[20434,2],[20438,1],[20446,2],[20450,1],[20454,2],[20458,1],[20462,2],[20465,0],[20466,1],[20469,2],[20473,1],[20477,2],[20481,1],[20485,2],[20489,1],[20493,2],[20497,1],[20501,2],[20505,1],[20509,2],[20513,1],[20517,2],[20521,1],[20524,3],[20525,2],[20529,1],[20533,2],[20541,1],[20544,2],[20548,1],[20556,2],[20560,1],[20564,2],[20568,1],[20572,2],[20576,1],[20580,2],[20584,1],[20588,2],[20592,1],[20596,2],[20599,1],[20604,2],[20607,1],[20619,2],[20627,1],[20631,2],[20639,1],[20659,0],[20666,2],[20686,1],[20690,2],[20694,1],[20698,2],[20702,1],[20706,2],[20710,1],[20718,2],[20726,1],[20730,2],[20737,1],[20749,0],[20757,2],[20935,1],[20938,3],[20939,2],[20942,1],[20946,2],[20950,1],[20954,2],[20958,1],[20970,2],[20974,1],[20982,2],[20994,1],[21002,2],[21009,1],[21013,2],[21017,1],[21021,2],[21025,1],[21029,2],[21033,1],[21037,2],[21041,1],[21049,2],[21060,0],[21068,2],[21088,1],[21092,2],[21096,1],[21100,2],[21104,1],[21108,2],[21112,1],[21120,2],[21127,0],[21128,1],[21139,2],[21147,1],[21151,0],[21159,2],[21336,0],[21337,1],[21340,3],[21341,2],[21344,1],[21348,2],[21352,1],[21356,2],[21360,1],[21372,2],[21376,1],[21384,2],[21395,0],[21396,1],[21403,2],[21411,1],[21415,2],[21419,1],[21423,2],[21427,1],[21431,2],[21435,1],[21439,2],[21443,1],[21451,2],[21463,0],[21470,2],[21490,1],[21494,2],[21498,1],[21502,2],[21506,1],[21510,2],[21514,1],[21522,2],[21529,0],[21530,1],[21541,2],[21549,1],[21553,0],[21561,2],[21738,1],[21742,2],[21746,1],[21750,2],[21754,1],[21758,2],[21762,1],[21774,2],[21778,1],[21786,2],[21798,1],[21805,2],[21813,1],[21817,2],[21821,1],[21825,2],[21829,1],[21833,2],[21837,1],[21841,2],[21845,1],[21853,2],[21865,0],[21873,2],[21892,1],[21896,2],[21900,1],[21904,2],[21908,1],[21912,2],[21916,1],[21932,2],[21939,1],[21943,2],[21951,1],[21959,2],[21963,1],[21971,2],[21975,1],[21979,2],[21983,1],[21987,2],[21995,1],[21998,3],[21999,2],[22003,1],[22006,2],[22010,1],[22014,2],[22018,1],[22026,2],[22030,1],[22034,2],[22042,1],[22046,2],[22050,1],[22054,2],[22058,1],[22062,2],[22065,0],[22066,1],[22069,2],[22073,1],[22077,2],[22085,1],[22089,2],[22093,1],[22097,2],[22101,1],[22105,2],[22109,1],[22117,2],[22121,1],[22125,2],[22128,0],[22129,1],[22132,2],[22136,1],[22140,3],[22141,2],[22144,1],[22148,2],[22152,1],[22156,2],[22160,1],[22164,2],[22168,1],[22172,2],[22176,1],[22180,2],[22184,1],[22188,2],[22192,1],[22196,2],[22199,1],[22215,2],[22223,1],[22227,2],[22231,1],[22235,2],[22239,1],[22243,2],[22247,1],[22251,2],[22255,1],[22259,2],[22266,1],[22270,0],[22278,2],[22298,1],[22302,2],[22306,1],[22310,2],[22314,1],[22318,2],[22322,1],[22329,2],[22337,1],[22341,3],[22342,2],[22349,1],[22361,0],[22369,2],[22546,1],[22550,2],[22554,1],[22558,2],[22562,1],[22566,2],[22570,1],[22582,2],[22586,1],[22594,2],[22605,1],[22613,2],[22621,1],[22625,2],[22629,1],[22633,2],[22637,1],[22641,2],[22645,1],[22649,2],[22653,1],[22661,2],[22672,0],[22680,2],[22700,1],[22704,2],[22708,1],[22712,2],[22716,1],[22720,2],[22724,1],[22739,2],[22743,0],[22744,1],[22747,2],[22751,1],[22763,2],[22771,1],[22775,2],[22787,1],[22791,2],[22798,1],[22802,2],[22810,1],[22814,2],[22818,1],[22822,2],[22826,1],[22830,2],[22838,1],[22842,2],[22846,1],[22850,2],[22854,1],[22858,2],[22862,1],[22865,2],[22869,0],[22870,1],[22873,2],[22877,1],[22881,2],[22885,1],[22889,2],[22893,1],[22897,2],[22901,1],[22905,2],[22909,1],[22913,2],[22917,1],[22925,2],[22928,0],[22929,1],[22932,2],[22936,0],[22937,1],[22940,2],[22944,1],[22948,2],[22960,1],[22964,2],[22968,1],[22972,2],[22976,1],[22980,2],[22984,1],[22988,2],[22992,1],[22996,2],[22999,1],[23003,2],[23007,0],[23008,1],[23011,2],[23015,1],[23019,2],[23027,1],[23051,2],[23062,1],[23066,2],[23070,1],[23078,0],[23086,2],[23106,1],[23110,2],[23114,1],[23118,2],[23122,1],[23126,2],[23130,1],[23137,3],[23138,2],[23145,1],[23149,2],[23157,1],[23169,0],[23177,2],[23354,1],[23358,2],[23362,1],[23366,2],[23370,1],[23374,2],[23378,1],[23390,2],[23394,1],[23401,3],[23402,2],[23413,1],[23421,2],[23429,1],[23433,2],[23437,1],[23441,2],[23445,1],[23449,2],[23453,1],[23457,2],[23461,1],[23468,3],[23469,2],[23480,0],[23488,2],[23508,1],[23512,2],[23516,1],[23520,2],[23524,1],[23527,3],[23528,2],[23531,0],[23532,1],[23547,2],[23555,1],[23559,2],[23567,1],[23571,2],[23575,1],[23579,2],[23583,1],[23587,2],[23591,1],[23594,3],[23595,2],[23598,1],[23602,3],[23603,2],[23606,1],[23610,2],[23614,1],[23618,2],[23622,1],[23626,2],[23630,1],[23638,2],[23642,1],[23650,2],[23654,1],[23658,2],[23661,0],[23662,1],[23669,2],[23673,1],[23677,2],[23681,1],[23689,2],[23693,1],[23701,2],[23705,1],[23709,2],[23717,1],[23721,2],[23725,1],[23732,2],[23736,0],[23737,1],[23740,2],[23744,1],[23748,2],[23752,1],[23756,2],[23760,1],[23764,2],[23768,1],[23772,2],[23776,1],[23780,2],[23784,1],[23788,2],[23795,0],[23796,1],[23800,2],[23803,1],[23807,3],[23808,2],[23811,1],[23815,2],[23819,1],[23823,2],[23835,1],[23843,2],[23847,1],[23855,2],[23866,1],[23874,3],[23875,2],[23882,1],[23886,0],[23894,2],[23914,1],[23918,2],[23922,1],[23926,2],[23929,0],[23930,1],[23933,3],[23934,2],[23937,1],[23945,2],[23953,1],[23957,2],[23965,1],[23977,0],[23985,2],[24162,1],[24166,2],[24170,1],[24174,2],[24178,1],[24182,2],[24186,1],[24197,2],[24201,1],[24209,2],[24221,1],[24229,2],[24237,1],[24241,2],[24245,1],[24249,2],[24253,1],[24257,2],[24261,1],[24264,2],[24268,0],[24269,1],[24276,3],[24277,2],[24288,0],[24296,2],[24316,1],[24320,2],[24324,1],[24328,2],[24331,1],[24335,3],[24336,2],[24339,0],[24340,1],[24355,2],[24359,1],[24363,2],[24367,1],[24379,2],[24387,1],[24391,2],[24395,1],[24403,2],[24406,1],[24434,2],[24438,1],[24442,2],[24446,1],[24450,2],[24454,1],[24458,2],[24461,0],[24462,1],[24465,3],[24466,2],[24469,0],[24470,1],[24473,2],[24489,1],[24493,2],[24497,1],[24501,2],[24505,1],[24513,2],[24521,1],[24524,3],[24525,2],[24529,1],[24533,2],[24536,1],[24544,2],[24548,1],[24552,2],[24556,1],[24560,2],[24564,1],[24580,2],[24584,1],[24588,2],[24591,0],[24592,1],[24596,2],[24599,0],[24600,1],[24603,3],[24604,2],[24607,1],[24611,2],[24619,1],[24623,2],[24627,1],[24631,2],[24647,1],[24655,2],[24658,0],[24659,1],[24662,3],[24663,2],[24666,0],[24667,1],[24670,3],[24671,2],[24678,1],[24682,2],[24690,1],[24694,2],[24698,0],[24706,2],[24726,1],[24729,3],[24730,2],[24734,1],[24737,2],[24741,1],[24745,2],[24749,1],[24757,2],[24765,1],[24769,2],[24777,1],[24789,0],[24796,2],[24974,1],[24978,2],[24982,1],[24986,2],[24990,1],[24994,2],[24998,1],[25009,3],[25010,2],[25013,1],[25021,2],[25033,1],[25041,2],[25049,1],[25053,2],[25057,1],[25061,2],[25064,0],[25065,1],[25068,2],[25073,1],[25076,3],[25077,2],[25080,1],[25088,2],[25100,0],[25108,2],[25127,1],[25132,2],[25135,0],[25136,1],[25139,3],[25140,2],[25143,1],[25147,2],[25151,1],[25167,2],[25175,1],[25179,2],[25187,1],[25190,3],[25191,2],[25195,1],[25199,2],[25202,1],[25206,2],[25210,1],[25214,2],[25218,1],[25222,2],[25230,1],[25238,2],[25242,1],[25246,2],[25250,1],[25254,2],[25281,1],[25285,2],[25289,1],[25293,2],[25297,1],[25305,2],[25309,1],[25317,2],[25321,0],[25329,2],[25348,1],[25352,2],[25356,1],[25360,2],[25364,1],[25368,2],[25372,1],[25380,2],[25388,1],[25392,2],[25400,1],[25411,0],[25419,2],[25596,0],[25597,1],[25601,2],[25604,0],[25605,1],[25608,3],[25609,2],[25612,1],[25616,2],[25620,1],[25632,2],[25636,1],[25640,2],[25644,1],[25664,2],[25671,1],[25675,2],[25679,1],[25683,2],[25687,1],[25691,2],[25695,1],[25699,2],[25703,1],[25711,2],[25722,0],[25730,2],[25750,1],[25754,2],[25758,1],[25762,2],[25766,1],[25770,2],[25774,1],[25790,2],[25797,0],[25798,1],[25802,2],[25809,0],[25810,1],[25813,2],[25817,1],[25821,2],[25825,1],[25829,2],[25833,1],[25837,2],[25841,1],[25845,2],[25849,1],[25853,2],[25857,1],[25860,3],[25861,2],[25865,1],[25868,2],[25872,0],[25873,1],[25876,0],[25884,2],[25904,1],[25908,2],[25912,1],[25916,2],[25920,1],[25924,2],[25927,1],[25936,2],[25943,1],[25947,2],[25955,1],[25967,0],[25975,2],[26152,1],[26156,2],[26160,1],[26164,2],[26168,1],[26172,2],[26176,1],[26188,2],[26200,1],[26207,2],[26211,1],[26219,2],[26227,1],[26231,2],[26235,1],[26239,2],[26243,1],[26247,2],[26251,1],[26255,2],[26259,1],[26266,2],[26278,0],[26286,2],[26306,1],[26310,2],[26314,1],[26318,2],[26322,1],[26326,2],[26330,1],[26345,2],[26349,1],[26353,2],[26357,1],[26369,2],[26373,1],[26377,2],[26381,1],[26385,2],[26389,1],[26393,2],[26400,0],[26401,1],[26412,2],[26416,1],[26420,2],[26424,1],[26428,2],[26432,1],[26436,2],[26440,1],[26444,2],[26448,1],[26452,2],[26455,0],[26456,1],[26460,2],[26471,1],[26475,2],[26479,1],[26483,2],[26487,1],[26491,2],[26495,1],[26499,2],[26503,1],[26507,2],[26511,1],[26515,2],[26519,1],[26523,2],[26527,1],[26531,2],[26534,1],[26539,2],[26542,1],[26546,2],[26550,1],[26554,2],[26582,1],[26594,2],[26598,1],[26601,2],[26605,1],[26609,2],[26613,1],[26617,2],[26621,1],[26625,2],[26629,1],[26637,2],[26645,1],[26657,2],[26661,1],[26668,3],[26669,2],[26672,1],[26684,2],[26688,0],[26696,2],[26716,1],[26720,2],[26724,1],[26728,2],[26732,1],[26735,2],[26739,1],[26747,2],[26755,1],[26759,2],[26767,1],[26779,0],[26787,2],[26964,1],[26968,2],[26972,1],[26976,2],[26980,1],[26984,2],[26988,1],[26999,3],[27000,2],[27004,1],[27011,2],[27023,1],[27031,2],[27039,1],[27043,2],[27047,1],[27051,2],[27055,1],[27059,2],[27062,1],[27067,2],[27070,1],[27078,3],[27079,2],[27090,0],[27098,2],[27118,1],[27122,2],[27126,1],[27130,2],[27134,1],[27137,3],[27138,2],[27141,0],[27142,1],[27149,2],[27157,1],[27169,2],[27177,1],[27181,0],[27189,2],[27366,1],[27370,2],[27374,1],[27378,2],[27382,1],[27386,2],[27390,1],[27401,3],[27402,2],[27405,1],[27413,2],[27425,1],[27433,2],[27441,1],[27445,2],[27449,1],[27453,2],[27457,1],[27460,3],[27461,2],[27464,1],[27469,2],[27472,1],[27480,2],[27492,0],[27500,2],[27520,1],[27524,2],[27527,1],[27532,2],[27536,1],[27539,3],[27540,2],[27543,1],[27551,2],[27559,1],[27571,2],[27579,1],[27583,0],[27590,2],[27768,1],[27772,2],[27776,1],[27780,2],[27784,1],[27788,2],[27792,1],[27804,2],[27807,1],[27815,2],[27827,1],[27835,2],[27843,1],[27847,2],[27851,1],[27855,2],[27858,0],[27859,1],[27862,2],[27867,1],[27870,3],[27871,2],[27874,1],[27882,2],[27894,0],[27902,2],[27922,1],[27926,2],[27930,1],[27933,3],[27934,2],[27937,1],[27941,2],[27945,1],[27961,2],[27969,1],[27973,2],[27981,1],[27985,2],[27989,1],[27996,3],[27997,2],[28000,1],[28004,2],[28008,1],[28012,2],[28024,1],[28028,2],[28032,1],[28036,2],[28040,1],[28044,2],[28052,1],[28056,2],[28064,1],[28068,2],[28071,1],[28075,2],[28079,1],[28083,2],[28091,1],[28095,2],[28099,1],[28103,2],[28107,1],[28115,2],[28119,1],[28127,2],[28131,1],[28134,3],[28135,2],[28138,1],[28142,2],[28146,1],[28150,2],[28170,1],[28174,0],[28182,2],[28201,1],[28205,2],[28209,1],[28213,2],[28217,1],[28221,2],[28225,1],[28233,2],[28241,1],[28245,2],[28253,1],[28265,0],[28272,2],[28450,1],[28454,2],[28458,1],[28462,2],[28466,1],[28469,2],[28473,1],[28485,2],[28489,1],[28493,2],[28497,1],[28517,2],[28524,0],[28525,1],[28529,2],[28533,1],[28536,2],[28540,1],[28544,2],[28548,1],[28552,2],[28556,1],[28564,2],[28576,0],[28584,2],[28604,1],[28607,2],[28611,1],[28615,2],[28619,1],[28623,2],[28627,1],[28643,2],[28651,1],[28655,2],[28663,1],[28667,2],[28670,0],[28671,1],[28674,2],[28678,1],[28682,2],[28686,1],[28690,2],[28694,1],[28698,2],[28702,1],[28706,2],[28710,1],[28714,2],[28718,1],[28722,2],[28725,0],[28726,1],[28730,0],[28737,2],[28757,1],[28761,2],[28765,1],[28769,2],[28773,1],[28777,2],[28781,1],[28789,2],[28797,1],[28800,2],[28808,1],[28820,0],[28828,2],[29005,0],[29006,1],[29009,2],[29013,1],[29017,2],[29021,1],[29025,2],[29029,1],[29041,2],[29053,1],[29061,2],[29064,0],[29065,1],[29072,3],[29073,2],[29080,1],[29084,2],[29088,1],[29092,2],[29096,1],[29100,2],[29104,1],[29108,2],[29112,1],[29120,2],[29131,0],[29139,2],[29159,1],[29163,2],[29167,1],[29171,2],[29175,1],[29179,2],[29183,1],[29199,2],[29202,1],[29206,3],[29207,2],[29210,1],[29222,2],[29226,1],[29230,2],[29234,1],[29238,2],[29242,1],[29246,2],[29254,1],[29266,2],[29269,1],[29273,2],[29277,1],[29281,2],[29285,1],[29293,2],[29297,1],[29301,2],[29305,1],[29309,2],[29313,1],[29325,2],[29328,1],[29332,3],[29333,2],[29336,1],[29340,2],[29344,1],[29352,2],[29356,1],[29364,2],[29368,1],[29372,2],[29376,1],[29380,2],[29384,1],[29391,3],[29392,2],[29396,1],[29400,2],[29404,1],[29407,2],[29435,1],[29447,2],[29451,1],[29455,2],[29459,1],[29462,2],[29466,0],[29467,1],[29470,2],[29474,1],[29490,2],[29498,1],[29502,2],[29518,1],[29529,3],[29530,2],[29541,0],[29549,2],[29569,1],[29573,2],[29577,1],[29581,2],[29585,1],[29589,2],[29593,1],[29600,2],[29608,1],[29612,2],[29620,1],[29632,0],[29640,2],[29817,1],[29821,2],[29825,1],[29829,2],[29833,1],[29837,2],[29841,1],[29853,2],[29857,1],[29864,2],[29876,1],[29884,2],[29892,1],[29896,2],[29900,1],[29904,2],[29908,1],[29912,2],[29916,1],[29920,2],[29924,1],[29931,2],[29943,0],[29951,2],[29971,1],[29975,2],[29979,1],[29983,2],[29987,1],[29990,3],[29991,2],[29995,1],[30003,2],[30010,0],[30011,1],[30022,2],[30030,1],[30034,0],[30042,2],[30219,1],[30223,2],[30227,1],[30231,2],[30235,1],[30239,2],[30243,1],[30255,2],[30259,1],[30266,2],[30278,0],[30279,1],[30286,2],[30294,1],[30298,2],[30302,1],[30306,2],[30310,1],[30314,2],[30318,1],[30322,2],[30325,0],[30326,1],[30333,2],[30345,0],[30353,2],[30373,1],[30377,2],[30381,1],[30385,2],[30389,1],[30392,3],[30393,2],[30396,1],[30404,2],[30412,1],[30424,2],[30432,1],[30436,0],[30444,2],[30621,1],[30625,2],[30629,1],[30633,2],[30637,1],[30641,2],[30645,1],[30656,3],[30657,2],[30661,1],[30668,3],[30669,2],[30680,1],[30688,2],[30696,1],[30700,2],[30704,1],[30708,2],[30712,1],[30716,2],[30720,1],[30724,2],[30727,0],[30728,1],[30735,2],[30747,0],[30755,2],[30775,1],[30779,2],[30783,1],[30787,2],[30791,1],[30795,2],[30798,0],[30799,1],[30814,2],[30822,1],[30826,2],[30834,1],[30838,2],[30846,1],[30850,2],[30858,1],[30862,2],[30866,1],[30877,2],[30881,1],[30885,2],[30889,1],[30893,2],[30897,1],[30901,2],[30909,1],[30913,2],[30917,1],[30921,2],[30929,1],[30933,2],[30936,0],[30937,1],[30940,2],[30944,1],[30948,2],[30952,1],[30956,2],[30960,1],[30968,2],[30976,1],[30980,2],[30992,1],[30995,3],[30996,2],[31000,1],[31003,3],[31004,2],[31007,0],[31008,1],[31011,2],[31015,1],[31019,2],[31023,1],[31027,2],[31043,1],[31055,2],[31059,1],[31062,3],[31063,2],[31066,1],[31070,3],[31071,2],[31074,1],[31078,2],[31082,1],[31086,2],[31094,1],[31098,2],[31102,1],[31114,2],[31118,1],[31137,3],[31138,2],[31145,1],[31153,0],[31161,2],[31181,1],[31185,2],[31189,1],[31193,2],[31197,1],[31200,2],[31204,1],[31212,2],[31220,1],[31224,2],[31232,1],[31244,0],[31252,2],[31429,1],[31433,2],[31437,1],[31441,2],[31445,1],[31449,2],[31453,1],[31465,2],[31468,1],[31476,3],[31477,2],[31488,1],[31496,2],[31504,1],[31508,2],[31512,1],[31516,2],[31520,1],[31524,2],[31528,1],[31531,3],[31532,2],[31535,0],[31536,1],[31543,2],[31555,0],[31563,2],[31583,1],[31587,2],[31591,1],[31595,2],[31599,1],[31602,2],[31606,1],[31622,2],[31626,1],[31630,2],[31634,1],[31654,2],[31657,0],[31658,1],[31662,2],[31673,0],[31674,1],[31677,3],[31678,2],[31681,1],[31685,2],[31689,1],[31693,2],[31697,1],[31701,2],[31705,1],[31709,2],[31713,1],[31717,2],[31725,1],[31736,2],[31740,1],[31744,2],[31748,1],[31752,2],[31756,1],[31760,2],[31764,1],[31768,2],[31772,1],[31776,2],[31780,1],[31784,2],[31792,1],[31800,2],[31804,1],[31807,3],[31808,2],[31811,1],[31815,2],[31819,1],[31823,2],[31827,1],[31831,2],[31851,1],[31862,3],[31863,2],[31866,1],[31870,2],[31874,1],[31878,2],[31882,1],[31886,2],[31890,1],[31894,2],[31902,1],[31914,2],[31918,1],[31934,2],[31937,1],[31941,3],[31942,2],[31949,1],[31961,0],[31969,2],[31989,1],[31993,2],[31996,1],[32001,2],[32004,0],[32005,1],[32008,2],[32012,1],[32020,2],[32028,1],[32032,2],[32040,1],[32052,0],[32060,2],[32237,1],[32241,2],[32245,1],[32249,2],[32253,1],[32257,2],[32260,0],[32261,1],[32272,3],[32273,2],[32276,1],[32284,2],[32296,1],[32304,2],[32312,1],[32316,2],[32320,1],[32324,2],[32327,1],[32331,2],[32336,1],[32340,2],[32343,0],[32344,1],[32351,2],[32363,0],[32371,2],[32391,1],[32395,2],[32398,1],[32402,3],[32403,2],[32407,1],[32410,2],[32414,1],[32430,2],[32438,1],[32442,2],[32450,1],[32454,2],[32458,1],[32465,2],[32469,1],[32481,2],[32485,1],[32489,2],[32493,1],[32497,2],[32501,1],[32505,2],[32509,1],[32513,2],[32517,1],[32521,2],[32528,0],[32529,1],[32536,3],[32537,2],[32564,1],[32568,2],[32572,1],[32576,2],[32584,0],[32592,2],[32611,0],[32612,1],[32615,2],[32619,1],[32623,2],[32627,1],[32631,2],[32635,1],[32643,2],[32651,1],[32655,2],[32663,1],[32674,0],[32682,2],[32859,0],[32860,1],[32863,2],[32867,1],[32871,2],[32875,1],[32879,2],[32883,1],[32895,2],[32899,1],[32903,2],[32907,1],[32927,2],[32935,1],[32938,2],[32942,1],[32946,2],[32950,1],[32954,2],[32958,1],[32962,2],[32966,1],[32974,2],[32986,0],[32994,2],[33013,1],[33017,2],[33021,1],[33025,2],[33029,1],[33033,2],[33037,1],[33053,2],[33061,1],[33065,2],[33073,1],[33076,2],[33080,1],[33084,2],[33088,1],[33092,2],[33096,1],[33100,2],[33104,1],[33108,2],[33112,1],[33116,2],[33120,1],[33124,2],[33127,0],[33128,1],[33131,3],[33132,2],[33136,1],[33140,0],[33147,2],[33167,1],[33171,2],[33175,1],[33179,2],[33183,1],[33187,2],[33191,1],[33199,2],[33206,0],[33207,1],[33210,2],[33218,1],[33230,0],[33238,2],[33415,1],[33419,2],[33423,1],[33427,2],[33431,1],[33435,2],[33439,1],[33451,2],[33463,1],[33470,3],[33471,2],[33474,1],[33482,2],[33490,1],[33494,2],[33498,1],[33502,2],[33506,1],[33510,2],[33514,1],[33518,2],[33522,1],[33530,2],[33541,0],[33549,2],[33569,1],[33573,2],[33577,1],[33581,2],[33585,1],[33588,3],[33589,2],[33593,1],[33608,2],[33612,1],[33616,2],[33620,1],[33632,2],[33636,1],[33640,2],[33644,1],[33648,2],[33652,1],[33656,2],[33659,0],[33660,1],[33668,2],[33671,1],[33679,2],[33683,1],[33687,2],[33691,1],[33699,2],[33703,1],[33707,2],[33711,1],[33715,2],[33719,1],[33723,2],[33727,1],[33731,2],[33734,1],[33738,2],[33742,1],[33746,2],[33750,1],[33754,2],[33758,1],[33762,2],[33766,1],[33770,2],[33774,1],[33778,2],[33782,1],[33786,2],[33790,1],[33794,2],[33798,1],[33801,2],[33805,0],[33806,1],[33809,2],[33813,1],[33817,2],[33821,1],[33825,2],[33829,1],[33833,2],[33837,1],[33841,2],[33845,1],[33849,2],[33853,1],[33857,2],[33861,1],[33865,2],[33868,1],[33872,2],[33876,1],[33880,2],[33896,1],[33900,2],[33908,1],[33912,2],[33920,1],[33928,2],[33932,1],[33939,3],[33940,2],[33943,1],[33947,0],[33955,2],[33975,1],[33979,2],[33983,1],[33987,2],[33990,0],[33991,1],[33995,2],[33999,1],[34006,3],[34007,2],[34014,1],[34018,2],[34026,1],[34038,0],[34046,2],[34223,1],[34227,2],[34231,1],[34235,2],[34239,1],[34243,2],[34247,1],[34259,2],[34262,0],[34263,1],[34271,2],[34282,1],[34290,2],[34298,1],[34302,2],[34306,1],[34310,2],[34314,1],[34318,2],[34322,1],[34325,3],[34326,2],[34330,1],[34338,2],[34349,0],[34357,2],[34377,1],[34381,2],[34385,1],[34389,2],[34392,0],[34393,1],[34396,2],[34400,1],[34416,2],[34424,1],[34428,2],[34436,1],[34440,2],[34444,1],[34448,2],[34452,1],[34456,2],[34460,1],[34464,2],[34467,1],[34472,2],[34475,1],[34479,2],[34483,1],[34487,2],[34491,1],[34495,2],[34499,1],[34503,0],[34511,2],[34531,1],[34535,2],[34538,0],[34539,1],[34542,2],[34546,1],[34550,2],[34554,1],[34562,2],[34570,1],[34574,2],[34582,1],[34594,0],[34602,2],[34779,1],[34783,2],[34787,1],[34791,2],[34795,1],[34799,2],[34802,1],[34814,2],[34826,1],[34834,2],[34838,1],[34846,2],[34854,1],[34857,3],[34858,2],[34862,1],[34866,2],[34870,1],[34873,3],[34874,2],[34877,1],[34881,2],[34885,1],[34893,2],[34905,0],[34913,2],[34932,1],[34936,3],[34937,2],[34940,0],[34941,1],[34944,2],[34948,1],[34952,2],[34956,1],[34972,2],[34976,1],[34980,2],[34984,1],[35000,2],[35003,1],[35007,2],[35011,1],[35019,2],[35023,1],[35027,2],[35035,1],[35043,2],[35047,1],[35051,2],[35055,1],[35058,3],[35059,2],[35062,0],[35063,1],[35066,2],[35071,1],[35074,2],[35078,1],[35082,2],[35086,1],[35090,2],[35094,1],[35098,2],[35102,1],[35106,2],[35110,1],[35114,2],[35118,1],[35122,2],[35125,0],[35126,1],[35129,3],[35130,2],[35133,0],[35134,1],[35137,2],[35141,1],[35145,2],[35149,1],[35153,2],[35157,1],[35161,2],[35165,1],[35169,2],[35173,1],[35177,2],[35181,1],[35185,2],[35189,1],[35193,2],[35197,1],[35201,2],[35204,0],[35205,1],[35208,2],[35212,1],[35216,2],[35220,1],[35224,2],[35228,1],[35232,2],[35236,1],[35240,2],[35244,1],[35248,2],[35259,0],[35260,1],[35268,2],[35279,0],[35280,1],[35283,2],[35287,1],[35291,2],[35295,1],[35303,2],[35307,1],[35311,0],[35319,2],[35339,1],[35342,2],[35346,1],[35350,2],[35354,1],[35358,2],[35362,1],[35370,2],[35378,1],[35382,2],[35390,1],[35402,0],[35409,2],[35587,1],[35590,3],[35591,2],[35595,1],[35599,2],[35602,1],[35606,2],[35610,1],[35622,2],[35626,1],[35634,2],[35646,1],[35654,2],[35662,1],[35665,3],[35666,2],[35670,1],[35673,2],[35677,1],[35681,2],[35685,1],[35689,2],[35693,1],[35701,2],[35713,0],[35721,2],[35740,1],[35744,2],[35748,1],[35752,2],[35756,1],[35760,2],[35764,1],[35772,2],[35792,1],[35795,3],[35796,2],[35799,1],[35803,0],[35811,2],[35989,1],[35993,2],[35997,1],[36000,2],[36004,1],[36008,2],[36012,1],[36024,2],[36028,1],[36036,2],[36048,1],[36055,3],[36056,2],[36063,1],[36067,3],[36068,2],[36071,1],[36075,2],[36083,1],[36087,2],[36091,1],[36095,2],[36099,1],[36111,2],[36115,0],[36123,2],[36142,1],[36146,2],[36150,1],[36154,2],[36158,1],[36162,2],[36166,1],[36174,2],[36182,1],[36194,2],[36201,1],[36205,0],[36213,2],[36391,1],[36395,2],[36398,1],[36402,2],[36406,0],[36407,1],[36410,3],[36411,2],[36414,1],[36426,2],[36430,1],[36438,2],[36450,1],[36458,2],[36466,1],[36469,2],[36473,1],[36477,2],[36485,1],[36489,2],[36493,1],[36497,2],[36501,1],[36513,2],[36517,0],[36525,2],[36544,1],[36548,2],[36552,1],[36556,2],[36560,1],[36564,2],[36568,1],[36576,2],[36584,1],[36596,2],[36603,0],[36604,1],[36608,0],[36615,2],[36793,1],[36797,2],[36801,1],[36804,2],[36808,1],[36812,2],[36816,1],[36828,2],[36832,1],[36840,2],[36852,1],[36859,3],[36860,2],[36868,1],[36871,2],[36875,0],[36876,1],[36879,2],[36887,1],[36891,2],[36895,1],[36899,2],[36903,1],[36915,2],[36919,0],[36927,2],[36946,1],[36950,2],[36954,1],[36958,2],[36962,1],[36966,2],[36970,1],[36978,2],[36986,1],[36997,2],[37005,1],[37010,0],[37017,2],[37195,1],[37198,2],[37202,1],[37206,2],[37210,1],[37214,2],[37218,1],[37230,2],[37234,1],[37242,2],[37254,1],[37262,2],[37269,0],[37270,1],[37273,2],[37277,1],[37281,2],[37289,1],[37293,2],[37297,1],[37301,2],[37305,1],[37317,2],[37321,0],[37328,2],[37348,1],[37352,2],[37356,1],[37360,2],[37364,1],[37368,2],[37372,1],[37388,2],[37392,1],[37395,3],[37396,2],[37399,0],[37400,1],[37411,2],[37415,1],[37419,2],[37423,1],[37427,2],[37431,1],[37435,2],[37439,1],[37443,2],[37447,1],[37451,2],[37455,1],[37459,2],[37462,0],[37463,1],[37467,2],[37471,1],[37474,2],[37478,1],[37486,2],[37490,1],[37494,2],[37498,1],[37502,2],[37506,1],[37510,2],[37514,1],[37518,2],[37522,1],[37526,2],[37529,1],[37533,2],[37537,1],[37541,3],[37542,2],[37545,1],[37549,2],[37553,1],[37557,2],[37561,1],[37565,2],[37569,1],[37573,2],[37577,1],[37581,2],[37585,1],[37589,2],[37592,0],[37593,1],[37596,2],[37600,0],[37601,1],[37604,2],[37608,1],[37612,2],[37616,1],[37620,2],[37624,1],[37628,2],[37632,1],[37636,2],[37640,1],[37644,2],[37648,1],[37652,2],[37656,1],[37660,2],[37663,0],[37664,1],[37687,2],[37695,1],[37699,2],[37703,1],[37707,2],[37723,1],[37727,0],[37734,2],[37754,1],[37758,2],[37762,1],[37766,2],[37770,1],[37774,2],[37778,1],[37786,2],[37794,1],[37797,3],[37798,2],[37805,0],[37806,1],[37817,0],[37825,2],[38791,0],[38799,2]],"expect":{"protocol":"usb","speed":"low","packets":[{"index":1,"start_us":65.66666666666666,"end_us":459.8333333333333,"kind":"reset","pid_value":0,"ok":true},{"index":2,"start_us":564.9166666666666,"end_us":587.3333333333333,"kind":"packet","pid":"SOF","pid_value":165,"frame":100,"crc":"0x1F","ok":true},{"index":3,"start_us":616.8333333333333,"end_us":639.1666666666666,"kind":"packet","pid":"SETUP","pid_value":45,"addr":0,"endpoint":0,"crc":"0x02","ok":true},{"index":4,"start_us":642.5,"end_us":706.8333333333333,"kind":"packet","pid":"DATA0","pid_value":195,"data_hex":"80 06 00 01 00 00 40 00","crc":"0x94DD","ok":true},{"index":5,"start_us":710.1666666666666,"end_us":722,"kind":"packet","pid":"ACK","pid_value":210,"ok":true},{"index":6,"start_us":751.5,"end_us":773.8333333333333,"kind":"packet","pid":"IN","pid_value":105,"addr":0,"endpoint":0,"crc":"0x02","ok":true},{"index":7,"start_us":777,"end_us":788.8333333333333,"kind":"packet","pid":"NAK","pid_value":90,"ok":true},{"index":8,"start_us":818.5,"end_us":840.8333333333333,"kind":"packet","pid":"IN","pid_value":105,"addr":0,"endpoint":0,"crc":"0x02","ok":true},{"index":9,"start_us":844.0833333333333,"end_us":855.8333333333333,"kind":"packet","pid":"NAK","pid_value":90,"ok":true},{"index":10,"start_us":885.5,"end_us":907.8333333333333,"kind":"packet","pid":"IN","pid_value":105,"addr":0,"endpoint":0,"crc":"0x02","ok":true},{"index":11,"start_us":911,"end_us":975.5,"kind":"packet","pid":"DATA1","pid_value":75,"data_hex":"12 01 00 02 00 00 00 08","crc":"0xE757","ok":true},{"index":12,"start_us":978.6666666666666,"end_us":990.5,"kind":"packet","pid":"ACK","pid_value":210,"ok":true},{"index":13,"start_us":1020.1666666666666,"end_us":1042.5,"kind":"packet","pid":"OUT","pid_value":225,"addr":0,"endpoint":0,"crc":"0x02","ok":true},{"index":14,"start_us":1045.6666666666665,"end_us":1068,"kind":"packet","pid":"DATA1","pid_value":75,"crc":"0x0000","ok":true},{"index":15,"start_us":1071.3333333333333,"end_us":1083.1666666666665,"kind":"packet","pid":"ACK","pid_value":210,"ok":true},{"index":16,"start_us":1112.6666666666665,"end_us":1506.8333333333333,"kind":"reset","pid_value":0,"ok":true},{"index":17,"start_us":1612,"end_us":1634.1666666666665,"kind":"packet","pid":"SETUP","pid_value":45,"addr":0,"endpoint":0,"crc":"0x02","ok":true},{"index":18,"start_us":1637.5,"end_us":1701.8333333333333,"kind":"packet","pid":"DATA0","pid_value":195,"data_hex":"00 05 05 00 00 00 00 00","crc":"0xA1EA","ok":true},{"index":19,"start_us":1705.1666666666665,"end_us":1717,"kind":"packet","pid":"ACK","pid_value":210,"ok":true},{"index":20,"start_us":1746.5,"end_us":1768.8333333333333,"kind":"packet","pid":"IN","pid_value":105,"addr":0,"endpoint":0,"crc":"0x02","ok":true},{"index":21,"start_us":1772.1666666666665,"end_us":1794.5,"kind":"packet","pid":"DATA1","pid_value":75,"crc":"0x0000","ok":true},{"index":22,"start_us":1797.8333333333333,"end_us":1809.6666666666665,"kind":"packet","pid":"ACK","pid_value":210,"ok":true},{"index":23,"start_us":1839.1666666666665,"end_us":1861.5,"kind":"packet","pid":"SOF","pid_value":165,"frame":101,"crc":"0x00","ok":true},{"index":24,"start_us":1891,"end_us":1913.3333333333333,"kind":"packet","pid":"SETUP","pid_value":45,"addr":5,"endpoint":0,"crc":"0x1A","ok":true},{"index":25,"start_us":1916.6666666666665,"end_us":1981,"kind":"packet","pid":"DATA0","pid_value":195,"data_hex":"80 06 00 01 00 00 12 00","crc":"0xF4E0","ok":true},{"index":26,"start_us":1984.3333333333333,"end_us":1996.1666666666665,"kind":"packet","pid":"ACK","pid_value":210,"ok":true},{"index":27,"start_us":2025.6666666666665,"end_us":2048,"kind":"packet","pid":"IN","pid_value":105,"addr":5,"endpoint":0,"crc":"0x1A","ok":true},{"index":28,"start_us":2051.333333333333,"end_us":2063.1666666666665,"kind":"packet","pid":"NAK","pid_value":90,"ok":true},{"index":29,"start_us":2092.6666666666665,"end_us":2115,"kind":"packet","pid":"IN","pid_value":105,"addr":5,"endpoint":0,"crc":"0x1A","ok":true},{"index":30,"start_us":2118.333333333333,"end_us":2130.1666666666665,"kind":"packet","pid":"NAK","pid_value":90,"ok":true},{"index":31,"start_us":2159.6666666666665,"end_us":2182,"kind":"packet","pid":"IN","pid_value":105,"addr":5,"endpoint":0,"crc":"0x1A","ok":true},{"index":32,"start_us":2185.333333333333,"end_us":2249.6666666666665,"kind":"packet","pid":"DATA1","pid_value":75,"data_hex":"12 01 00 02 00 00 00 08","crc":"0xE757","ok":true},{"index":33,"start_us":2253,"end_us":2264.833333333333,"kind":"packet","pid":"ACK","pid_value":210,"ok":true},{"index":34,"start_us":2294.333333333333,"end_us":2316.6666666666665,"kind":"packet","pid":"IN","pid_value":105,"addr":5,"endpoint":0,"crc":"0x1A","ok":true},{"index":35,"start_us":2320,"end_us":2384.333333333333,"kind":"packet","pid":"DATA0","pid_value":195,"data_hex":"83 04 40 57 00 01 01 02","crc":"0xDC18","ok":true},{"index":36,"start_us":2387.6666666666665,"end_us":2399.5,"kind":"packet","pid":"ACK","pid_value":210,"ok":true},{"index":37,"start_us":2429,"end_us":2451.333333333333,"kind":"packet","pid":"IN","pid_value":105,"addr":5,"endpoint":0,"crc":"0x1A","ok":true},{"index":38,"start_us":2454.583333333333,"end_us":2519,"kind":"packet","pid":"DATA0","pid_value":195,"data_hex":"83 04 40 57 00 01 01 02","crc":"0xDC18","ok":true},{"index":39,"start_us":2522.1666666666665,"end_us":2534.1666666666665,"kind":"packet","pid":"ACK","pid_value":210,"ok":true},{"index":40,"start_us":2563.6666666666665,"end_us":2586,"kind":"packet","pid":"IN","pid_value":105,"addr":5,"endpoint":0,"crc":"0x1A","ok":true},{"index":41,"start_us":2589.1666666666665,"end_us":2623.333333333333,"kind":"packet","pid":"DATA1","pid_value":75,"data_hex":"03 01","crc":"0x7F3F","ok":true},{"index":42,"start_us":2626.6666666666665,"end_us":2638.5,"kind":"packet","pid":"ACK","pid_value":210,"ok":true},{"index":43,"start_us":2668.083333333333,"end_us":2690.333333333333,"kind":"packet","pid":"OUT","pid_value":225,"addr":5,"endpoint":0,"crc":"0x1A","ok":true},{"index":44,"start_us":2693.6666666666665,"end_us":2716,"kind":"packet","pid":"DATA1","pid_value":75,"crc":"0x0000","ok":true},{"index":45,"start_us":2719.333333333333,"end_us":2731.1666666666665,"kind":"packet","pid":"ACK","pid_value":210,"ok":true},{"index":46,"start_us":2760.6666666666665,"end_us":2783,"kind":"packet","pid":"SETUP","pid_value":45,"addr":5,"endpoint":0,"crc":"0x1A","ok":true},{"index":47,"start_us":2786.333333333333,"end_us":2850.6666666666665,"kind":"packet","pid":"DATA0","pid_value":195,"data_hex":"80 06 00 02 00 00 09 00","crc":"0x04AE","ok":true},{"index":48,"start_us":2854,"end_us":2865.833333333333,"kind":"packet","pid":"ACK","pid_value":210,"ok":true},{"index":49,"start_us":2895.333333333333,"end_us":2917.6666666666665,"kind":"packet","pid":"IN","pid_value":105,"addr":5,"endpoint":0,"crc":"0x1A","ok":true},{"index":50,"start_us":2920.9166666666665,"end_us":2932.833333333333,"kind":"packet","pid":"NAK","pid_value":90,"ok":true},{"index":51,"start_us":2962.333333333333,"end_us":2984.6666666666665,"kind":"packet","pid":"IN","pid_value":105,"addr":5,"endpoint":0,"crc":"0x1A","ok":true},{"index":52,"start_us":2988,"end_us":2999.833333333333,"kind":"packet","pid":"NAK","pid_value":90,"ok":true},{"index":53,"start_us":3029.333333333333,"end_us":3051.6666666666665,"kind":"packet","pid":"IN","pid_value":105,"addr":5,"endpoint":0,"crc":"0x1A","ok":true},{"index":54,"start_us":3054.9166666666665,"end_us":3119.333333333333,"kind":"packet","pid":"DATA1","pid_value":75,"data_hex":"09 02 22 00 01 01 00 80","crc":"0x400B","ok":true},{"index":55,"start_us":3122.5,"end_us":3134.333333333333,"kind":"packet","pid":"ACK","pid_value":210,"ok":true},{"index":56,"start_us":3164,"end_us":3186.333333333333,"kind":"packet","pid":"IN","pid_value":105,"addr":5,"endpoint":0,"crc":"0x1A","ok":true},{"index":57,"start_us":3189.5,"end_us":3217.1666666666665,"kind":"packet","pid":"DATA0","pid_value":195,"data_hex":"32","crc":"0x6AC1","ok":true},{"index":58,"start_us":3220.5,"end_us":3232.333333333333,"kind":"packet","pid":"ACK","pid_value":210,"ok":true},{"index":59,"start_us":3261.833333333333,"end_us":3284.1666666666665,"kind":"packet","pid":"OUT","pid_value":225,"addr":5,"endpoint":0,"crc":"0x1A","ok":true},{"index":60,"start_us":3287.4166666666665,"end_us":3309.833333333333,"kind":"packet","pid":"DATA1","pid_value":75,"crc":"0x0000","ok":true},{"index":61,"start_us":3313,"end_us":3324.833333333333,"kind":"packet","pid":"ACK","pid_value":210,"ok":true},{"index":62,"start_us":3354.4166666666665,"end_us":3376.833333333333,"kind":"packet","pid":"SETUP","pid_value":45,"addr":5,"endpoint":0,"crc":"0x1A","ok":true},{"index":63,"start_us":3380,"end_us":3444.333333333333,"kind":"packet","pid":"DATA0","pid_value":195,"data_hex":"80 06 00 02 00 00 22 00","crc":"0xF4B0","ok":true},{"index":64,"start_us":3447.6666666666665,"end_us":3459.5,"kind":"packet","pid":"ACK","pid_value":210,"ok":true},{"index":65,"start_us":3489.1666666666665,"end_us":3511.333333333333,"kind":"packet","pid":"IN","pid_value":105,"addr":5,"endpoint":0,"crc":"0x1A","ok":true},{"index":66,"start_us":3514.6666666666665,"end_us":3526.5,"kind":"packet","pid":"NAK","pid_value":90,"ok":true},{"index":67,"start_us":3556.083333333333,"end_us":3578.333333333333,"kind":"packet","pid":"IN","pid_value":105,"addr":5,"endpoint":0,"crc":"0x1A","ok":true},{"index":68,"start_us":3581.6666666666665,"end_us":3593.5,"kind":"packet","pid":"NAK","pid_value":90,"ok":true},{"index":69,"start_us":3623,"end_us":3645.5,"kind":"packet","pid":"IN","pid_value":105,"addr":5,"endpoint":0,"crc":"0x1A","ok":true},{"index":70,"start_us":3648.6666666666665,"end_us":3713,"kind":"packet","pid":"DATA1","pid_value":75,"data_hex":"09 02 22 00 01 01 00 80","crc":"0x400B","ok":true},{"index":71,"start_us":3716.333333333333,"end_us":3728.1666666666665,"kind":"packet","pid":"ACK","pid_value":210,"ok":true},{"index":72,"start_us":3757.6666666666665,"end_us":3780,"kind":"packet","pid":"IN","pid_value":105,"addr":5,"endpoint":0,"crc":"0x1A","ok":true},{"index":73,"start_us":3783.333333333333,"end_us":3847.6666666666665,"kind":"packet","pid":"DATA0","pid_value":195,"data_hex":"32 09 04 00 00 01 03 00","crc":"0x8DF4","ok":true},{"index":74,"start_us":3851,"end_us":3862.833333333333,"kind":"packet","pid":"ACK","pid_value":210,"ok":true},{"index":75,"start_us":3892.333333333333,"end_us":3914.6666666666665,"kind":"packet","pid":"IN","pid_value":105,"addr":5,"endpoint":0,"crc":"0x1A","ok":true},{"index":76,"start_us":3918,"end_us":3982.333333333333,"kind":"packet","pid":"DATA1","pid_value":75,"data_hex":"00 00 09 21 11 01 00 01","crc":"0x5696","ok":true},{"index":77,"start_us":3985.6666666666665,"end_us":3997.5,"kind":"packet","pid":"ACK","pid_value":210,"ok":true},{"index":78,"start_us":4027,"end_us":4049.333333333333,"kind":"packet","pid":"IN","pid_value":105,"addr":5,"endpoint":0,"crc":"0x1A","ok":true},{"index":79,"start_us":4052.6666666666665,"end_us":4117.666666666666,"kind":"packet","pid":"DATA0","pid_value":195,"data_hex":"22 3F 00 07 05 81 03 08","crc":"0x2417","ok":true},{"index":80,"start_us":4121,"end_us":4132.666666666666,"kind":"packet","pid":"ACK","pid_value":210,"ok":true},{"index":81,"start_us":4162.333333333333,"end_us":4184.666666666666,"kind":"packet","pid":"IN","pid_value":105,"addr":5,"endpoint":0,"crc":"0x1A","ok":true},{"index":82,"start_us":4187.833333333333,"end_us":4221.5,"kind":"packet","pid":"DATA1","pid_value":75,"data_hex":"00 0A","crc":"0x487E","ok":true},{"index":83,"start_us":4224.666666666666,"end_us":4236.5,"kind":"packet","pid":"ACK","pid_value":210,"ok":true},{"index":84,"start_us":4266.083333333333,"end_us":4288.333333333333,"kind":"packet","pid":"OUT","pid_value":225,"addr":5,"endpoint":0,"crc":"0x1A","ok":true},{"index":85,"start_us":4291.666666666666,"end_us":4314,"kind":"packet","pid":"DATA1","pid_value":75,"crc":"0x0000","ok":true},{"index":86,"start_us":4317.333333333333,"end_us":4329.166666666666,"kind":"packet","pid":"ACK","pid_value":210,"ok":true},{"index":87,"start_us":4358.666666666666,"end_us":4381,"kind":"packet","pid":"SETUP","pid_value":45,"addr":5,"endpoint":0,"crc":"0x1A","ok":true},{"index":88,"start_us":4384.333333333333,"end_us":4449.333333333333,"kind":"packet","pid":"DATA0","pid_value":195,"data_hex":"80 06 00 03 00 00 FF 00","crc":"0x64D4","ok":true},{"index":89,"start_us":4452.666666666666,"end_us":4464.5,"kind":"packet","pid":"ACK","pid_value":210,"ok":true},{"index":90,"start_us":4494,"end_us":4516.333333333333,"kind":"packet","pid":"IN","pid_value":105,"addr":5,"endpoint":0,"crc":"0x1A","ok":true},{"index":91,"start_us":4519.666666666666,"end_us":4531.5,"kind":"packet","pid":"NAK","pid_value":90,"ok":true},{"index":92,"start_us":4561,"end_us":4583.333333333333,"kind":"packet","pid":"IN","pid_value":105,"addr":5,"endpoint":0,"crc":"0x1A","ok":true},{"index":93,"start_us":4586.666666666666,"end_us":4598.333333333333,"kind":"packet","pid":"NAK","pid_value":90,"ok":true},{"index":94,"start_us":4628,"end_us":4650.333333333333,"kind":"packet","pid":"IN","pid_value":105,"addr":5,"endpoint":0,"crc":"0x1A","ok":true},{"index":95,"start_us":4653.666666666666,"end_us":4697,"kind":"packet","pid":"DATA1","pid_value":75,"data_hex":"04 03 09 04","crc":"0x7809","ok":true},{"index":96,"start_us":4700.166666666666,"end_us":4712,"kind":"packet","pid":"ACK","pid_value":210,"ok":true},{"index":97,"start_us":4741.666666666666,"end_us":4764,"kind":"packet","pid":"OUT","pid_value":225,"addr":5,"endpoint":0,"crc":"0x1A","ok":true},{"index":98,"start_us":4767.333333333333,"end_us":4789.5,"kind":"packet","pid":"DATA1","pid_value":75,"crc":"0x0000","ok":true},{"index":99,"start_us":4792.833333333333,"end_us":4804.666666666666,"kind":"packet","pid":"ACK","pid_value":210,"ok":true},{"index":100,"start_us":4834.25,"end_us":4856.5,"kind":"packet","pid":"SETUP","pid_value":45,"addr":5,"endpoint":0,"crc":"0x1A","ok":true},{"index":101,"start_us":4859.833333333333,"end_us":4924.833333333333,"kind":"packet","pid":"DATA0","pid_value":195,"data_hex":"80 06 02 03 09 04 FF 00","crc":"0xDB97","ok":true},{"index":102,"start_us":4928.166666666666,"end_us":4940,"kind":"packet","pid":"ACK","pid_value":210,"ok":true},{"index":103,"start_us":4969.5,"end_us":4991.833333333333,"kind":"packet","pid":"IN","pid_value":105,"addr":5,"endpoint":0,"crc":"0x1A","ok":true},{"index":104,"start_us":4995.166666666666,"end_us":5007,"kind":"packet","pid":"NAK","pid_value":90,"ok":true},{"index":105,"start_us":5036.5,"end_us":5058.833333333333,"kind":"packet","pid":"IN","pid_value":105,"addr":5,"endpoint":0,"crc":"0x1A","ok":true},{"index":106,"start_us":5062.166666666666,"end_us":5074,"kind":"packet","pid":"NAK","pid_value":90,"ok":true},{"index":107,"start_us":5103.5,"end_us":5125.833333333333,"kind":"packet","pid":"IN","pid_value":105,"addr":5,"endpoint":0,"crc":"0x1A","ok":true},{"index":108,"start_us":5129.166666666666,"end_us":5193.5,"kind":"packet","pid":"DATA1","pid_value":75,"data_hex":"12 03 42 00 65 00 6E 00","crc":"0xAF31","ok":true},{"index":109,"start_us":5196.833333333333,"end_us":5208.666666666666,"kind":"packet","pid":"ACK","pid_value":210,"ok":true},{"index":110,"start_us":5238.166666666666,"end_us":5260.5,"kind":"packet","pid":"IN","pid_value":105,"addr":5,"endpoint":0,"crc":"0x1A","ok":true},{"index":111,"start_us":5263.833333333333,"end_us":5328.166666666666,"kind":"packet","pid":"DATA0","pid_value":195,"data_hex":"63 00 68 00 50 00 6F 00","crc":"0xD1CD","ok":true},{"index":112,"start_us":5331.5,"end_us":5343.333333333333,"kind":"packet","pid":"ACK","pid_value":210,"ok":true},{"index":113,"start_us":5372.833333333333,"end_us":5395.166666666666,"kind":"packet","pid":"IN","pid_value":105,"addr":5,"endpoint":0,"crc":"0x1A","ok":true},{"index":114,"start_us":5398.5,"end_us":5432,"kind":"packet","pid":"DATA1","pid_value":75,"data_hex":"64 00","crc":"0x8FD4","ok":true},{"index":115,"start_us":5435.25,"end_us":5447,"kind":"packet","pid":"ACK","pid_value":210,"ok":true},{"index":116,"start_us":5476.583333333333,"end_us":5499,"kind":"packet","pid":"OUT","pid_value":225,"addr":5,"endpoint":0,"crc":"0x1A","ok":true},{"index":117,"start_us":5502.166666666666,"end_us":5524.5,"kind":"packet","pid":"DATA1","pid_value":75,"crc":"0x0000","ok":true},{"index":118,"start_us":5527.833333333333,"end_us":5539.666666666666,"kind":"packet","pid":"ACK","pid_value":210,"ok":true},{"index":119,"start_us":5569.166666666666,"end_us":5591.5,"kind":"packet","pid":"SETUP","pid_value":45,"addr":5,"endpoint":0,"crc":"0x1A","ok":true},{"index":120,"start_us":5594.833333333333,"end_us":5659.166666666666,"kind":"packet","pid":"DATA0","pid_value":195,"data_hex":"00 09 01 00 00 00 00 00","crc":"0x2527","ok":true},{"index":121,"start_us":5662.5,"end_us":5674.333333333333,"kind":"packet","pid":"ACK","pid_value":210,"ok":true},{"index":122,"start_us":5703.833333333333,"end_us":5726.166666666666,"kind":"packet","pid":"IN","pid_value":105,"addr":5,"endpoint":0,"crc":"0x1A","ok":true},{"index":123,"start_us":5729.5,"end_us":5751.833333333333,"kind":"packet","pid":"DATA1","pid_value":75,"crc":"0x0000","ok":true},{"index":124,"start_us":5755.166666666666,"end_us":5767,"kind":"packet","pid":"ACK","pid_value":210,"ok":true},{"index":125,"start_us":5796.5,"end_us":5818.833333333333,"kind":"packet","pid":"SETUP","pid_value":45,"addr":5,"endpoint":0,"crc":"0x1A","ok":true},{"index":126,"start_us":5822,"end_us":5886.5,"kind":"packet","pid":"DATA0","pid_value":195,"data_hex":"21 0A 00 00 00 00 00 00","crc":"0x20D6","ok":true},{"index":127,"start_us":5889.833333333333,"end_us":5901.5,"kind":"packet","pid":"ACK","pid_value":210,"ok":true},{"index":128,"start_us":5931.166666666666,"end_us":5953.5,"kind":"packet","pid":"IN","pid_value":105,"addr":5,"endpoint":0,"crc":"0x1A","ok":true},{"index":129,"start_us":5956.666666666666,"end_us":5968.5,"kind":"packet","pid":"STALL","pid_value":30,"ok":true},{"index":130,"start_us":5998.166666666666,"end_us":6020.5,"kind":"packet","pid":"IN","pid_value":105,"addr":5,"endpoint":1,"crc":"0x0C","ok":true},{"index":131,"start_us":6023.666666666666,"end_us":6035.5,"kind":"packet","pid":"NAK","pid_value":90,"ok":true},{"index":132,"start_us":6065.166666666666,"end_us":6087.5,"kind":"packet","pid":"IN","pid_value":105,"addr":5,"endpoint":1,"crc":"0x0C","ok":true},{"index":133,"start_us":6090.666666666666,"end_us":6102.5,"kind":"packet","pid":"NAK","pid_value":90,"ok":true},{"index":134,"start_us":6132.166666666666,"end_us":6154.5,"kind":"packet","pid":"IN","pid_value":105,"addr":5,"endpoint":1,"crc":"0x0C","ok":true},{"index":135,"start_us":6157.666666666666,"end_us":6169.5,"kind":"packet","pid":"NAK","pid_value":90,"ok":true},{"index":136,"start_us":6199.166666666666,"end_us":6221.333333333333,"kind":"packet","pid":"IN","pid_value":105,"addr":5,"endpoint":1,"crc":"0x0C","ok":true},{"index":137,"start_us":6224.666666666666,"end_us":6289,"kind":"packet","pid":"DATA0","pid_value":195,"data_hex":"00 00 04 00 00 00 00 00","crc":"0x70BE","ok":true},{"index":138,"start_us":6292.333333333333,"end_us":6304.166666666666,"kind":"packet","pid":"ACK","pid_value":210,"ok":true},{"index":139,"start_us":6465.166666666666,"end_us":6466.5,"kind":"keep_alive","pid_value":0,"ok":true}],"transactions":[{"index":1,"start_us":65.66666666666666,"end_us":459.8333333333333,"type":"RESET","addr":0,"endpoint":0,"data_len":0,"count":1,"packets":[1],"ok":true},{"index":2,"start_us":616.8333333333333,"end_us":722,"type":"SETUP","addr":0,"endpoint":0,"data_pid":"DATA0","data_hex":"80 06 00 01 00 00 40 00","data_len":8,"handshake":"ACK","count":1,"setup":{"bm_request_type":128,"b_request":6,"w_value":256,"w_index":0,"w_length":64,"direction":"in","type":"standard","recipient":"device","name":"GET_DESCRIPTOR","summary":"GET_DESCRIPTOR DEVICE length 64"},"packets":[3,4,5],"ok":true},{"index":3,"start_us":751.5,"end_us":855.8333333333333,"type":"IN","addr":0,"endpoint":0,"data_len":0,"handshake":"NAK","count":2,"packets":[6,7,8,9],"ok":true},{"index":4,"start_us":885.5,"end_us":990.5,"type":"IN","addr":0,"endpoint":0,"data_pid":"DATA1","data_hex":"12 01 00 02 00 00 00 08","data_len":8,"handshake":"ACK","count":1,"packets":[10,11,12],"ok":true},{"index":5,"start_us":1020.1666666666666,"end_us":1083.1666666666665,"type":"OUT","addr":0,"endpoint":0,"data_pid":"DATA1","data_len":0,"handshake":"ACK","count":1,"packets":[13,14,15],"ok":true},{"index":6,"start_us":1112.6666666666665,"end_us":1506.8333333333333,"type":"RESET","addr":0,"endpoint":0,"data_len":0,"count":1,"packets":[16],"ok":true},{"index":7,"start_us":1612,"end_us":1717,"type":"SETUP","addr":0,"endpoint":0,"data_pid":"DATA0","data_hex":"00 05 05 00 00 00 00 00","data_len":8,"handshake":"ACK","count":1,"setup":{"bm_request_type":0,"b_request":5,"w_value":5,"w_index":0,"w_length":0,"direction":"out","type":"standard","recipient":"device","name":"SET_ADDRESS","summary":"SET_ADDRESS 5"},"packets":[17,18,19],"ok":true},{"index":8,"start_us":1746.5,"end_us":1809.6666666666665,"type":"IN","addr":0,"endpoint":0,"data_pid":"DATA1","data_len":0,"handshake":"ACK","count":1,"packets":[20,21,22],"ok":true},{"index":9,"start_us":1891,"end_us":1996.1666666666665,"type":"SETUP","addr":5,"endpoint":0,"data_pid":"DATA0","data_hex":"80 06 00 01 00 00 12 00","data_len":8,"handshake":"ACK","count":1,"setup":{"bm_request_type":128,"b_request":6,"w_value":256,"w_index":0,"w_length":18,"direction":"in","type":"standard","recipient":"device","name":"GET_DESCRIPTOR","summary":"GET_DESCRIPTOR DEVICE length 18"},"packets":[24,25,26],"ok":true},{"index":10,"start_us":2025.6666666666665,"end_us":2130.1666666666665,"type":"IN","addr":5,"endpoint":0,"data_len":0,"handshake":"NAK","count":2,"packets":[27,28,29,30],"ok":true},{"index":11,"start_us":2159.6666666666665,"end_us":2264.833333333333,"type":"IN","addr":5,"endpoint":0,"data_pid":"DATA1","data_hex":"12 01 00 02 00 00 00 08","data_len":8,"handshake":"ACK","count":1,"packets":[31,32,33],"ok":true},{"index":12,"start_us":2294.333333333333,"end_us":2399.5,"type":"IN","addr":5,"endpoint":0,"data_pid":"DATA0","data_hex":"83 04 40 57 00 01 01 02","data_len":8,"handshake":"ACK","count":1,"packets":[34,35,36],"ok":true},{"index":13,"start_us":2429,"end_us":2534.1666666666665,"type":"IN","addr":5,"endpoint":0,"data_pid":"DATA0","data_hex":"83 04 40 57 00 01 01 02","data_len":8,"handshake":"ACK","count":1,"packets":[37,38,39],"ok":true},{"index":14,"start_us":2563.6666666666665,"end_us":2638.5,"type":"IN","addr":5,"endpoint":0,"data_pid":"DATA1","data_hex":"03 01","data_len":2,"handshake":"ACK","count":1,"packets":[40,41,42],"ok":true},{"index":15,"start_us":2668.083333333333,"end_us":2731.1666666666665,"type":"OUT","addr":5,"endpoint":0,"data_pid":"DATA1","data_len":0,"handshake":"ACK","count":1,"packets":[43,44,45],"ok":true},{"index":16,"start_us":2760.6666666666665,"end_us":2865.833333333333,"type":"SETUP","addr":5,"endpoint":0,"data_pid":"DATA0","data_hex":"80 06 00 02 00 00 09 00","data_len":8,"handshake":"ACK","count":1,"setup":{"bm_request_type":128,"b_request":6,"w_value":512,"w_index":0,"w_length":9,"direction":"in","type":"standard","recipient":"device","name":"GET_DESCRIPTOR","summary":"GET_DESCRIPTOR CONFIGURATION length 9"},"packets":[46,47,48],"ok":true},{"index":17,"start_us":2895.333333333333,"end_us":2999.833333333333,"type":"IN","addr":5,"endpoint":0,"data_len":0,"handshake":"NAK","count":2,"packets":[49,50,51,52],"ok":true},{"index":18,"start_us":3029.333333333333,"end_us":3134.333333333333,"type":"IN","addr":5,"endpoint":0,"data_pid":"DATA1","data_hex":"09 02 22 00 01 01 00 80","data_len":8,"handshake":"ACK","count":1,"packets":[53,54,55],"ok":true},{"index":19,"start_us":3164,"end_us":3232.333333333333,"type":"IN","addr":5,"endpoint":0,"data_pid":"DATA0","data_hex":"32","data_len":1,"handshake":"ACK","count":1,"packets":[56,57,58],"ok":true},{"index":20,"start_us":3261.833333333333,"end_us":3324.833333333333,"type":"OUT","addr":5,"endpoint":0,"data_pid":"DATA1","data_len":0,"handshake":"ACK","count":1,"packets":[59,60,61],"ok":true},{"index":21,"start_us":3354.4166666666665,"end_us":3459.5,"type":"SETUP","addr":5,"endpoint":0,"data_pid":"DATA0","data_hex":"80 06 00 02 00 00 22 00","data_len":8,"handshake":"ACK","count":1,"setup":{"bm_request_type":128,"b_request":6,"w_value":512,"w_index":0,"w_length":34,"direction":"in","type":"standard","recipient":"device","name":"GET_DESCRIPTOR","summary":"GET_DESCRIPTOR CONFIGURATION length 34"},"packets":[62,63,64],"ok":true},{"index":22,"start_us":3489.1666666666665,"end_us":3593.5,"type":"IN","addr":5,"endpoint":0,"data_len":0,"handshake":"NAK","count":2,"packets":[65,66,67,68],"ok":true},{"index":23,"start_us":3623,"end_us":3728.1666666666665,"type":"IN","addr":5,"endpoint":0,"data_pid":"DATA1","data_hex":"09 02 22 00 01 01 00 80","data_len":8,"handshake":"ACK","count":1,"packets":[69,70,71],"ok":true},{"index":24,"start_us":3757.6666666666665,"end_us":3862.833333333333,"type":"IN","addr":5,"endpoint":0,"data_pid":"DATA0","data_hex":"32 09 04 00 00 01 03 00","data_len":8,"handshake":"ACK","count":1,"packets":[72,73,74],"ok":true},{"index":25,"start_us":3892.333333333333,"end_us":3997.5,"type":"IN","addr":5,"endpoint":0,"data_pid":"DATA1","data_hex":"00 00 09 21 11 01 00 01","data_len":8,"handshake":"ACK","count":1,"packets":[75,76,77],"ok":true},{"index":26,"start_us":4027,"end_us":4132.666666666666,"type":"IN","addr":5,"endpoint":0,"data_pid":"DATA0","data_hex":"22 3F 00 07 05 81 03 08","data_len":8,"handshake":"ACK","count":1,"packets":[78,79,80],"ok":true},{"index":27,"start_us":4162.333333333333,"end_us":4236.5,"type":"IN","addr":5,"endpoint":0,"data_pid":"DATA1","data_hex":"00 0A","data_len":2,"handshake":"ACK","count":1,"packets":[81,82,83],"ok":true},{"index":28,"start_us":4266.083333333333,"end_us":4329.166666666666,"type":"OUT","addr":5,"endpoint":0,"data_pid":"DATA1","data_len":0,"handshake":"ACK","count":1,"packets":[84,85,86],"ok":true},{"index":29,"start_us":4358.666666666666,"end_us":4464.5,"type":"SETUP","addr":5,"endpoint":0,"data_pid":"DATA0","data_hex":"80 06 00 03 00 00 FF 00","data_len":8,"handshake":"ACK","count":1,"setup":{"bm_request_type":128,"b_request":6,"w_value":768,"w_index":0,"w_length":255,"direction":"in","type":"standard","recipient":"device","name":"GET_DESCRIPTOR","summary":"GET_DESCRIPTOR STRING index 0 length 255"},"packets":[87,88,89],"ok":true},{"index":30,"start_us":4494,"end_us":4598.333333333333,"type":"IN","addr":5,"endpoint":0,"data_len":0,"handshake":"NAK","count":2,"packets":[90,91,92,93],"ok":true},{"index":31,"start_us":4628,"end_us":4712,"type":"IN","addr":5,"endpoint":0,"data_pid":"DATA1","data_hex":"04 03 09 04","data_len":4,"handshake":"ACK","count":1,"packets":[94,95,96],"ok":true},{"index":32,"start_us":4741.666666666666,"end_us":4804.666666666666,"type":"OUT","addr":5,"endpoint":0,"data_pid":"DATA1","data_len":0,"handshake":"ACK","count":1,"packets":[97,98,99],"ok":true},{"index":33,"start_us":4834.25,"end_us":4940,"type":"SETUP","addr":5,"endpoint":0,"data_pid":"DATA0","data_hex":"80 06 02 03 09 04 FF 00","data_len":8,"handshake":"ACK","count":1,"setup":{"bm_request_type":128,"b_request":6,"w_value":770,"w_index":1033,"w_length":255,"direction":"in","type":"standard","recipient":"device","name":"GET_DESCRIPTOR","summary":"GET_DESCRIPTOR STRING index 2 lang 0x0409 length 255"},"packets":[100,101,102],"ok":true},{"index":34,"start_us":4969.5,"end_us":5074,"type":"IN","addr":5,"endpoint":0,"data_len":0,"handshake":"NAK","count":2,"packets":[103,104,105,106],"ok":true},{"index":35,"start_us":5103.5,"end_us":5208.666666666666,"type":"IN","addr":5,"endpoint":0,"data_pid":"DATA1","data_hex":"12 03 42 00 65 00 6E 00","data_len":8,"handshake":"ACK","count":1,"packets":[107,108,109],"ok":true},{"index":36,"start_us":5238.166666666666,"end_us":5343.333333333333,"type":"IN","addr":5,"endpoint":0,"data_pid":"DATA0","data_hex":"63 00 68 00 50 00 6F 00","data_len":8,"handshake":"ACK","count":1,"packets":[110,111,112],"ok":true},{"index":37,"start_us":5372.833333333333,"end_us":5447,"type":"IN","addr":5,"endpoint":0,"data_pid":"DATA1","data_hex":"64 00","data_len":2,"handshake":"ACK","count":1,"packets":[113,114,115],"ok":true},{"index":38,"start_us":5476.583333333333,"end_us":5539.666666666666,"type":"OUT","addr":5,"endpoint":0,"data_pid":"DATA1","data_len":0,"handshake":"ACK","count":1,"packets":[116,117,118],"ok":true},{"index":39,"start_us":5569.166666666666,"end_us":5674.333333333333,"type":"SETUP","addr":5,"endpoint":0,"data_pid":"DATA0","data_hex":"00 09 01 00 00 00 00 00","data_len":8,"handshake":"ACK","count":1,"setup":{"bm_request_type":0,"b_request":9,"w_value":1,"w_index":0,"w_length":0,"direction":"out","type":"standard","recipient":"device","name":"SET_CONFIGURATION","summary":"SET_CONFIGURATION 1"},"packets":[119,120,121],"ok":true},{"index":40,"start_us":5703.833333333333,"end_us":5767,"type":"IN","addr":5,"endpoint":0,"data_pid":"DATA1","data_len":0,"handshake":"ACK","count":1,"packets":[122,123,124],"ok":true},{"index":41,"start_us":5796.5,"end_us":5901.5,"type":"SETUP","addr":5,"endpoint":0,"data_pid":"DATA0","data_hex":"21 0A 00 00 00 00 00 00","data_len":8,"handshake":"ACK","count":1,"setup":{"bm_request_type":33,"b_request":10,"w_value":0,"w_index":0,"w_length":0,"direction":"out","type":"class","recipient":"interface","name":"class SET_IDLE","summary":"class SET_IDLE value 0x0000 index 0x0000 length 0"},"packets":[125,126,127],"ok":true},{"index":42,"start_us":5931.166666666666,"end_us":5968.5,"type":"IN","addr":5,"endpoint":0,"data_len":0,"handshake":"STALL","count":1,"packets":[128,129],"ok":true},{"index":43,"start_us":5998.166666666666,"end_us":6169.5,"type":"IN","addr":5,"endpoint":1,"data_len":0,"handshake":"NAK","count":3,"packets":[130,131,132,133,134,135],"ok":true},{"index":44,"start_us":6199.166666666666,"end_us":6304.166666666666,"type":"IN","addr":5,"endpoint":1,"data_pid":"DATA0","data_hex":"00 00 04 00 00 00 00 00","data_len":8,"handshake":"ACK","count":1,"packets":[136,137,138],"ok":true}],"transfers":[{"index":1,"start_us":616.8333333333333,"end_us":1083.1666666666665,"addr":0,"endpoint":0,"request":"GET_DESCRIPTOR DEVICE length 64","setup":{"bm_request_type":128,"b_request":6,"w_value":256,"w_index":0,"w_length":64,"direction":"in","type":"standard","recipient":"device","name":"GET_DESCRIPTOR","summary":"GET_DESCRIPTOR DEVICE length 64"},"data_hex":"12 01 00 02 00 00 00 08","data_len":8,"status":"OK","detail":"USB 2.00, max packet 8","ok":true},{"index":2,"start_us":1612,"end_us":1809.6666666666665,"addr":0,"endpoint":0,"request":"SET_ADDRESS 5","setup":{"bm_request_type":0,"b_request":5,"w_value":5,"w_index":0,"w_length":0,"direction":"out","type":"standard","recipient":"device","name":"SET_ADDRESS","summary":"SET_ADDRESS 5"},"data_len":0,"status":"OK","ok":true},{"index":3,"start_us":1891,"end_us":2731.1666666666665,"addr":5,"endpoint":0,"request":"GET_DESCRIPTOR DEVICE length 18","setup":{"bm_request_type":128,"b_request":6,"w_value":256,"w_index":0,"w_length":18,"direction":"in","type":"standard","recipient":"device","name":"GET_DESCRIPTOR","summary":"GET_DESCRIPTOR DEVICE length 18"},"data_hex":"12 01 00 02 00 00 00 08 83 04 40 57 00 01 01 02 03 01","data_len":18,"status":"OK","detail":"USB 2.00, max packet 8, VID 0x0483 PID 0x5740, 1 configuration(s)","ok":true},{"index":4,"start_us":2760.6666666666665,"end_us":3324.833333333333,"addr":5,"endpoint":0,"request":"GET_DESCRIPTOR CONFIGURATION length 9","setup":{"bm_request_type":128,"b_request":6,"w_value":512,"w_index":0,"w_length":9,"direction":"in","type":"standard","recipient":"device","name":"GET_DESCRIPTOR","summary":"GET_DESCRIPTOR CONFIGURATION length 9"},"data_hex":"09 02 22 00 01 01 00 80 32","data_len":9,"status":"OK","detail":"total length 34, 1 interface(s), 100 mA","ok":true},{"index":5,"start_us":3354.4166666666665,"end_us":4329.166666666666,"addr":5,"endpoint":0,"request":"GET_DESCRIPTOR CONFIGURATION length 34","setup":{"bm_request_type":128,"b_request":6,"w_value":512,"w_index":0,"w_length":34,"direction":"in","type":"standard","recipient":"device","name":"GET_DESCRIPTOR","summary":"GET_DESCRIPTOR CONFIGURATION length 34"},"data_hex":"09 02 22 00 01 01 00 80 32 09 04 00 00 01 03 00 00 00 09 21 11 01 00 01 22 3F 00 07 05 81 03 08 00 0A","data_len":34,"status":"OK","detail":"total length 34, 1 interface(s), 100 mA; interface 0 alt 0 class 0x03; endpoint 0x81 interrupt 8 bytes","ok":true},{"index":6,"start_us":4358.666666666666,"end_us":4804.666666666666,"addr":5,"endpoint":0,"request":"GET_DESCRIPTOR STRING index 0 length 255","setup":{"bm_request_type":128,"b_request":6,"w_value":768,"w_index":0,"w_length":255,"direction":"in","type":"standard","recipient":"device","name":"GET_DESCRIPTOR","summary":"GET_DESCRIPTOR STRING index 0 length 255"},"data_hex":"04 03 09 04","data_len":4,"status":"OK","detail":"languages 0x0409","ok":true},{"index":7,"start_us":4834.25,"end_us":5539.666666666666,"addr":5,"endpoint":0,"request":"GET_DESCRIPTOR STRING index 2 lang 0x0409 length 255","setup":{"bm_request_type":128,"b_request":6,"w_value":770,"w_index":1033,"w_length":255,"direction":"in","type":"standard","recipient":"device","name":"GET_DESCRIPTOR","summary":"GET_DESCRIPTOR STRING index 2 lang 0x0409 length 255"},"data_hex":"12 03 42 00 65 00 6E 00 63 00 68 00 50 00 6F 00 64 00","data_len":18,"status":"OK","detail":"\"BenchPod\"","ok":true},{"index":8,"start_us":5569.166666666666,"end_us":5767,"addr":5,"endpoint":0,"request":"SET_CONFIGURATION 1","setup":{"bm_request_type":0,"b_request":9,"w_value":1,"w_index":0,"w_length":0,"direction":"out","type":"standard","recipient":"device","name":"SET_CONFIGURATION","summary":"SET_CONFIGURATION 1"},"data_len":0,"status":"OK","ok":true},{"index":9,"start_us":5796.5,"end_us":5968.5,"addr":5,"endpoint":0,"request":"class SET_IDLE value 0x0000 index 0x0000 length 0","setup":{"bm_request_type":33,"b_request":10,"w_value":0,"w_index":0,"w_length":0,"direction":"out","type":"class","recipient":"interface","name":"class SET_IDLE","summary":"class SET_IDLE value 0x0000 index 0x0000 length 0"},"data_len":0,"status":"STALL","ok":false}],"sof_count":2,"keep_alive_count":1,"error_count":0}},{"name":"full_speed_errors_48msps","sample_rate_hz":48000000,"params":{"dp":1,"dm":2,"speed":"full"},"count":983,"edges":[[0,1],[200,2],[204,1],[208,2],[212,1],[216,2],[220,1],[224,2],[240,1],[244,2],[248,1],[252,2],[268,1],[272,2],[276,1],[280,2],[284,1],[288,2],[292,1],[296,2],[304,1],[308,2],[312,1],[316,2],[324,1],[336,2],[340,1],[344,2],[348,1],[352,2],[356,1],[360,2],[364,1],[372,2],[376,1],[380,2],[384,1],[388,2],[392,1],[412,2],[420,1],[424,2],[428,1],[436,2],[444,1],[456,0],[464,1],[484,2],[488,1],[492,2],[496,1],[500,2],[504,1],[508,2],[516,1],[524,2],[532,1],[540,2],[544,1],[548,0],[556,1],[576,2],[580,1],[584,2],[588,1],[592,2],[596,1],[600,2],[612,1],[616,2],[624,1],[636,2],[648,1],[652,2],[656,1],[660,2],[664,1],[672,2],[676,1],[680,2],[684,1],[688,2],[704,0],[712,1],[732,2],[736,1],[740,2],[744,1],[748,2],[752,1],[756,2],[764,1],[772,2],[784,1],[792,2],[796,0],[804,1]],"expect":{"protocol":"usb","speed":"full","packets":[{"index":1,"start_us":4.166666666666666,"end_us":9.666666666666666,"kind":"packet","pid":"DATA0","pid_value":195,"data_hex":"01 42 03 04","crc":"0xD45E","ok":false,"error":"bad CRC16"},{"index":2,"start_us":10.083333333333332,"end_us":11.583333333333332,"kind":"packet","pid":"NAK","pid_value":42,"ok":false,"error":"bad PID check"},{"index":3,"start_us":12,"end_us":14.833333333333332,"kind":"packet","pid":"IN","pid_value":105,"addr":3,"endpoint":1,"crc":"0x1C","ok":true},{"index":4,"start_us":15.25,"end_us":16.75,"kind":"packet","pid":"NAK","pid_value":90,"ok":true}],"transactions":[{"index":1,"start_us":4.166666666666666,"end_us":9.666666666666666,"type":"DATA0","addr":0,"endpoint":0,"data_pid":"DATA0","data_hex":"01 42 03 04","data_len":4,"count":1,"packets":[1],"ok":false,"error":"bad CRC16, no token before DATA0"},{"index":2,"start_us":10.083333333333332,"end_us":11.583333333333332,"type":"NAK","addr":0,"endpoint":0,"data_len":0,"count":1,"packets":[2],"ok":false,"error":"bad PID check, no token before NAK"},{"index":3,"start_us":12,"end_us":16.75,"type":"IN","addr":3,"endpoint":1,"data_len":0,"handshake":"NAK","count":1,"packets":[3,4],"ok":true}],"transfers":[],"sof_count":0,"keep_alive_count":0,"error_count":2}}]} From b5fe22007edee1dddbd18d17e5832f0687c3eae4 Mon Sep 17 00:00:00 2001 From: Edward Viaene Date: Fri, 20 Nov 2026 16:25:57 -0600 Subject: [PATCH 2/7] MCP: import the USB decoder only for protocol usb (works with embeddedci 4.0.0) Co-Authored-By: Claude Opus 5.5 --- packages/embeddedci-mcp/CHANGELOG.md | 5 +++-- packages/embeddedci-mcp/pyproject.toml | 2 +- packages/embeddedci-mcp/src/embeddedci_mcp/server.py | 6 +++++- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/packages/embeddedci-mcp/CHANGELOG.md b/packages/embeddedci-mcp/CHANGELOG.md index 8a35d21..7e287fc 100644 --- a/packages/embeddedci-mcp/CHANGELOG.md +++ b/packages/embeddedci-mcp/CHANGELOG.md @@ -2,12 +2,13 @@ ## 4.0.1 -Not released yet. Needs embeddedci 4.0.1. +Not released yet. - **`decode_la` decodes USB** full and low speed: `protocol="usb"`, `dp`, `dm`, `speed` (`auto`, `full`, `low`). `items` are transactions, `transfers` the control transfers (an enumeration as a list), with `speed`, `errors` and `sof_count`. `benchpod://capture/decode` - carries the packets, transactions and transfers. + carries the packets, transactions and transfers. USB needs embeddedci 4.0.1; with 4.0.0 the + tool says to upgrade. ## 4.0.0 diff --git a/packages/embeddedci-mcp/pyproject.toml b/packages/embeddedci-mcp/pyproject.toml index a7cecb5..f7549ae 100644 --- a/packages/embeddedci-mcp/pyproject.toml +++ b/packages/embeddedci-mcp/pyproject.toml @@ -26,7 +26,7 @@ classifiers = [ dependencies = [ # cloud: the embeddedci: destination; discovery: connect("discover") over mDNS; # analysis: dominant frequency in capture summaries; yaml: sensor definitions an agent writes. - "embeddedci[cloud,discovery,analysis,yaml]>=4.0.1,<5", + "embeddedci[cloud,discovery,analysis,yaml]>=4.0.0,<5", "mcp>=1.12,<2", "anyio>=4", "pydantic>=2.7", diff --git a/packages/embeddedci-mcp/src/embeddedci_mcp/server.py b/packages/embeddedci-mcp/src/embeddedci_mcp/server.py index db6b2c5..289e2bd 100644 --- a/packages/embeddedci-mcp/src/embeddedci_mcp/server.py +++ b/packages/embeddedci-mcp/src/embeddedci_mcp/server.py @@ -66,7 +66,6 @@ header_map = None # type: ignore[assignment] from embeddedci.benchpod import decode as sdk_decode -from embeddedci.benchpod import usb_decode from embeddedci.benchpod.capabilities import Capabilities from embeddedci.benchpod.client import API_BASE_ENV, API_KEY_ENV from embeddedci.benchpod.cloud_auth import DEFAULT_API_BASE @@ -2396,6 +2395,11 @@ def op() -> m.DecodeResult: raise ValueError("spi needs sclk") if protocol == "usb" and (dp is None or dm is None): raise ValueError("usb needs dp and dm") + if protocol == "usb": + try: + from embeddedci.benchpod import usb_decode + except ImportError: + raise ValueError("usb decode needs embeddedci 4.0.1 or later: pip install -U embeddedci") from None la = SESSION.last_la if capture == "new" or la is None: la = pod.capture_la(samples, sample_rate_hz=sample_rate_hz) From 9b8cf117c24f8ddfe5f87e162471cb573e7b2aad Mon Sep 17 00:00:00 2001 From: Edward Viaene Date: Fri, 20 Nov 2026 16:28:16 -0600 Subject: [PATCH 3/7] MCP tests: USB decode tests skip on an SDK without USB (min-SDK job) Co-Authored-By: Claude Opus 5.5 --- .../embeddedci-mcp/tests/test_capture_resources.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/packages/embeddedci-mcp/tests/test_capture_resources.py b/packages/embeddedci-mcp/tests/test_capture_resources.py index 0f2ca02..236f02b 100644 --- a/packages/embeddedci-mcp/tests/test_capture_resources.py +++ b/packages/embeddedci-mcp/tests/test_capture_resources.py @@ -63,6 +63,14 @@ def test_i2c_decode_has_timed_segments(connected): assert [s["type"] for s in t["segments"]][:3] == ["start", "address-write", "ack"] +try: # the min-SDK CI job runs these tests against embeddedci 4.0.0, which has no USB decoder + import embeddedci.benchpod.usb_decode # noqa: F401 + _no_usb = False +except ImportError: + _no_usb = True +needs_usb_sdk = pytest.mark.skipif(_no_usb, reason="needs embeddedci 4.0.1 (USB decode)") + + def _usb_vector_words(): """The SDK's shared full-speed enumeration vector (48 MS/s, D+ LA1, D- LA2) as dense words.""" from pathlib import Path @@ -76,6 +84,7 @@ def _usb_vector_words(): return words, case["sample_rate_hz"] +@needs_usb_sdk def test_usb_decode_lists_the_enumeration(connected): words, rate = _usb_vector_words() SESSION.last_la = LaCapture(words=words, sample_rate_hz=rate) @@ -89,6 +98,7 @@ def test_usb_decode_lists_the_enumeration(connected): assert d["transfers"][0]["request"] == "GET_DESCRIPTOR DEVICE length 64" +@needs_usb_sdk def test_usb_decode_needs_both_lines(connected): SESSION.last_la = LaCapture(words=[1] * 100, sample_rate_hz=48e6) with pytest.raises(Exception, match="usb needs dp and dm"): From ddec7f4da82466fad02c8ec20f8d84cc3d4d97a9 Mon Sep 17 00:00:00 2001 From: Edward Viaene Date: Fri, 20 Nov 2026 16:28:52 -0600 Subject: [PATCH 4/7] SDK version 4.0.1 in the repo; embeddedci-mcp needs embeddedci>=4.0.1 (USB decode) Co-Authored-By: Claude Opus 5.5 --- packages/embeddedci-mcp/CHANGELOG.md | 5 ++--- packages/embeddedci-mcp/pyproject.toml | 2 +- packages/embeddedci/pyproject.toml | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/packages/embeddedci-mcp/CHANGELOG.md b/packages/embeddedci-mcp/CHANGELOG.md index 7e287fc..8a35d21 100644 --- a/packages/embeddedci-mcp/CHANGELOG.md +++ b/packages/embeddedci-mcp/CHANGELOG.md @@ -2,13 +2,12 @@ ## 4.0.1 -Not released yet. +Not released yet. Needs embeddedci 4.0.1. - **`decode_la` decodes USB** full and low speed: `protocol="usb"`, `dp`, `dm`, `speed` (`auto`, `full`, `low`). `items` are transactions, `transfers` the control transfers (an enumeration as a list), with `speed`, `errors` and `sof_count`. `benchpod://capture/decode` - carries the packets, transactions and transfers. USB needs embeddedci 4.0.1; with 4.0.0 the - tool says to upgrade. + carries the packets, transactions and transfers. ## 4.0.0 diff --git a/packages/embeddedci-mcp/pyproject.toml b/packages/embeddedci-mcp/pyproject.toml index f7549ae..a7cecb5 100644 --- a/packages/embeddedci-mcp/pyproject.toml +++ b/packages/embeddedci-mcp/pyproject.toml @@ -26,7 +26,7 @@ classifiers = [ dependencies = [ # cloud: the embeddedci: destination; discovery: connect("discover") over mDNS; # analysis: dominant frequency in capture summaries; yaml: sensor definitions an agent writes. - "embeddedci[cloud,discovery,analysis,yaml]>=4.0.0,<5", + "embeddedci[cloud,discovery,analysis,yaml]>=4.0.1,<5", "mcp>=1.12,<2", "anyio>=4", "pydantic>=2.7", diff --git a/packages/embeddedci/pyproject.toml b/packages/embeddedci/pyproject.toml index 66ed061..03c35c6 100644 --- a/packages/embeddedci/pyproject.toml +++ b/packages/embeddedci/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "hatchling.build" [project] name = "embeddedci" -version = "4.0.0" +version = "4.0.1" description = "BenchPod SDK and pytest plugin for EmbeddedCI hardware-in-the-loop testing" readme = "README.md" requires-python = ">=3.10" From 5ba4c964bd8de933849d4685f8016a7f2dd35c7b Mon Sep 17 00:00:00 2001 From: Edward Viaene Date: Fri, 20 Nov 2026 19:17:47 -0600 Subject: [PATCH 5/7] LA decode: Modbus RTU, CAN/CAN FD, PWM, 1-Wire, SMBus/PMBus in the SDK and MCP decode_la Python mirrors of the server's decoders, held to them by the shared vectors. Co-Authored-By: Claude Opus 5.5 --- packages/embeddedci-mcp/CHANGELOG.md | 4 + packages/embeddedci-mcp/README.md | 4 +- .../src/embeddedci_mcp/guide.py | 2 +- .../src/embeddedci_mcp/models.py | 3 +- .../src/embeddedci_mcp/server.py | 123 ++++++- .../tests/test_capture_resources.py | 57 +++ .../embeddedci-mcp/tests/tools_surface.json | 131 ++++++- packages/embeddedci/CHANGELOG.md | 7 + packages/embeddedci/README.md | 14 + .../src/embeddedci/benchpod/_gojson.py | 28 ++ .../src/embeddedci/benchpod/can_decode.py | 326 ++++++++++++++++++ .../src/embeddedci/benchpod/client.py | 11 +- .../src/embeddedci/benchpod/constants.py | 2 +- .../src/embeddedci/benchpod/decode.py | 26 +- .../src/embeddedci/benchpod/modbus_decode.py | 277 +++++++++++++++ .../src/embeddedci/benchpod/onewire_decode.py | 218 ++++++++++++ .../src/embeddedci/benchpod/pwm_decode.py | 158 +++++++++ .../src/embeddedci/benchpod/results.py | 5 +- .../src/embeddedci/benchpod/smbus_decode.py | 257 ++++++++++++++ packages/embeddedci/tests/api_surface.json | 2 +- packages/embeddedci/tests/test_client_v2.py | 2 +- packages/embeddedci/tests/test_la_decoders.py | 113 ++++++ .../tests/testdata/can_decode_vectors.json | 1 + .../tests/testdata/modbus_decode_vectors.json | 1 + .../testdata/onewire_decode_vectors.json | 1 + .../tests/testdata/pwm_decode_vectors.json | 1 + .../tests/testdata/smbus_decode_vectors.json | 1 + 27 files changed, 1754 insertions(+), 21 deletions(-) create mode 100644 packages/embeddedci/src/embeddedci/benchpod/_gojson.py create mode 100644 packages/embeddedci/src/embeddedci/benchpod/can_decode.py create mode 100644 packages/embeddedci/src/embeddedci/benchpod/modbus_decode.py create mode 100644 packages/embeddedci/src/embeddedci/benchpod/onewire_decode.py create mode 100644 packages/embeddedci/src/embeddedci/benchpod/pwm_decode.py create mode 100644 packages/embeddedci/src/embeddedci/benchpod/smbus_decode.py create mode 100644 packages/embeddedci/tests/test_la_decoders.py create mode 100644 packages/embeddedci/tests/testdata/can_decode_vectors.json create mode 100644 packages/embeddedci/tests/testdata/modbus_decode_vectors.json create mode 100644 packages/embeddedci/tests/testdata/onewire_decode_vectors.json create mode 100644 packages/embeddedci/tests/testdata/pwm_decode_vectors.json create mode 100644 packages/embeddedci/tests/testdata/smbus_decode_vectors.json diff --git a/packages/embeddedci-mcp/CHANGELOG.md b/packages/embeddedci-mcp/CHANGELOG.md index 8a35d21..42e09da 100644 --- a/packages/embeddedci-mcp/CHANGELOG.md +++ b/packages/embeddedci-mcp/CHANGELOG.md @@ -8,6 +8,10 @@ Not released yet. Needs embeddedci 4.0.1. (`auto`, `full`, `low`). `items` are transactions, `transfers` the control transfers (an enumeration as a list), with `speed`, `errors` and `sof_count`. `benchpod://capture/decode` carries the packets, transactions and transfers. +- **`decode_la` decodes Modbus RTU, CAN / CAN FD, PWM, 1-Wire and SMBus/PMBus:** new + arguments `tx` (Modbus two-line tap), `can`, `bitrate`, `data_bitrate`, `sample_point`, + `channels` (PWM), `onewire`, `pec`. `items` has one line per frame, transaction or channel; + `errors` counts the bad ones. `benchpod://capture/decode` carries the full results. ## 4.0.0 diff --git a/packages/embeddedci-mcp/README.md b/packages/embeddedci-mcp/README.md index e8f7c96..d742122 100644 --- a/packages/embeddedci-mcp/README.md +++ b/packages/embeddedci-mcp/README.md @@ -344,7 +344,7 @@ version the SDK pins (0.1.0, bundled) unless `BENCHPOD_SENSOR_LIBRARY`, the CLI' | `capture_adc` | Capture the ADC: calibrated statistics, dominant frequency and a min/max envelope; `clipped_samples` counts samples past the range's full scale. `oversample` converts at 400 kS/s and averages down to `sample_rate_hz` for lower noise, about 5 s at most. | `samples=4096`, `sample_rate_hz`, `source`, `points=200`, `trigger_la`, `trigger_edge=rising`, `trigger_timeout_s=10`, `range`, `oversample` | | `capture_la` | Capture all 14 LA channels: levels, edge count, first edge and frequency per channel. Up to 48 MS/s on gateware v50+. `send` (gateware v55+) runs one transaction right after the capture arms: `{"bus":"i2c","addr":118,"write_hex":"d0","read":1}` (the `i2c_open` session, else one from the wiring), `{"bus":"spi","tx_hex":"9f00"}` (SPI pins from the wiring) or `{"bus":"gpio","la":6,"level":0}` (a GPIO output); without `trigger_la` it triggers on SDA or CS falling or the pin's edge, and the result's `send` has the reply. | `samples=4096`, `sample_rate_hz`, `stop_dac_after_s`, `trigger_la`, `trigger_edge=rising`, `trigger_timeout_s=10`, `trigger_pre_samples=0`, `send` | | `capture_correlated` | ADC and LA from one hardware trigger, on one timebase. | `adc_samples=4096`, `adc_sample_rate_hz`, `la_samples=4096`, `la_sample_rate_hz`, `stop_dac_after_s`, `points=200`, `trigger_la`, `trigger_edge=rising`, `trigger_timeout_s=10`, `source` | -| `decode_la` | Decode I2C, UART, SPI or USB from the last LA capture (or a new one). USB (full speed at 48 MS/s, low speed from 6 MS/s) returns transactions as `items` and the control transfers as `transfers`: an enumeration as a list. | **`protocol`**, `sda`, `scl`, `rx`, `baud`, `sclk`, `mosi`, `miso`, `cs`, `mode=0`, `dp`, `dm`, `speed=auto`, `capture=last`, `samples=16384`, `sample_rate_hz=1000000`, `max_items=200` | +| `decode_la` | Decode I2C, UART, SPI, USB, Modbus RTU, CAN / CAN FD, PWM, 1-Wire, SMBus or PMBus from the last LA capture (or a new one). USB (full speed at 48 MS/s, low speed from 6 MS/s) returns transactions as `items` and the control transfers as `transfers`: an enumeration as a list. CAN needs 6 samples per data bit. | **`protocol`**, `sda`, `scl`, `rx`, `baud`, `sclk`, `mosi`, `miso`, `cs`, `mode=0`, `dp`, `dm`, `speed=auto`, `tx`, `can`, `bitrate`, `data_bitrate`, `sample_point`, `channels`, `onewire`, `pec=auto`, `capture=last`, `samples=16384`, `sample_rate_hz=1000000`, `max_items=200` | | `la_timing` | Edge timestamps, pulse widths, frequency, duty cycle and channel-to-channel delay from the last capture. | **`la`**, `edge=rising`, `to_la`, `to_edge=rising`, `after=0`, `max_edges=100` | ### DAC @@ -423,7 +423,7 @@ in an app (the BenchPod desktop app's capture view), three more give the last ca |---|---| | `benchpod://capture/la` | The last `capture_la` / `capture_correlated` as run-length `edges`, `[sample index, 14-bit word]` from sample 0, plus `sample_rate_hz`, `count`, `pre_samples`, `seq`, `correlated`. | | `benchpod://capture/adc` | The last `capture_adc` / `capture_correlated`: `samples` in volts (or mA for `current_in`), `unit`, `sample_rate_hz`, `source`, `seq`, `correlated`. | -| `benchpod://capture/decode` | The last `decode_la`: `protocol`, `channels`, and I2C `transactions` with timed segments, UART / SPI `frames` with `start_us` / `end_us`, or USB `packets`, `transactions` and `transfers`; `seq` is the capture it decoded. | +| `benchpod://capture/decode` | The last `decode_la`: `protocol`, `channels`, and I2C `transactions` with timed segments, UART / SPI / Modbus / CAN `frames` with `start_us` / `end_us`, USB `packets`, `transactions` and `transfers`, 1-Wire and SMBus `transactions`, or PWM `channels`; `seq` is the capture it decoded. | Each is `{"seq": 0}` before the first capture. `seq` numbers the captures, and `correlated` says the LA and ADC captures share one timebase. They can be megabytes: an agent should read the diff --git a/packages/embeddedci-mcp/src/embeddedci_mcp/guide.py b/packages/embeddedci-mcp/src/embeddedci_mcp/guide.py index ce5dd33..51942a0 100644 --- a/packages/embeddedci-mcp/src/embeddedci_mcp/guide.py +++ b/packages/embeddedci-mcp/src/embeddedci_mcp/guide.py @@ -30,7 +30,7 @@ - 4-20 mA input: adc_read(source='current_in') reads terminal J8 and returns current in amps (0.004 to 0.020 for a live loop) next to the voltage across the sense resistor (249 ohm; from analog module v3r5 100 ohm behind a 30 mA limiter, read in the low range by default, so a reading stuck near 28.5 to 31.5 mA is the limiter). calibration shows whether the pod has calibrated its ADC offset there. If not, analog readings can be off by up to about 50 mV: ask the user to disconnect J8, then calibrate (once per pod, stored on the pod; it corrects every ADC source). - 4-20 mA output: current_out(current) holds a loop current on terminal J9, in amps (0.012 is 12 mA), and returns the current actually held and the range. It needs an external floating loop supply on J9 and cannot go below about 4 mA or above about 20 mA. It shares the DAC with the voltage outputs and switches them off; dac_stop does not return the loop to 4 mA, current_out(0.004) does. The loop must float: nothing in it may touch pod ground, also not through a target that shares a ground with the pod (SWD, UART). Ask the user how J9 is wired first, and never suggest wiring J9 straight into J8. generate and replay take dac_path='current_out' to play a waveform as a current (levels in amps); capture_adc(source='current_in') summarises the loop current in amps. - Gateware images: the FPGA runs either the 'loop' image (control_loop) or the 'deep_replay' image (replays longer than 2048 samples). control_loop and replay switch automatically (~3 s; switched_image in the result says so). A switch resets the FPGA and stops any DAC output, UART session or sensor emulation, so start those after it. fpga_image switches explicitly. I2C/SPI/UART sensors run on a third, emulation image that sensor_start loads by itself (control_loop and deep replays are unavailable while it runs). -- Logic: capture_la, then decode_la (i2c/uart/spi/usb; usb full speed needs a 48 MS/s capture) re-decodes that capture without re-capturing, and la_timing measures edge times, pulse widths, frequency and the delay between two channels (e.g. trigger pin to result pin). +- Logic: capture_la, then decode_la (i2c/uart/spi/usb/modbus/can/pwm/onewire/smbus/pmbus; usb full speed needs a 48 MS/s capture) re-decodes that capture without re-capturing, and la_timing measures edge times, pulse widths, frequency and the delay between two channels (e.g. trigger pin to result pin). - Triggers: capture_adc, capture_la and capture_correlated take trigger_la (+ trigger_edge rising/falling/high/low, trigger_timeout seconds) to start on an event rather than immediately, so t = 0 is that edge. Without the trigger firing the tool fails with "TriggerTimeout: ...". - Power profiles: measure_power(duration) reports the DUT's average/minimum/peak current, voltage, energy and charge over a window, with an optional trace (points). To profile across other tool calls, bracket them with power_profile_start and power_profile_stop. - CAN: can_open (mode 'internal' self-tests a lone pod), can_write, can_read, can_respond, can_close. diff --git a/packages/embeddedci-mcp/src/embeddedci_mcp/models.py b/packages/embeddedci-mcp/src/embeddedci_mcp/models.py index d162234..309640e 100644 --- a/packages/embeddedci-mcp/src/embeddedci_mcp/models.py +++ b/packages/embeddedci-mcp/src/embeddedci_mcp/models.py @@ -766,7 +766,8 @@ class DecodeResult(BaseModel): speed: Optional[str] = Field(None, description="USB only: full or low.") transfers: Optional[List[str]] = Field(None, description=( "USB only: one line per control transfer (request, status, descriptor read back).")) - errors: Optional[int] = Field(None, description="USB only: packets with an error (CRC, bit stuffing, PID).") + errors: Optional[int] = Field(None, description=( + "USB, Modbus, CAN, 1-Wire, SMBus/PMBus: packets, frames or transactions with an error.")) sof_count: Optional[int] = Field(None, description="USB only: start-of-frame packets (left out of items).") diff --git a/packages/embeddedci-mcp/src/embeddedci_mcp/server.py b/packages/embeddedci-mcp/src/embeddedci_mcp/server.py index 289e2bd..518b3c2 100644 --- a/packages/embeddedci-mcp/src/embeddedci_mcp/server.py +++ b/packages/embeddedci-mcp/src/embeddedci_mcp/server.py @@ -2371,20 +2371,36 @@ async def decode_la( dm: Annotated[Optional[LaPin], Field(description="usb: the channel on D-.")] = None, speed: Annotated[Literal["auto", "full", "low"], Field(description=( "usb: full (12 Mbit/s), low (1.5 Mbit/s) or auto (from the idle state)."))] = "auto", + tx: Annotated[Optional[LaPin], Field(description=( + "modbus: the other direction on a two-line tap (rx alone for an RS-485 receive output)."))] = None, + can: Annotated[Optional[LaPin], Field(description="can: the transceiver's RXD (or the controller's TX/RX).")] = None, + bitrate: Annotated[Optional[float], Field(gt=0, le=5_000_000, description="can: nominal bit rate, bit/s.")] = None, + data_bitrate: Annotated[Optional[float], Field(gt=0, le=12_000_000, description=( + "can: CAN FD data bit rate, bit/s (left out: the nominal rate)."))] = None, + sample_point: Annotated[Optional[float], Field(gt=0, lt=1, description=( + "can: where a bit is read, as a fraction of it (default 0.75)."))] = None, + channels: Annotated[Optional[List[LaPin]], Field(description="pwm: the channels to measure.")] = None, + onewire: Annotated[Optional[LaPin], Field(description="onewire: the bus line.")] = None, + pec: Annotated[Literal["auto", "on", "off"], Field(description=( + "smbus/pmbus: auto = a trailing byte that matches is a PEC; on = every transaction ends in one."))] = "auto", capture: Annotated[Literal["last", "new"], Field(description=( "last = decode the previous capture_la; new = capture first (needs samples/sample_rate_hz)."))] = "last", samples: Samples = 16384, sample_rate_hz: Annotated[float, Field(gt=0, le=50_000_000)] = 1_000_000, max_items: Annotated[int, Field(ge=1, le=5000)] = 200, ) -> m.DecodeResult: - """Decode I2C (sda, scl), UART (rx, baud), SPI (sclk + mosi/miso/cs, mode) or USB (dp, dm, - speed) from LA data. + """Decode I2C (sda, scl), UART (rx, baud), SPI (sclk + mosi/miso/cs, mode), USB (dp, dm, + speed), Modbus RTU (rx, baud, tx), CAN/CAN FD (can, bitrate, data_bitrate), PWM (channels), + 1-Wire (onewire) or SMBus/PMBus (sda, scl, pec) from LA data. - Sample at least ~10x the bit rate; USB full speed needs a 48 MS/s capture, low speed 6 MS/s. + Sample at least ~10x the bit rate; USB full speed needs a 48 MS/s capture, low speed 6 MS/s; + CAN 6 samples per data bit; 1-Wire 1 MS/s (4 MS/s in overdrive). USB items are transactions (token, data, handshake; repeated NAKs merged), transfers the control transfers with the SETUP request and descriptors decoded (an enumeration). Decoding the last capture again with other channels is free. """ + channels_arg = channels or [] + def op() -> m.DecodeResult: pod = SESSION.require() if protocol == "i2c" and (sda is None or scl is None): @@ -2395,6 +2411,16 @@ def op() -> m.DecodeResult: raise ValueError("spi needs sclk") if protocol == "usb" and (dp is None or dm is None): raise ValueError("usb needs dp and dm") + if protocol == "modbus" and (rx is None or baud is None): + raise ValueError("modbus needs rx and baud") + if protocol == "can" and (can is None or bitrate is None): + raise ValueError("can needs can (the channel) and bitrate") + if protocol == "pwm" and not channels_arg: + raise ValueError("pwm needs channels") + if protocol == "onewire" and onewire is None: + raise ValueError("onewire needs onewire (the channel)") + if protocol in ("smbus", "pmbus") and (sda is None or scl is None): + raise ValueError(f"{protocol} needs sda and scl") if protocol == "usb": try: from embeddedci.benchpod import usb_decode @@ -2406,8 +2432,14 @@ def op() -> m.DecodeResult: SESSION.last_la = la channels = {k: v for k, v in (("sda", sda), ("scl", scl), ("rx", rx), ("baud", baud), ("sclk", sclk), ("mosi", mosi), ("miso", miso), ("cs", cs), - ("dp", dp), ("dm", dm)) + ("dp", dp), ("dm", dm), ("tx", tx), ("can", can), + ("bitrate", bitrate), ("data_bitrate", data_bitrate), + ("sample_point", sample_point), ("onewire", onewire)) if v is not None} + if protocol == "pwm": + channels["channels"] = list(channels_arg) + if protocol in ("smbus", "pmbus"): + channels["pec"] = pec if protocol == "spi": channels["mode"] = mode if protocol == "usb": @@ -2425,6 +2457,12 @@ def op() -> m.DecodeResult: truncated=len(items) > max_items, speed=frames.speed, transfers=transfers[:max_items], errors=frames.error_count, sof_count=frames.sof_count) + if protocol in _LA_FORMATTERS: + items = _LA_FORMATTERS[protocol](frames) + n = len(frames.channels) if protocol == "pwm" else len(frames) + errors = 0 if protocol == "pwm" else sum(1 for f in frames if not f.ok) + return m.DecodeResult(protocol=protocol, count=n, items=items[:max_items], + truncated=len(items) > max_items, errors=errors) if protocol == "i2c": items = i2c.format_transactions(frames).splitlines() elif protocol == "uart": @@ -2439,6 +2477,72 @@ def op() -> m.DecodeResult: return await _call(op) +def _t(us: float) -> str: + return f"{us / 1e6:.6f}s" + + +def _fmt_modbus(frames) -> List[str]: + return [f"{_t(f.start_us)} {f.role} addr {f.addr} {f.summary}" + ("" if f.ok else f" error={f.error}") + for f in frames] + + +def _fmt_can(frames) -> List[str]: + out = [] + for f in frames: + kind = "" if f.kind == "data" else f" {f.kind}" + fd = (" FD" + (" BRS" if f.brs else "")) if f.fd else "" + out.append(f"{_t(f.start_us)} {f.id_hex}{kind}{fd} [{f.len}] {f.data_hex}".rstrip() + + ("" if f.ok else f" error={f.error}")) + return out + + +def _fmt_pwm(res) -> List[str]: + out = [] + for c in res.channels: + if not c.count: + out.append(f"LA{c.channel}: no full period (level {c.level})") + continue + line = (f"LA{c.channel}: {c.count} periods, {c.freq_hz.mean:.6g} Hz ({c.freq_hz.min:.6g}-{c.freq_hz.max:.6g}), " + f"duty {100 * c.duty.mean:.2f} % ({100 * c.duty.min:.2f}-{100 * c.duty.max:.2f}), " + f"high {c.high_us.mean:.4g} us, jitter {c.jitter_us:.3g} us") + if c.glitches: + line += f", {c.glitches} glitches" + if c.servo: + line += f", servo {c.servo.pulse_ms.mean:.3f} ms ({c.servo.position_pct.mean:.1f} %)" + out.append(line) + return out + + +def _fmt_onewire(tx) -> List[str]: + out = [] + for t in tx: + parts = [_t(t.start_us), "reset" if t.reset else "(no reset)"] + if t.reset: + parts.append("presence" if t.presence else "no presence") + if t.overdrive: + parts.append("overdrive") + parts += [p for p in (t.rom_command_name, t.rom, t.function, t.detail) if p] + if t.bytes_hex: + parts.append(f"[{t.bytes_hex}]") + out.append(" ".join(parts) + ("" if t.ok else f" error={t.error}")) + return out + + +def _fmt_smbus(tx) -> List[str]: + out = [] + for t in tx: + cmd = t.command_name or (f"cmd 0x{t.command:02X}" if t.command is not None else "") + parts = [p for p in (_t(t.start_us), t.addr_hex, t.kind, cmd, t.data_hex, t.value) if p] + if t.pec != "none": + parts.append(f"PEC {t.pec}") + out.append(" ".join(parts) + ("" if t.ok else f" error={t.error}")) + return out + + +_LA_FORMATTERS = {"modbus": _fmt_modbus, "can": _fmt_can, "pwm": _fmt_pwm, "onewire": _fmt_onewire, + "smbus": _fmt_smbus, "pmbus": _fmt_smbus} + + def _pulse_stats(widths: List[float]) -> m.PulseStats: if not widths: return m.PulseStats(count=0) @@ -3031,8 +3135,12 @@ def _decode_view(la: Any, protocol: str, channels: Dict[str, Any], frames: Any) frames (the EmbeddedCI web app's decode result).""" view: Dict[str, Any] = {"seq": SESSION.la_seq, "protocol": protocol, "channels": {k: v for k, v in channels.items()}} - if protocol == "usb": + if protocol in ("usb", "pwm"): view.update({k: v for k, v in frames.as_dict().items() if k != "protocol"}) + elif protocol in ("modbus", "can"): + view["frames"] = [f.as_dict() for f in frames] + elif protocol in ("onewire", "smbus", "pmbus"): + view["transactions"] = [t.as_dict() for t in frames] elif protocol == "i2c": view["transactions"] = i2c.timed_transactions(la.words, channels["sda"], channels["scl"], la.sample_rate_hz) @@ -3091,8 +3199,9 @@ def capture_adc_resource() -> str: @mcp.resource("benchpod://capture/decode", name="capture_decode_data", mime_type="application/json", title="Last decode, with timing", description=("The last decode_la in full: I2C transactions with timed segments, UART / " - "SPI frames, or USB packets, transactions and transfers, for drawing on the " - "capture. seq is the capture it decoded.")) + "SPI / Modbus / CAN frames, USB packets, transactions and transfers, 1-Wire and " + "SMBus transactions, or PWM channels, for drawing on the capture. seq is the " + "capture it decoded.")) def capture_decode_resource() -> str: return json.dumps(SESSION.last_decode or {"seq": 0}, separators=(",", ":")) diff --git a/packages/embeddedci-mcp/tests/test_capture_resources.py b/packages/embeddedci-mcp/tests/test_capture_resources.py index 236f02b..57e2c30 100644 --- a/packages/embeddedci-mcp/tests/test_capture_resources.py +++ b/packages/embeddedci-mcp/tests/test_capture_resources.py @@ -103,3 +103,60 @@ def test_usb_decode_needs_both_lines(connected): SESSION.last_la = LaCapture(words=[1] * 100, sample_rate_hz=48e6) with pytest.raises(Exception, match="usb needs dp and dm"): call("decode_la", protocol="usb", dp=1) + + +def _vector(name: str, case: str): + """A shared decode vector as dense words, with its case.""" + from pathlib import Path + + path = Path(__file__).resolve().parents[2] / "embeddedci" / "tests" / "testdata" / f"{name}_decode_vectors.json" + c = next(x for x in json.loads(path.read_text())["cases"] if x["name"] == case) + words, edges = [0] * c["count"], c["edges"] + for k, (at, w) in enumerate(edges): + end = edges[k + 1][0] if k + 1 < len(edges) else c["count"] + words[at:end] = [w] * (end - at) + return words, c + + +@needs_usb_sdk +def test_fieldbus_decoders_through_the_tool(connected): + words, c = _vector("modbus", "rtu_19200_session") + SESSION.last_la = LaCapture(words=words, sample_rate_hz=c["sample_rate_hz"]) + r = call("decode_la", protocol="modbus", rx=3, baud=19200) + assert r["errors"] == 0 and "READ_HOLDING_REGISTERS 107: 555 0 100" in r["items"][1] + assert json.loads(capture_decode_resource())["frames"][1]["reply_to"] == 1 + + words, c = _vector("can", "fd_500k_2m_48msps") + SESSION.last_la = LaCapture(words=words, sample_rate_hz=c["sample_rate_hz"]) + r = call("decode_la", protocol="can", can=4, bitrate=500000, data_bitrate=2000000) + assert any("FD BRS [64]" in i for i in r["items"]) and any("error frame" in i for i in r["items"]) + + words, c = _vector("pwm", "fan_and_servo_1msps") + SESSION.last_la = LaCapture(words=words, sample_rate_hz=c["sample_rate_hz"]) + r = call("decode_la", protocol="pwm", channels=[1, 2]) + assert r["count"] == 2 and "servo" in r["items"][1] + assert [ch["channel"] for ch in json.loads(capture_decode_resource())["channels"]] == [1, 2] + + words, c = _vector("onewire", "standard_and_overdrive_4msps") + SESSION.last_la = LaCapture(words=words, sample_rate_hz=c["sample_rate_hz"]) + r = call("decode_la", protocol="onewire", onewire=6) + assert any("READ_SCRATCHPAD 21.5 °C" in i for i in r["items"]) + + words, c = _vector("smbus", "pmbus_100k_1msps") + SESSION.last_la = LaCapture(words=words, sample_rate_hz=c["sample_rate_hz"]) + r = call("decode_la", protocol="pmbus", sda=1, scl=2) + assert any("READ_VOUT 00 06 3 V PEC ok" in i for i in r["items"]) + assert json.loads(capture_decode_resource())["transactions"][0]["command_name"] == "VOUT_MODE" + + +@pytest.mark.parametrize("args, msg", [ + ({"protocol": "modbus", "rx": 1}, "modbus needs rx and baud"), + ({"protocol": "can", "can": 1}, "can needs"), + ({"protocol": "pwm"}, "pwm needs channels"), + ({"protocol": "onewire"}, "onewire needs"), + ({"protocol": "smbus", "sda": 1}, "smbus needs sda and scl"), +]) +def test_fieldbus_decoders_need_their_lines(connected, args, msg): + SESSION.last_la = LaCapture(words=[1] * 100, sample_rate_hz=1e6) + with pytest.raises(Exception, match=msg): + call("decode_la", **args) diff --git a/packages/embeddedci-mcp/tests/tools_surface.json b/packages/embeddedci-mcp/tests/tools_surface.json index 10e0926..93d98e8 100644 --- a/packages/embeddedci-mcp/tests/tools_surface.json +++ b/packages/embeddedci-mcp/tests/tools_surface.json @@ -1875,6 +1875,37 @@ "default": null, "title": "Baud" }, + "bitrate": { + "anyOf": [ + { + "exclusiveMinimum": 0, + "maximum": 5000000, + "type": "number" + }, + { + "type": "null" + } + ], + "default": null, + "description": "can: nominal bit rate, bit/s.", + "title": "Bitrate" + }, + "can": { + "anyOf": [ + { + "description": "LA channel (1-14) the signal is wired to.", + "maximum": 14, + "minimum": 1, + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null, + "description": "can: the transceiver's RXD (or the controller's TX/RX).", + "title": "Can" + }, "capture": { "default": "last", "description": "last = decode the previous capture_la; new = capture first (needs samples/sample_rate_hz).", @@ -1885,6 +1916,25 @@ "title": "Capture", "type": "string" }, + "channels": { + "anyOf": [ + { + "items": { + "description": "LA channel (1-14) the signal is wired to.", + "maximum": 14, + "minimum": 1, + "type": "integer" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "description": "pwm: the channels to measure.", + "title": "Channels" + }, "cs": { "anyOf": [ { @@ -1900,6 +1950,21 @@ "default": null, "title": "Cs" }, + "data_bitrate": { + "anyOf": [ + { + "exclusiveMinimum": 0, + "maximum": 12000000, + "type": "number" + }, + { + "type": "null" + } + ], + "default": null, + "description": "can: CAN FD data bit rate, bit/s (left out: the nominal rate).", + "title": "Data Bitrate" + }, "dm": { "anyOf": [ { @@ -1980,12 +2045,45 @@ "default": null, "title": "Mosi" }, + "onewire": { + "anyOf": [ + { + "description": "LA channel (1-14) the signal is wired to.", + "maximum": 14, + "minimum": 1, + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null, + "description": "onewire: the bus line.", + "title": "Onewire" + }, + "pec": { + "default": "auto", + "description": "smbus/pmbus: auto = a trailing byte that matches is a PEC; on = every transaction ends in one.", + "enum": [ + "auto", + "on", + "off" + ], + "title": "Pec", + "type": "string" + }, "protocol": { "enum": [ "i2c", "uart", "spi", - "usb" + "usb", + "modbus", + "can", + "pwm", + "onewire", + "smbus", + "pmbus" ], "title": "Protocol", "type": "string" @@ -2005,6 +2103,21 @@ "default": null, "title": "Rx" }, + "sample_point": { + "anyOf": [ + { + "exclusiveMaximum": 1, + "exclusiveMinimum": 0, + "type": "number" + }, + { + "type": "null" + } + ], + "default": null, + "description": "can: where a bit is read, as a fraction of it (default 0.75).", + "title": "Sample Point" + }, "sample_rate_hz": { "default": 1000000, "exclusiveMinimum": 0, @@ -2074,6 +2187,22 @@ ], "title": "Speed", "type": "string" + }, + "tx": { + "anyOf": [ + { + "description": "LA channel (1-14) the signal is wired to.", + "maximum": 14, + "minimum": 1, + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null, + "description": "modbus: the other direction on a two-line tap (rx alone for an RS-485 receive output).", + "title": "Tx" } }, "required": [ diff --git a/packages/embeddedci/CHANGELOG.md b/packages/embeddedci/CHANGELOG.md index 7767c76..1b33606 100644 --- a/packages/embeddedci/CHANGELOG.md +++ b/packages/embeddedci/CHANGELOG.md @@ -10,6 +10,13 @@ Not released yet. bit stuffing and PID checks flagged per packet, transactions (token, data, handshake, repeated NAKs merged) and control transfers with the SETUP request and the descriptors read back decoded. Returns a `UsbDecode`; locked to the server's decoder by shared vectors. +- **Five more LA decoders:** `modbus` (RTU on the UART decoder: request/response pairing, + function codes, registers and coils, exceptions, CRC), `can` (CAN 2.0 and ISO CAN FD from one + channel: bit stuffing, CRC15/17/21, BRS, ACK, error frames), `pwm` (per-period frequency, duty + and widths, summary, jitter, glitches, servo pulses), `onewire` (reset/presence, overdrive, + ROM commands and search, CRC8, scratchpad temperature) and `smbus`/`pmbus` (SMBus protocols, + PEC, PMBus command names, LINEAR11/LINEAR16 values, status bits). All locked to the server's + decoders by shared vectors. - **`la_pins` reads a long listing in pages.** On firmware with the `la_pins_paged` feature (features table revision 12), a reply that cannot carry every pin says `next`; the SDK asks diff --git a/packages/embeddedci/README.md b/packages/embeddedci/README.md index f5bc57e..d847b3f 100644 --- a/packages/embeddedci/README.md +++ b/packages/embeddedci/README.md @@ -1969,6 +1969,20 @@ about 0.44 times the returned rate. descriptors read back decoded). Tap D+ and D- on two LA channels at the 3.3 V I/O level. Full speed needs `sample_rate_hz=48_000_000`; low speed decodes from 6 MS/s. High speed is not visible to the LA. `decode.decode_usb(words, dp=, dm=, sample_rate_hz=)` decodes raw words. +* More protocols through the same `bp.decode` / `LaCapture.decode`: + + | Protocol | Arguments | Result | + |---|---|---| + | `modbus` (RTU) | `rx`, `baud`; optional `tx` (two-line tap), `data_bits`, `parity` (default `even`), `stop_bits` | `ModbusFrame` list: `role` (request/response), `addr`, `function_name`, `start`, `quantity`, `values`, `exception`, `summary`, `reply_to`, `response_us`, CRC checked | + | `can` (CAN, CAN FD) | `can` (the transceiver's RXD), `bitrate`; optional `data_bitrate`, `sample_point`, `data_sample_point` | `CanFrame` list: `id_hex`, `extended`, `fd`, `brs`, `dlc`, `len`, `data_hex`, `ack`, `kind` (data/remote/error), CRC and stuffing checked | + | `pwm` | `channels` | `PwmDecode`: per channel `periods` (period, frequency, high, low, duty), `freq_hz` / `duty` / `high_us` min, max, mean, `jitter_us`, `glitches`, `servo` | + | `onewire` | `onewire` | `OneWireTransaction` list: `reset`, `presence`, `overdrive`, `rom_command_name`, `rom`, `rom_crc_ok`, `function`, `bytes_hex`, `detail` (a temperature) | + | `smbus`, `pmbus` | `sda`, `scl`; optional `pec` (`auto`, `on`, `off`) | `SmbusTransaction` list: `kind`, `command`, `command_name`, `data_hex`, `value` (PMBus: volts, amps, status bits), `pec` | + + Rates: CAN needs 6 samples per data bit (2 Mbit/s data: 12 MS/s), 1-Wire 1 MS/s (4 MS/s in + overdrive). The modules `modbus_decode`, `can_decode`, `pwm_decode`, `onewire_decode` and + `smbus_decode` hold the classes and the checksums (`modbus_crc`, `can_crc`, `crc8`, `pec8`, + `linear11`). | `Capture` | `LaCapture` | |---|---| diff --git a/packages/embeddedci/src/embeddedci/benchpod/_gojson.py b/packages/embeddedci/src/embeddedci/benchpod/_gojson.py new file mode 100644 index 0000000..3b14c89 --- /dev/null +++ b/packages/embeddedci/src/embeddedci/benchpod/_gojson.py @@ -0,0 +1,28 @@ +"""Dataclasses to dicts in the shape the server's Go decoders put on the wire (``omitempty``).""" + +from __future__ import annotations + +import dataclasses +from typing import Any, Iterable + + +def go_dict(obj: Any, omit_empty: Iterable[str] = (), omit_none: Iterable[str] = ()) -> dict: + """``obj``'s public fields; ``omit_empty`` fields are left out when empty or zero (Go's + ``omitempty`` on a value), ``omit_none`` ones when ``None`` (``omitempty`` on a pointer).""" + out = {} + empty, none = set(omit_empty), set(omit_none) + for f in dataclasses.fields(obj): + if f.name.startswith("_"): + continue + v = getattr(obj, f.name) + if f.name in none and v is None: + continue + if f.name in empty and (v is None or v == "" or v == 0 or v == [] or v is False): + continue + if dataclasses.is_dataclass(v): + v = v.as_dict() if hasattr(v, "as_dict") else dataclasses.asdict(v) + elif isinstance(v, list): + v = [x.as_dict() if hasattr(x, "as_dict") else (dataclasses.asdict(x) if dataclasses.is_dataclass(x) else x) + for x in v] + out[f.name] = v + return out diff --git a/packages/embeddedci/src/embeddedci/benchpod/can_decode.py b/packages/embeddedci/src/embeddedci/benchpod/can_decode.py new file mode 100644 index 0000000..3e069b5 --- /dev/null +++ b/packages/embeddedci/src/embeddedci/benchpod/can_decode.py @@ -0,0 +1,326 @@ +"""CAN 2.0 and ISO CAN FD decoding from one LA channel (the transceiver's RXD, low = dominant). + +The Python mirror of the EmbeddedCI server's ``decode/can.go`` (held to it by +``can_decode_vectors.json``). Bits are sampled at the sample point and re-synchronized on edges +near a bit boundary; a frame starts on a falling edge after 10 or more recessive bits. Dynamic +stuffing runs from SOF through the data field (classic: through the CRC); CAN FD switches to the +data bit rate at the BRS sample point and back at the CRC delimiter's, and its CRC17/CRC21 covers +the dynamic stuff bits and the stuff count (ISO 11898-1:2015). +""" + +from __future__ import annotations + +import bisect +import math +from dataclasses import dataclass +from typing import List, Sequence + +from ._gojson import go_dict + +FD_LEN = (0, 1, 2, 3, 4, 5, 6, 7, 8, 12, 16, 20, 24, 32, 48, 64) + + +@dataclass +class CanFrame: + """One frame; ``kind`` is ``data``, ``remote`` or ``error``.""" + + index: int + start_us: float + end_us: float + kind: str = "data" + id: int = 0 + id_hex: str = "" + extended: bool = False + fd: bool = False + brs: bool = False + esi: bool = False + dlc: int = 0 + len: int = 0 + data_hex: str = "" + crc: str = "" + ack: bool = False + stuff_bits: int = 0 + ok: bool = False + error: str = "" + + def as_dict(self) -> dict: + return go_dict(self, omit_empty=("error",)) + + +def _join(a: str, b: str) -> str: + return b if not a else f"{a}, {b}" + + +class _Reader: + def __init__(self, line, edges, pos, spb, sp): + self.line, self.edges, self.pos, self.spb, self.sp = line, edges, pos, spb, sp + self.n = len(line) + self.ended = False + self.last_sp = 0.0 + + def bit(self) -> int: + win = 0.35 * self.spb + k = bisect.bisect_left(self.edges, int(math.ceil(self.pos - win))) + if k < len(self.edges) and self.edges[k] <= self.pos + win: + self.pos = float(self.edges[k]) + s = self.pos + self.sp * self.spb + self.last_sp = s + idx = int(s) + if idx >= self.n: + self.ended = True + return 1 + self.pos += self.spb + return self.line[idx] + + def switch_rate(self, spb: float, sp: float) -> None: + self.pos = self.last_sp + (1 - sp) * spb + self.spb, self.sp = spb, sp + + +class _Stuffed: + def __init__(self, r: _Reader): + self.r = r + self.raw: List[int] = [] + self.bits: List[int] = [] + self.run = 0 + self.last = 0 + self.stuffed = 0 + self.err = "" + + def raw_bit(self) -> int: + b = self.r.bit() + if self.raw and b == self.last: + self.run += 1 + else: + self.run = 1 + self.last = b + self.raw.append(b) + return b + + def get(self) -> int: + b = self.raw_bit() + if self.run == 6: + self.err = "stuff error" + self.bits.append(b) + if self.run == 5: + s = self.raw_bit() + if self.run == 6: + self.err = "stuff error" + self.stuffed += 1 + self.run = 1 + self.last = s + return b + + def field(self, n: int) -> int: + v = 0 + k = 0 + while k < n and not self.err and not self.r.ended: + v = v << 1 | self.get() + k += 1 + return v + + +def can_crc(bits: Sequence[int], width: int, poly: int, init: int) -> int: + """The CAN CRC of ``bits``: CRC15 (0x4599, init 0), CRC17 (0x1685B, init 1<<16), CRC21 + (0x102899, init 1<<20).""" + crc = init + top = 1 << (width - 1) + mask = (1 << width) - 1 + for b in bits: + nxt = b ^ ((crc & top) >> (width - 1)) + crc = (crc << 1) & mask + if nxt: + crc ^= poly + return crc + + +def stuff_count(n: int) -> List[int]: + """The FD stuff count field: Gray code of n mod 8, then even parity.""" + g = (n % 8) ^ ((n % 8) >> 1) + b = [g >> 2 & 1, g >> 1 & 1, g & 1] + return b + [(b[0] + b[1] + b[2]) & 1] + + +def decode_can(words: Sequence[int], *, can: int, sample_rate_hz: float, bitrate: float, + data_bitrate: float = 0.0, sample_point: float = 0.0, + data_sample_point: float = 0.0) -> List[CanFrame]: + """Decode CAN on channel ``can``. ``data_bitrate`` is the CAN FD data rate (0: nominal); + sample points are fractions of a bit (0: 0.75).""" + if not 1 <= can <= 14: + raise ValueError("can decode needs a channel in 1..14") + if sample_rate_hz <= 0 or bitrate <= 0: + raise ValueError("can decode needs a positive sample rate and bit rate") + if data_bitrate <= 0: + data_bitrate = bitrate + if not 0 < sample_point < 1: + sample_point = 0.75 + if not 0 < data_sample_point < 1: + data_sample_point = 0.75 + spb_n, spb_d = sample_rate_hz / bitrate, sample_rate_hz / data_bitrate + top = max(bitrate, data_bitrate) + if sample_rate_hz / top < 4: + raise ValueError(f"sample rate {sample_rate_hz:.0f} Hz is too low for {top:.0f} bit/s CAN: " + f"capture at {6 * top:.0f} S/s or more") + bit = can - 1 + line = [(w >> bit) & 1 for w in words] + edges = [i for i in range(1, len(line)) if line[i] != line[i - 1]] + us = 1e6 / sample_rate_hz + out: List[CanFrame] = [] + idle_need = 10 * spb_n + last_rec = 0.0 + if line and line[0] == 0: + last_rec = math.inf + k = 0 + while k < len(edges): + e = edges[k] + if line[e] == 1: + last_rec = float(e) + k += 1 + continue + idle = e - last_rec + if not (idle >= idle_need or (last_rec == 0 and idle >= 2 * spb_n)): + k += 1 + continue + r = _Reader(line, edges, float(e), spb_n, sample_point) + f = _frame(r, spb_n, spb_d, sample_point, data_sample_point) + f.start_us = e * us + f.end_us = r.pos * us + f.index = len(out) + 1 + out.append(f) + while k + 1 < len(edges) and edges[k + 1] < r.pos - 0.5 * spb_n: + k += 1 + last_rec = float(edges[k]) if line[edges[k]] == 1 else math.inf + k += 1 + return out + + +def _hex(b) -> str: + return " ".join(f"{v:02X}" for v in b) + + +def _frame(r: _Reader, spb_n, spb_d, sp_n, sp_d) -> CanFrame: + c = _Stuffed(r) + f = CanFrame(0, 0.0, 0.0) + + def fail(msg: str) -> CanFrame: + f.ok = False + f.error = msg + if msg == "stuff error" and c.last == 0: + while c.r.bit() == 0 and not c.r.ended: + pass + f.kind = "error" + f.error = "stuff error, error frame" + f.stuff_bits = c.stuffed + return f + + def end() -> bool: + return bool(c.err) or r.ended + + def why() -> str: + return c.err or "capture ended inside the frame" + + c.field(1) + ident = c.field(11) + b1 = c.field(1) + ide = c.field(1) + rtr = False + if ide == 0: + f.id = ident + f.id_hex = f"0x{ident:03X}" + if c.field(1) == 1: + f.fd = True + else: + rtr = b1 == 1 + else: + f.extended = True + ext = c.field(18) + f.id = ident << 18 | ext + f.id_hex = f"0x{f.id:08X}" + b2 = c.field(1) + if c.field(1) == 1: + f.fd = True + else: + rtr = b2 == 1 + c.field(1) + if end(): + return fail(why()) + if f.fd: + c.field(1) + f.brs = c.field(1) == 1 + if f.brs: + r.switch_rate(spb_d, sp_d) + f.esi = c.field(1) == 1 + f.dlc = c.field(4) + if end(): + return fail(why()) + f.len = FD_LEN[f.dlc] if f.fd else min(f.dlc, 8) + if rtr: + f.kind = "remote" + f.len = 0 + data = [] + for _ in range(f.len): + if end(): + break + data.append(c.field(8)) + if end(): + return fail(why()) + f.data_hex = _hex(data) + if not f.fd: + want = can_crc(c.bits, 15, 0x4599, 0) + got = c.field(15) + if end(): + return fail(why()) + f.crc = f"0x{got:04X}" + crc_ok = got == want + else: + covered = list(c.raw) + width, poly, init = (21, 0x102899, 1 << 20) if f.len > 16 else (17, 0x1685B, 1 << 16) + prev = c.raw[-1] + seq: List[int] = [] + fixed_err = False + for k in range(4 + width): + if r.ended: + break + if k % 4 == 0: + fsb = r.bit() + if fsb == prev: + fixed_err = True + prev = fsb + b = r.bit() + seq.append(b) + prev = b + if r.ended: + return fail(why()) + sc = seq[:4] + got = 0 + for b in seq[4:]: + got = got << 1 | b + f.crc = f"0x{got:06X}" + want = can_crc(covered + sc, width, poly, init) + crc_ok = got == want + if fixed_err: + f.error = _join(f.error, "fixed stuff bit") + if sc != stuff_count(c.stuffed): + f.error = _join(f.error, "bad stuff count") + f.stuff_bits = c.stuffed + if not crc_ok: + f.error = _join(f.error, "bad CRC") + if r.bit() != 1: + f.error = _join(f.error, "CRC delimiter dominant") + if f.brs: + r.switch_rate(spb_n, sp_n) + f.ack = r.bit() == 0 + if r.bit() != 1: + f.error = _join(f.error, "ACK delimiter dominant") + for _ in range(7): + if r.ended: + break + if r.bit() != 1: + f.error = _join(f.error, "EOF dominant") + break + if r.ended: + f.error = _join(f.error, "capture ended inside the frame") + if not f.ack: + f.error = _join(f.error, "no ACK") + f.ok = not f.error + return f diff --git a/packages/embeddedci/src/embeddedci/benchpod/client.py b/packages/embeddedci/src/embeddedci/benchpod/client.py index b134f7c..6c92874 100644 --- a/packages/embeddedci/src/embeddedci/benchpod/client.py +++ b/packages/embeddedci/src/embeddedci/benchpod/client.py @@ -2806,12 +2806,15 @@ def _resolve_trigger(self, trigger: Optional[Trigger]) -> Optional[Trigger]: def decode(self, source: Union[LaCapture, Sequence[int]], protocol: DecodeProtocol = "i2c", *, sample_rate_hz: Optional[float] = None, **channels: Any) -> Any: - """Decode ``i2c``/``uart``/``spi``/``usb`` from an LA capture (or raw 14-bit words) off-device. + """Decode a protocol from an LA capture (or raw 14-bit words) off-device. Channels by protocol: i2c ``sda``, ``scl``; uart ``rx``, ``baud``; spi ``sclk`` (+ ``mosi``, - ``miso``, ``cs``, ``mode``); usb ``dp``, ``dm`` (+ ``speed``). I2C, UART and SPI return a - list; USB returns a :class:`~embeddedci.benchpod.usb_decode.UsbDecode` (packets, - transactions, control transfers). See :func:`embeddedci.benchpod.decode.decode`. + ``miso``, ``cs``, ``mode``); usb ``dp``, ``dm`` (+ ``speed``); modbus ``rx``, ``baud`` (+ + ``tx``); can ``can``, ``bitrate`` (+ ``data_bitrate``, ``sample_point``); pwm ``channels``; + onewire ``onewire``; smbus / pmbus ``sda``, ``scl`` (+ ``pec``). USB returns a + :class:`~embeddedci.benchpod.usb_decode.UsbDecode`, PWM a + :class:`~embeddedci.benchpod.pwm_decode.PwmDecode`, the others a list. See + :func:`embeddedci.benchpod.decode.decode`. """ from . import decode as _decode diff --git a/packages/embeddedci/src/embeddedci/benchpod/constants.py b/packages/embeddedci/src/embeddedci/benchpod/constants.py index c1840af..8f2db71 100644 --- a/packages/embeddedci/src/embeddedci/benchpod/constants.py +++ b/packages/embeddedci/src/embeddedci/benchpod/constants.py @@ -119,7 +119,7 @@ class Pin(IntEnum): #: Where the in-fabric control loop takes its input from. LoopSource = Literal["adc", "fixed", "sweep"] #: Protocols the off-device LA decoder understands. -DecodeProtocol = Literal["i2c", "uart", "spi", "usb"] +DecodeProtocol = Literal["i2c", "uart", "spi", "usb", "modbus", "can", "pwm", "onewire", "smbus", "pmbus"] #: FDCAN operating mode; ``internal``/``external`` are loopbacks for a lone pod. CanMode = Literal["normal", "internal", "external", "listen"] #: A fault spliced into a replayed waveform. diff --git a/packages/embeddedci/src/embeddedci/benchpod/decode.py b/packages/embeddedci/src/embeddedci/benchpod/decode.py index 918de46..055cbde 100644 --- a/packages/embeddedci/src/embeddedci/benchpod/decode.py +++ b/packages/embeddedci/src/embeddedci/benchpod/decode.py @@ -250,6 +250,14 @@ def decode(words: Sequence[int], protocol: str = "i2c", *, sample_rate_hz: float * spi: ``sclk`` (+ ``mosi``, ``miso``, ``cs``, ``mode``, ``bits``, ``msb_first``) → list of :class:`SpiFrame` * usb: ``dp``, ``dm`` (+ ``speed`` ``full``/``low``/``auto``) → :class:`UsbDecode` (packets, transactions, control transfers) + * modbus: ``rx``, ``baud`` (+ ``tx``, ``data_bits``, ``parity`` (default even), ``stop_bits``) + → list of :class:`~embeddedci.benchpod.modbus_decode.ModbusFrame` + * can: ``can``, ``bitrate`` (+ ``data_bitrate``, ``sample_point``, ``data_sample_point``) → + list of :class:`~embeddedci.benchpod.can_decode.CanFrame` + * pwm: ``channels`` → :class:`~embeddedci.benchpod.pwm_decode.PwmDecode` + * onewire: ``onewire`` → list of :class:`~embeddedci.benchpod.onewire_decode.OneWireTransaction` + * smbus / pmbus: ``sda``, ``scl`` (+ ``pec`` ``auto``/``on``/``off``) → list of + :class:`~embeddedci.benchpod.smbus_decode.SmbusTransaction` """ proto = (protocol or "").lower() if proto == "i2c": @@ -260,4 +268,20 @@ def decode(words: Sequence[int], protocol: str = "i2c", *, sample_rate_hz: float return decode_spi(words, sample_rate_hz=sample_rate_hz, **channels) if proto == "usb": return decode_usb(words, sample_rate_hz=sample_rate_hz, **channels) - raise ValueError(f"unsupported protocol {protocol!r} (supported: i2c, uart, spi, usb)") + if proto == "modbus": + from .modbus_decode import decode_modbus + return decode_modbus(words, sample_rate_hz=sample_rate_hz, **channels) + if proto == "can": + from .can_decode import decode_can + return decode_can(words, sample_rate_hz=sample_rate_hz, **channels) + if proto == "pwm": + from .pwm_decode import decode_pwm + return decode_pwm(words, sample_rate_hz=sample_rate_hz, **channels) + if proto == "onewire": + from .onewire_decode import decode_onewire + return decode_onewire(words, sample_rate_hz=sample_rate_hz, **channels) + if proto in ("smbus", "pmbus"): + from .smbus_decode import decode_smbus + return decode_smbus(words, sample_rate_hz=sample_rate_hz, pmbus=proto == "pmbus", **channels) + raise ValueError(f"unsupported protocol {protocol!r} " + "(supported: i2c, uart, spi, usb, modbus, can, pwm, onewire, smbus, pmbus)") diff --git a/packages/embeddedci/src/embeddedci/benchpod/modbus_decode.py b/packages/embeddedci/src/embeddedci/benchpod/modbus_decode.py new file mode 100644 index 0000000..9325146 --- /dev/null +++ b/packages/embeddedci/src/embeddedci/benchpod/modbus_decode.py @@ -0,0 +1,277 @@ +"""Modbus RTU decoding on top of the UART decoder. + +The Python mirror of the EmbeddedCI server's ``decode/modbus.go`` (same fields, held to it by +``modbus_decode_vectors.json``). Bytes are split into frames on silence (2.5 character times; +1.25 ms above 19200 baud), then address, function, data and CRC16. A frame that answers the open +request to the same address with the same function (or bit 7 set: an exception) is its response. +""" + +from __future__ import annotations + +from dataclasses import dataclass, field +from typing import List, Optional, Sequence + +from ._gojson import go_dict +from .decode import decode_uart + +FUNCTIONS = { + 1: "READ_COILS", 2: "READ_DISCRETE_INPUTS", 3: "READ_HOLDING_REGISTERS", 4: "READ_INPUT_REGISTERS", + 5: "WRITE_SINGLE_COIL", 6: "WRITE_SINGLE_REGISTER", 7: "READ_EXCEPTION_STATUS", 8: "DIAGNOSTICS", + 11: "GET_COMM_EVENT_COUNTER", 12: "GET_COMM_EVENT_LOG", 15: "WRITE_MULTIPLE_COILS", + 16: "WRITE_MULTIPLE_REGISTERS", 17: "REPORT_SERVER_ID", 20: "READ_FILE_RECORD", 21: "WRITE_FILE_RECORD", + 22: "MASK_WRITE_REGISTER", 23: "READ_WRITE_MULTIPLE_REGISTERS", 24: "READ_FIFO_QUEUE", + 43: "ENCAPSULATED_INTERFACE", +} +EXCEPTIONS = { + 1: "ILLEGAL_FUNCTION", 2: "ILLEGAL_DATA_ADDRESS", 3: "ILLEGAL_DATA_VALUE", 4: "SERVER_DEVICE_FAILURE", + 5: "ACKNOWLEDGE", 6: "SERVER_DEVICE_BUSY", 8: "MEMORY_PARITY_ERROR", 10: "GATEWAY_PATH_UNAVAILABLE", + 11: "GATEWAY_TARGET_NO_RESPONSE", +} + + +@dataclass +class ModbusFrame: + """One RTU frame; ``role`` is ``request`` or ``response``.""" + + index: int + start_us: float + end_us: float + role: str = "" + addr: int = 0 + function: int = 0 + function_name: str = "" + exception: str = "" + start: Optional[int] = None + quantity: Optional[int] = None + values: List[int] = field(default_factory=list) + summary: str = "" + data_hex: str = "" + crc: str = "" + reply_to: int = 0 + response_us: float = 0.0 + ok: bool = True + error: str = "" + _body: bytes = field(default=b"", repr=False) + + def as_dict(self) -> dict: + return go_dict(self, omit_empty=("exception", "values", "reply_to", "response_us", "error"), + omit_none=("start", "quantity")) + + +def modbus_crc(b: bytes) -> int: + """The Modbus RTU CRC16 (reflected 0x8005, init 0xFFFF), sent low byte first.""" + crc = 0xFFFF + for v in b: + crc ^= v + for _ in range(8): + crc = (crc >> 1) ^ 0xA001 if crc & 1 else crc >> 1 + return crc + + +def _join(a: str, b: str) -> str: + return b if not a else f"{a}, {b}" + + +def _hex(b: bytes) -> str: + return " ".join(f"{v:02X}" for v in b) + + +def _func_name(fc: int) -> str: + if fc & 0x80: + return _func_name(fc & 0x7F) + " exception" + return FUNCTIONS.get(fc, f"function {fc}") + + +def decode_modbus(words: Sequence[int], *, rx: int, baud: float, sample_rate_hz: float, tx: int = 0, + data_bits: int = 8, parity: str = "even", stop_bits: float = 1.0) -> List[ModbusFrame]: + """Decode Modbus RTU from the UART line on ``rx`` (and ``tx`` for a full-duplex tap).""" + data_bits = data_bits or 8 + parity = parity or "even" + stop_bits = stop_bits if stop_bits and stop_bits > 0 else 1.0 + raw = [] # (value, start, end, error, line) + for i, ch in enumerate((rx, tx)): + if i == 1 and (ch == 0 or ch == rx): + continue + try: + frames = decode_uart(words, rx=ch, baud=baud, sample_rate_hz=sample_rate_hz, + data_bits=data_bits, parity=parity, stop_bits=stop_bits) + except ValueError as e: + raise ValueError(f"modbus: {e}") from None + raw.extend((f.value & 0xFF, f.start_us, f.end_us, f.error, i) for f in frames) + # One time order (stable, as the Go insertion sort). + raw.sort(key=lambda b: b[1]) + bits = 1 + data_bits + stop_bits + (1 if parity in ("even", "odd") else 0) + char_us = bits / baud * 1e6 + gap_us = 2.5 * char_us if baud <= 19200 else 1250.0 + out: List[ModbusFrame] = [] + cur: list = [] + for k, b in enumerate(raw): + if k > 0 and (b[4] != raw[k - 1][4] or b[1] - (raw[k - 1][2] + char_us / bits / 2) > gap_us): + out.append(_frame(cur, len(out) + 1)) + cur = [] + cur.append(b) + if cur: + out.append(_frame(cur, len(out) + 1)) + _pair(out) + return out + + +def _frame(bs: list, index: int) -> ModbusFrame: + f = ModbusFrame(index, bs[0][1], bs[-1][2]) + raw = bytes(b[0] for b in bs) + for b in bs: + if b[3] and not f.error: + f.error = "UART " + b[3] + if len(raw) < 4: + f.error = _join(f.error, f"too short: {len(raw)} bytes") + f.data_hex = _hex(raw) + f.addr = raw[0] if raw else 0 + f.function = raw[1] if len(raw) > 1 else 0 + f.function_name = _func_name(f.function) + f.ok = False + return f + f.addr, f.function = raw[0], raw[1] + body = raw[2:-2] + got = raw[-2] | raw[-1] << 8 + f.crc = f"0x{got:04X}" + if modbus_crc(raw[:-2]) != got: + f.error = _join(f.error, "bad CRC") + f.data_hex = _hex(body) + f._body = body + f.function_name = _func_name(f.function) + f.ok = not f.error + return f + + +def _looks_request(fc: int, b: bytes) -> bool: + if fc in (1, 2, 3, 4, 5, 6): + return len(b) == 4 + if fc in (15, 16): + return len(b) >= 5 and b[4] == len(b) - 5 + return False + + +def _looks_response(fc: int, b: bytes) -> bool: + if fc & 0x80: + return len(b) == 1 + if fc in (1, 2, 3, 4): + return len(b) >= 1 and b[0] == len(b) - 1 + if fc in (5, 6, 15, 16): + return len(b) == 4 + return False + + +def _pair(fr: List[ModbusFrame]) -> None: + open_ = -1 + for k, f in enumerate(fr): + body = f._body + is_resp = False + if open_ >= 0: + q = fr[open_] + if q.addr == f.addr and (q.function == f.function or q.function | 0x80 == f.function): + is_resp = True + if not is_resp and open_ < 0 and _looks_response(f.function, body) and not _looks_request(f.function, body): + is_resp = True + if is_resp: + f.role = "response" + if open_ >= 0: + f.reply_to = fr[open_].index + f.response_us = f.start_us - fr[open_].end_us + _decode(f, body, fr[open_]) + else: + _decode(f, body, None) + open_ = -1 + continue + f.role = "request" + _decode(f, body, None) + open_ = k if f.addr != 0 else -1 + + +def _be16(b: bytes, o: int) -> int: + return b[o] << 8 | b[o + 1] + + +def _values(v: List[int]) -> str: + if not v: + return "none" + parts = [str(x) for x in v[:32]] + if len(v) > 32: + parts.append(f"... ({len(v)} values)") + return " ".join(parts) + + +def _decode(f: ModbusFrame, b: bytes, req: Optional[ModbusFrame]) -> None: + if not f.crc: + f.summary = f.function_name + return + fc = f.function + if fc & 0x80: + if len(b) >= 1: + name = EXCEPTIONS.get(b[0], f"exception {b[0]}") + f.exception = name + f.summary = f"{_func_name(fc & 0x7F)}: {name}" + return + + def bad() -> None: + f.summary = f.function_name + f.error = _join(f.error, "bad length") + f.ok = False + + if f.role == "request" and 1 <= fc <= 4: + if len(b) != 4: + return bad() + f.start, f.quantity = _be16(b, 0), _be16(b, 2) + f.summary = f"{f.function_name} {f.start} x{f.quantity}" + elif f.role == "response" and 1 <= fc <= 4: + if len(b) < 1 or b[0] != len(b) - 1: + return bad() + data = b[1:] + if fc <= 2: + n = len(data) * 8 + if req is not None and req.quantity is not None and req.quantity <= n: + n = req.quantity + f.values = [(data[k // 8] >> (k % 8)) & 1 for k in range(n)] + else: + f.values = [_be16(data, o) for o in range(0, len(data) - 1, 2)] + if req is not None and req.start is not None: + f.start = req.start + f.summary = f"{f.function_name} {req.start}: {_values(f.values)}" + else: + f.summary = f"{f.function_name}: {_values(f.values)}" + elif fc == 5: + if len(b) != 4: + return bad() + v = _be16(b, 2) + f.start = _be16(b, 0) + state = "ON" + if v == 0: + state = "OFF" + elif v != 0xFF00: + state = f"0x{v:04X} (not ON or OFF)" + f.error = _join(f.error, "bad coil value") + f.ok = False + f.values = [1 if v == 0xFF00 else 0] + f.summary = f"{f.function_name} {f.start} {state}" + elif fc == 6: + if len(b) != 4: + return bad() + f.start = _be16(b, 0) + f.values = [_be16(b, 2)] + f.summary = f"{f.function_name} {f.start} = {f.values[0]}" + elif fc in (15, 16) and f.role == "request": + if len(b) < 5 or b[4] != len(b) - 5: + return bad() + f.start, f.quantity = _be16(b, 0), _be16(b, 2) + data = b[5:] + if fc == 15: + f.values = [(data[k // 8] >> (k % 8)) & 1 for k in range(f.quantity) if k // 8 < len(data)] + else: + f.values = [_be16(data, o) for o in range(0, len(data) - 1, 2)] + f.summary = f"{f.function_name} {f.start}: {_values(f.values)}" + elif fc in (15, 16) and f.role == "response": + if len(b) != 4: + return bad() + f.start, f.quantity = _be16(b, 0), _be16(b, 2) + f.summary = f"{f.function_name} {f.start} x{f.quantity} done" + else: + f.summary = f.function_name + (f" {f.data_hex}" if f.data_hex else "") diff --git a/packages/embeddedci/src/embeddedci/benchpod/onewire_decode.py b/packages/embeddedci/src/embeddedci/benchpod/onewire_decode.py new file mode 100644 index 0000000..c0e7f2a --- /dev/null +++ b/packages/embeddedci/src/embeddedci/benchpod/onewire_decode.py @@ -0,0 +1,218 @@ +"""1-Wire decoding from the bus line's low pulses. + +The Python mirror of the EmbeddedCI server's ``decode/onewire.go`` (held to it by +``onewire_decode_vectors.json``): resets (480 µs, overdrive 48-80 µs) and presence pulses, time +slots (a short low is a 1: under 15 µs, overdrive 2.5 µs), bytes LSB first, the ROM command and +ROM ID (READ/MATCH ROM, SEARCH ROM triplets) with its CRC8, then the function bytes; temperature +sensor commands are named and READ SCRATCHPAD gives the temperature. +""" + +from __future__ import annotations + +from dataclasses import dataclass +from typing import List, Optional, Sequence + +from ._gojson import go_dict + +ROM_COMMANDS = { + 0x33: "READ_ROM", 0x55: "MATCH_ROM", 0xCC: "SKIP_ROM", 0xF0: "SEARCH_ROM", 0xEC: "ALARM_SEARCH", + 0x3C: "OVERDRIVE_SKIP_ROM", 0x69: "OVERDRIVE_MATCH_ROM", 0xA5: "RESUME", +} +TEMP_FUNCTIONS = { + 0x44: "CONVERT_T", 0xBE: "READ_SCRATCHPAD", 0x4E: "WRITE_SCRATCHPAD", 0x48: "COPY_SCRATCHPAD", + 0xB8: "RECALL_E2", 0xB4: "READ_POWER_SUPPLY", +} +_TEMP_FAMILIES = {0x10, 0x22, 0x28, 0x3B, 0x42} + + +@dataclass +class OneWireTransaction: + """Everything from one reset to the next.""" + + index: int + start_us: float + end_us: float = 0.0 + reset: bool = False + presence: bool = False + overdrive: bool = False + rom_command: Optional[int] = None + rom_command_name: str = "" + rom: str = "" + rom_crc_ok: Optional[bool] = None + function: str = "" + bytes_hex: str = "" + detail: str = "" + ok: bool = True + error: str = "" + + def as_dict(self) -> dict: + return go_dict(self, omit_empty=("rom_command_name", "rom", "function", "detail", "error"), + omit_none=("rom_command", "rom_crc_ok")) + + +def crc8(b: bytes) -> int: + """The Maxim/Dallas CRC8 (x^8+x^5+x^4+1, reflected).""" + crc = 0 + for v in b: + for _ in range(8): + mix = (crc ^ v) & 1 + crc >>= 1 + if mix: + crc ^= 0x8C + v >>= 1 + return crc + + +def _join(a: str, b: str) -> str: + return b if not a else f"{a}, {b}" + + +def _hex(b) -> str: + return " ".join(f"{v:02X}" for v in b) + + +def decode_onewire(words: Sequence[int], *, onewire: int, sample_rate_hz: float) -> List[OneWireTransaction]: + """Decode the 1-Wire line on channel ``onewire``.""" + if not 1 <= onewire <= 14: + raise ValueError("1-wire decode needs a channel in 1..14") + if sample_rate_hz < 200e3: + raise ValueError(f"sample rate {sample_rate_hz:.0f} Hz is too low for 1-Wire: capture at 1 MS/s or " + "more (4 MS/s for overdrive)") + bit = onewire - 1 + us = 1e6 / sample_rate_hz + pulses = [] + start = -1 + for i, w in enumerate(words): + v = (w >> bit) & 1 + if v == 0 and start < 0: + start = i + if v == 1 and start >= 0: + if start > 0: + pulses.append((start * us, (i - start) * us)) + start = -1 + out: List[OneWireTransaction] = [] + st = {"od": False, "cur": None, "bits": [], "last_end": 0.0} + + def finish() -> None: + cur = st["cur"] + if cur is None: + return + _bytes(cur, st["bits"]) + cur.end_us = st["last_end"] + cur.index = len(out) + 1 + out.append(cur) + st["cur"], st["bits"] = None, [] + + k = 0 + while k < len(pulses): + ps, pd = pulses[k] + if pd >= 400 or (st["od"] and pd >= 40): + finish() + if pd >= 400: + st["od"] = False + cur = OneWireTransaction(0, ps, reset=True, overdrive=st["od"]) + st["cur"] = cur + st["last_end"] = ps + pd + wait, mn, mx = (10.0, 6.0, 40.0) if st["od"] else (70.0, 50.0, 300.0) + if k + 1 < len(pulses): + qs, qd = pulses[k + 1] + gap = qs - (ps + pd) + if 0 <= gap <= wait and mn <= qd <= mx: + cur.presence = True + st["last_end"] = qs + qd + k += 1 + k += 1 + continue + if st["cur"] is None: + st["cur"] = OneWireTransaction(0, ps, overdrive=st["od"]) + limit = 2.5 if st["od"] else 15.0 + st["bits"].append(1 if pd < limit else 0) + st["last_end"] = ps + pd + bits = st["bits"] + if not st["od"] and len(bits) == 8 and st["cur"].reset: + v = sum(bits[b] << b for b in range(8)) + if v in (0x3C, 0x69): + st["od"] = True + st["cur"].overdrive = True + k += 1 + finish() + return out + + +def _bytes(t: OneWireTransaction, bits: List[int]) -> None: + t.ok = True + pos = 0 + + def byte_at(): + nonlocal pos + if pos + 8 > len(bits): + return None + v = sum(bits[pos + b] << b for b in range(8)) + pos += 8 + return v + + if t.reset and not t.presence: + t.error = "no presence pulse" + family = -1 + if t.reset: + cmd = byte_at() + if cmd is not None: + t.rom_command = cmd + t.rom_command_name = ROM_COMMANDS.get(cmd, f"ROM command 0x{cmd:02X}") + rom: List[int] = [] + if cmd in (0x33, 0x55, 0x69): + for _ in range(8): + v = byte_at() + if v is None: + break + rom.append(v) + elif cmd in (0xF0, 0xEC): + ident = [0] * 8 + n = 0 + while n < 64 and pos + 3 <= len(bits): + b, nb, d = bits[pos], bits[pos + 1], bits[pos + 2] + pos += 3 + if b == 1 and nb == 1: + t.error = _join(t.error, "no device answered the search") + break + ident[n // 8] |= d << (n % 8) + n += 1 + if n == 64: + rom = ident + if len(rom) == 8: + t.rom = _hex(rom) + ok = crc8(bytes(rom[:7])) == rom[7] + t.rom_crc_ok = ok + if not ok: + t.error = _join(t.error, "bad ROM CRC") + family = rom[0] + elif cmd in (0x33, 0x55, 0x69, 0xF0, 0xEC): + t.error = _join(t.error, "ROM ID cut short") + fb: List[int] = [] + while True: + v = byte_at() + if v is None: + break + fb.append(v) + rest = len(bits) - pos + if rest > 0: + t.error = _join(t.error, f"{rest} bits left over") + t.bytes_hex = _hex(fb) + if fb and (family < 0 or family in _TEMP_FAMILIES): + name = TEMP_FUNCTIONS.get(fb[0]) + if name: + t.function = name + if fb[0] == 0xBE and len(fb) >= 10: + sp = fb[1:10] + crc_ok = crc8(bytes(sp[:8])) == sp[8] + raw = sp[1] << 8 | sp[0] + if raw >= 0x8000: + raw -= 0x10000 + c = raw / 2 if family == 0x10 else raw / 16 + t.detail = f"{c:.4g} °C" + if not crc_ok: + t.error = _join(t.error, "bad scratchpad CRC") + if not t.function and fb: + t.function = f"0x{fb[0]:02X}" + t.error = t.error.strip() + t.ok = not t.error diff --git a/packages/embeddedci/src/embeddedci/benchpod/pwm_decode.py b/packages/embeddedci/src/embeddedci/benchpod/pwm_decode.py new file mode 100644 index 0000000..1adf5e9 --- /dev/null +++ b/packages/embeddedci/src/embeddedci/benchpod/pwm_decode.py @@ -0,0 +1,158 @@ +"""PWM and pulse measurement: one row per period, and a summary per channel. + +The Python mirror of the EmbeddedCI server's ``decode/pwm.go`` (held to it by +``pwm_decode_vectors.json``). A period runs from a rising edge to the next. 1-2 sample pulses on a +signal whose typical pulse spans 20 samples or more are glitches, folded into the level around +them. A train of 0.4-2.6 ms pulses every 2.5-30 ms reads as a servo signal. +""" + +from __future__ import annotations + +import math +from dataclasses import dataclass, field +from typing import List, Optional, Sequence + +from ._gojson import go_dict + +MAX_PERIODS = 10000 + + +@dataclass +class PwmPeriod: + index: int + start_us: float + period_us: float + freq_hz: float + high_us: float + low_us: float + duty: float + + +@dataclass +class PwmStat: + min: float = 0.0 + max: float = 0.0 + mean: float = 0.0 + + +@dataclass +class PwmServo: + pulse_ms: PwmStat + position_pct: PwmStat + + +@dataclass +class PwmChannel: + channel: int + count: int = 0 + level: Optional[int] = None + freq_hz: PwmStat = field(default_factory=PwmStat) + period_us: PwmStat = field(default_factory=PwmStat) + duty: PwmStat = field(default_factory=PwmStat) + high_us: PwmStat = field(default_factory=PwmStat) + low_us: PwmStat = field(default_factory=PwmStat) + jitter_us: float = 0.0 + glitches: int = 0 + servo: Optional[PwmServo] = None + periods: List[PwmPeriod] = field(default_factory=list) + truncated: bool = False + + def as_dict(self) -> dict: + return go_dict(self, omit_none=("level", "servo")) + + +@dataclass +class PwmDecode: + """``channels``: one :class:`PwmChannel` per channel measured.""" + + channels: List[PwmChannel] = field(default_factory=list) + protocol: str = "pwm" + + def __len__(self) -> int: + return len(self.channels) + + def as_dict(self) -> dict: + return {"protocol": "pwm", "channels": [c.as_dict() for c in self.channels]} + + +def _stat(v: List[float]) -> PwmStat: + if not v: + return PwmStat() + s = 0.0 + for x in v: + s += x + return PwmStat(min(v), max(v), s / len(v)) + + +def decode_pwm(words: Sequence[int], *, channels: Sequence[int], sample_rate_hz: float) -> PwmDecode: + """Measure each of ``channels`` (1-based).""" + if not channels: + raise ValueError("pwm needs one or more channels in 1..14") + if sample_rate_hz <= 0: + raise ValueError("pwm needs a positive sample rate") + res = PwmDecode() + for ch in channels: + if not 1 <= ch <= 14: + raise ValueError(f"pwm channel {ch} is not in 1..14") + res.channels.append(_channel([(w >> (ch - 1)) & 1 for w in words], ch, sample_rate_hz)) + return res + + +def _channel(line: List[int], ch: int, rate: float) -> PwmChannel: + c = PwmChannel(ch) + runs: List[list] = [] # [level, start, n] + for i, v in enumerate(line): + if runs and runs[-1][0] == v: + runs[-1][2] += 1 + else: + runs.append([v, i, 1]) + if len(runs) > 2: + ns = sorted(r[2] for r in runs[1:-1]) + if ns[len(ns) // 2] >= 20: + out: List[list] = [] + k = 0 + while k < len(runs): + r = runs[k] + if r[2] <= 2 and out and k + 1 < len(runs): + c.glitches += 1 + out[-1][2] += r[2] + runs[k + 1][2] + k += 2 + continue + out.append(r) + k += 1 + runs = out + us = 1e6 / rate + per: List[float] = [] + hi: List[float] = [] + lo: List[float] = [] + duty: List[float] = [] + freq: List[float] = [] + for k in range(1, len(runs) - 1): + if runs[k][0] != 1 or runs[k + 1][0] != 0 or k + 2 >= len(runs): + continue + h = runs[k][2] * us + lw = runs[k + 1][2] * us + p = h + lw + per.append(p) + hi.append(h) + lo.append(lw) + duty.append(h / p) + freq.append(1e6 / p) + if len(c.periods) < MAX_PERIODS: + c.periods.append(PwmPeriod(len(c.periods) + 1, runs[k][1] * us, p, 1e6 / p, h, lw, h / p)) + else: + c.truncated = True + c.count = len(per) + if not per: + if line: + c.level = line[-1] + return c + c.period_us, c.high_us, c.low_us, c.duty, c.freq_hz = _stat(per), _stat(hi), _stat(lo), _stat(duty), _stat(freq) + sq = 0.0 + for p in per: + sq += (p - c.period_us.mean) * (p - c.period_us.mean) + c.jitter_us = math.sqrt(sq / len(per)) + if 2500 <= c.period_us.mean <= 30000 and c.high_us.min >= 400 and c.high_us.max <= 2600: + ms = [h / 1000 for h in hi] + c.servo = PwmServo(_stat(ms), _stat([(m - 1) * 100 for m in ms])) + return c diff --git a/packages/embeddedci/src/embeddedci/benchpod/results.py b/packages/embeddedci/src/embeddedci/benchpod/results.py index b5ea01e..c55cd45 100644 --- a/packages/embeddedci/src/embeddedci/benchpod/results.py +++ b/packages/embeddedci/src/embeddedci/benchpod/results.py @@ -351,7 +351,10 @@ def decode(self, protocol: str = "i2c", **channels): Examples: ``cap.decode("i2c", sda=2, scl=1)``, ``cap.decode("uart", rx=5, baud=115200)``, ``cap.decode("spi", sclk=1, mosi=2, miso=3, cs=4)``, - ``cap.decode("usb", dp=5, dm=6)`` (capture at 48 MS/s for full speed). + ``cap.decode("usb", dp=5, dm=6)`` (capture at 48 MS/s for full speed), + ``cap.decode("modbus", rx=5, baud=19200)``, ``cap.decode("can", can=4, bitrate=500_000)``, + ``cap.decode("pwm", channels=[1, 2])``, ``cap.decode("onewire", onewire=3)``, + ``cap.decode("pmbus", sda=2, scl=1)``. """ from .decode import decode as _decode diff --git a/packages/embeddedci/src/embeddedci/benchpod/smbus_decode.py b/packages/embeddedci/src/embeddedci/benchpod/smbus_decode.py new file mode 100644 index 0000000..723de84 --- /dev/null +++ b/packages/embeddedci/src/embeddedci/benchpod/smbus_decode.py @@ -0,0 +1,257 @@ +"""SMBus and PMBus decoding on top of the I2C decoder. + +The Python mirror of the EmbeddedCI server's ``decode/smbus.go`` (held to it by +``smbus_decode_vectors.json``). Each I2C transaction becomes an SMBus protocol (quick command, +send/receive byte, write/read byte or word, block write/read, process call) with its command and +data; a trailing PEC (CRC-8 0x07 over the address and data bytes) is checked. PMBus names the +command and decodes LINEAR11, LINEAR16 (with the exponent from the device's VOUT_MODE once one is +seen), status bits and text blocks. +""" + +from __future__ import annotations + +from dataclasses import dataclass +from typing import Dict, List, Optional, Sequence + +from ._gojson import go_dict +from .i2c import timed_transactions + +# command -> (name, format, unit); formats as in the Go decoder. +PMBUS_COMMANDS = { + 0x00: ("PAGE", "byte", ""), 0x01: ("OPERATION", "byte", ""), 0x02: ("ON_OFF_CONFIG", "byte", ""), + 0x03: ("CLEAR_FAULTS", "send", ""), 0x04: ("PHASE", "byte", ""), 0x10: ("WRITE_PROTECT", "byte", ""), + 0x11: ("STORE_DEFAULT_ALL", "send", ""), 0x12: ("RESTORE_DEFAULT_ALL", "send", ""), + 0x15: ("STORE_USER_ALL", "send", ""), 0x16: ("RESTORE_USER_ALL", "send", ""), + 0x19: ("CAPABILITY", "byte", ""), 0x1B: ("SMBALERT_MASK", "word", ""), + 0x20: ("VOUT_MODE", "vmode", ""), 0x21: ("VOUT_COMMAND", "L16", "V"), 0x22: ("VOUT_TRIM", "L16", "V"), + 0x23: ("VOUT_CAL_OFFSET", "L16", "V"), 0x24: ("VOUT_MAX", "L16", "V"), 0x25: ("VOUT_MARGIN_HIGH", "L16", "V"), + 0x26: ("VOUT_MARGIN_LOW", "L16", "V"), 0x27: ("VOUT_TRANSITION_RATE", "L11", "mV/µs"), + 0x28: ("VOUT_DROOP", "L11", "mΩ"), 0x29: ("VOUT_SCALE_LOOP", "L11", ""), 0x2A: ("VOUT_SCALE_MONITOR", "L11", ""), + 0x2B: ("VOUT_MIN", "L16", "V"), 0x31: ("POUT_MAX", "L11", "W"), 0x32: ("MAX_DUTY", "L11", "%"), + 0x33: ("FREQUENCY_SWITCH", "L11", "kHz"), 0x35: ("VIN_ON", "L11", "V"), 0x36: ("VIN_OFF", "L11", "V"), + 0x38: ("IOUT_CAL_GAIN", "L11", "mΩ"), 0x39: ("IOUT_CAL_OFFSET", "L11", "A"), + 0x40: ("VOUT_OV_FAULT_LIMIT", "L16", "V"), 0x41: ("VOUT_OV_FAULT_RESPONSE", "byte", ""), + 0x42: ("VOUT_OV_WARN_LIMIT", "L16", "V"), 0x43: ("VOUT_UV_WARN_LIMIT", "L16", "V"), + 0x44: ("VOUT_UV_FAULT_LIMIT", "L16", "V"), 0x45: ("VOUT_UV_FAULT_RESPONSE", "byte", ""), + 0x46: ("IOUT_OC_FAULT_LIMIT", "L11", "A"), 0x47: ("IOUT_OC_FAULT_RESPONSE", "byte", ""), + 0x4A: ("IOUT_OC_WARN_LIMIT", "L11", "A"), 0x4F: ("OT_FAULT_LIMIT", "L11", "°C"), + 0x50: ("OT_FAULT_RESPONSE", "byte", ""), 0x51: ("OT_WARN_LIMIT", "L11", "°C"), + 0x52: ("UT_WARN_LIMIT", "L11", "°C"), 0x53: ("UT_FAULT_LIMIT", "L11", "°C"), + 0x55: ("VIN_OV_FAULT_LIMIT", "L11", "V"), 0x57: ("VIN_OV_WARN_LIMIT", "L11", "V"), + 0x58: ("VIN_UV_WARN_LIMIT", "L11", "V"), 0x59: ("VIN_UV_FAULT_LIMIT", "L11", "V"), + 0x5B: ("IIN_OC_FAULT_LIMIT", "L11", "A"), 0x5D: ("IIN_OC_WARN_LIMIT", "L11", "A"), + 0x5E: ("POWER_GOOD_ON", "L16", "V"), 0x5F: ("POWER_GOOD_OFF", "L16", "V"), + 0x60: ("TON_DELAY", "L11", "ms"), 0x61: ("TON_RISE", "L11", "ms"), 0x62: ("TON_MAX_FAULT_LIMIT", "L11", "ms"), + 0x64: ("TOFF_DELAY", "L11", "ms"), 0x65: ("TOFF_FALL", "L11", "ms"), 0x66: ("TOFF_MAX_WARN_LIMIT", "L11", "ms"), + 0x6A: ("POUT_OP_WARN_LIMIT", "L11", "W"), 0x6B: ("PIN_OP_WARN_LIMIT", "L11", "W"), + 0x78: ("STATUS_BYTE", "sb", ""), 0x79: ("STATUS_WORD", "sw", ""), 0x7A: ("STATUS_VOUT", "bits", ""), + 0x7B: ("STATUS_IOUT", "bits", ""), 0x7C: ("STATUS_INPUT", "bits", ""), 0x7D: ("STATUS_TEMPERATURE", "bits", ""), + 0x7E: ("STATUS_CML", "bits", ""), 0x7F: ("STATUS_OTHER", "bits", ""), 0x80: ("STATUS_MFR_SPECIFIC", "bits", ""), + 0x81: ("STATUS_FANS_1_2", "bits", ""), 0x88: ("READ_VIN", "L11", "V"), 0x89: ("READ_IIN", "L11", "A"), + 0x8A: ("READ_VCAP", "L11", "V"), 0x8B: ("READ_VOUT", "L16", "V"), 0x8C: ("READ_IOUT", "L11", "A"), + 0x8D: ("READ_TEMPERATURE_1", "L11", "°C"), 0x8E: ("READ_TEMPERATURE_2", "L11", "°C"), + 0x8F: ("READ_TEMPERATURE_3", "L11", "°C"), 0x90: ("READ_FAN_SPEED_1", "L11", "RPM"), + 0x91: ("READ_FAN_SPEED_2", "L11", "RPM"), 0x94: ("READ_DUTY_CYCLE", "L11", "%"), + 0x95: ("READ_FREQUENCY", "L11", "kHz"), 0x96: ("READ_POUT", "L11", "W"), 0x97: ("READ_PIN", "L11", "W"), + 0x98: ("PMBUS_REVISION", "byte", ""), 0x99: ("MFR_ID", "block", ""), 0x9A: ("MFR_MODEL", "block", ""), + 0x9B: ("MFR_REVISION", "block", ""), 0x9C: ("MFR_LOCATION", "block", ""), 0x9D: ("MFR_DATE", "block", ""), + 0x9E: ("MFR_SERIAL", "block", ""), +} +_STATUS_LOW = ("NONE_OF_THE_ABOVE", "CML", "TEMPERATURE", "VIN_UV_FAULT", "IOUT_OC_FAULT", "VOUT_OV_FAULT", "OFF", "BUSY") +_STATUS_HIGH = ("UNKNOWN", "OTHER", "FANS", "POWER_GOOD#", "MFR_SPECIFIC", "INPUT", "IOUT/POUT", "VOUT") + + +@dataclass +class SmbusTransaction: + index: int + start_us: float + end_us: float + addr: int + addr_hex: str + kind: str = "" + command: Optional[int] = None + command_name: str = "" + data_hex: str = "" + value: str = "" + pec: str = "none" + ok: bool = True + error: str = "" + + def as_dict(self) -> dict: + return go_dict(self, omit_empty=("command_name", "value", "error"), omit_none=("command",)) + + +def pec8(b: bytes) -> int: + """The SMBus packet error code: CRC-8, polynomial 0x07, init 0.""" + crc = 0 + for v in b: + crc ^= v + for _ in range(8): + crc = ((crc << 1) ^ 0x07) & 0xFF if crc & 0x80 else (crc << 1) & 0xFF + return crc + + +def linear11(w: int) -> float: + """A PMBus LINEAR11 word's value.""" + exp = w >> 11 & 0x1F + if exp > 15: + exp -= 32 + man = w & 0x7FF + if man > 1023: + man -= 2048 + return man * 2.0 ** exp + + +def _join(a: str, b: str) -> str: + return b if not a else f"{a}, {b}" + + +def _hex(b) -> str: + return " ".join(f"{v:02X}" for v in b) + + +def _g4(v: float) -> str: + return f"{v:.4g}" + + +def decode_smbus(words: Sequence[int], *, sda: int, scl: int, sample_rate_hz: float, pmbus: bool = False, + pec: str = "auto") -> List[SmbusTransaction]: + """Decode SMBus (``pmbus=True``: PMBus) on ``sda``/``scl``. ``pec`` is ``auto`` (a trailing + byte that matches is a PEC), ``on`` or ``off``.""" + pec = pec or "auto" + if pec not in ("auto", "on", "off"): + raise ValueError(f"pec must be auto, on or off, got {pec!r}") + out: List[SmbusTransaction] = [] + vout_exp: Dict[int, int] = {} + for t in timed_transactions(words, sda, scl, sample_rate_hz): + msgs: List[dict] = [] + addr = -1 + segs = t["segments"] + for k, s in enumerate(segs): + typ = s["type"] + if typ.startswith("address"): + a = int(s["value"], 16) + if addr < 0: + addr = a + msgs.append({"read": typ == "address-read", "bytes": [], + "nack": k + 1 < len(segs) and segs[k + 1]["type"] == "nack"}) + elif typ.startswith("data") and msgs: + msgs[-1]["bytes"].append(int(s["value"], 16)) + if addr < 0: + continue + x = _read(msgs, addr, pec) + x.start_us, x.end_us = t["start_us"], t["end_us"] + if not t["ok"]: + x.error = _join((t.get("error_kind") or "").replace("-", " "), x.error) + if pmbus: + _value(x, vout_exp) + x.ok = not x.error + x.index = len(out) + 1 + out.append(x) + return out + + +def _read(msgs: List[dict], addr: int, pec: str) -> SmbusTransaction: + x = SmbusTransaction(0, 0.0, 0.0, addr, f"0x{addr:02X}") + covered: List[int] = [] + for m in msgs: + covered.append((addr << 1 | (1 if m["read"] else 0)) & 0xFF) + covered.extend(m["bytes"]) + if m["nack"] and not m["bytes"]: + x.kind = "address NACK" + return x + last = msgs[-1] + if pec != "off" and last["bytes"] and len(covered) >= 2: + match = pec8(bytes(covered[:-1])) == covered[-1] + total = sum(len(m["bytes"]) for m in msgs) + if pec == "on" or (match and total >= 2): + if match: + x.pec = "ok" + else: + x.pec = "bad" + x.error = "bad PEC" + last["bytes"] = last["bytes"][:-1] + if len(msgs) == 1 and not msgs[0]["bytes"]: + x.kind = "quick command (read)" if msgs[0]["read"] else "quick command" + elif len(msgs) == 1 and not msgs[0]["read"]: + w = msgs[0]["bytes"] + x.command = w[0] + d = w[1:] + if not d: + x.kind = "send byte" + elif len(d) == 1: + x.kind = "write byte" + elif len(d) == 2: + x.kind = "write word" + elif d[0] == len(d) - 1: + x.kind = "block write" + d = d[1:] + else: + x.kind = f"write {len(d)} bytes" + x.data_hex = _hex(d) + elif len(msgs) == 1: + r = msgs[0]["bytes"] + x.kind = f"read {len(r)} bytes" if len(r) > 1 else "receive byte" + x.data_hex = _hex(r) + elif len(msgs) == 2 and not msgs[0]["read"] and msgs[1]["read"] and msgs[0]["bytes"]: + x.command = msgs[0]["bytes"][0] + wd, r = msgs[0]["bytes"][1:], msgs[1]["bytes"] + if not wd and len(r) == 1: + x.kind = "read byte" + elif not wd and len(r) == 2: + x.kind = "read word" + elif not wd and r and r[0] == len(r) - 1: + x.kind = "block read" + r = r[1:] + elif not wd: + x.kind = f"read {len(r)} bytes" + elif len(wd) == 2 and len(r) == 2: + x.kind = "process call" + else: + x.kind = "block process call" + x.data_hex = _hex(r) + else: + x.kind = f"{len(msgs)} messages" + x.data_hex = _hex([b for m in msgs for b in m["bytes"]]) + return x + + +def _value(x: SmbusTransaction, vout_exp: Dict[int, int]) -> None: + if x.command is None: + return + c = PMBUS_COMMANDS.get(x.command) + if c is None: + if x.command >= 0xD0: + x.command_name = f"MFR_SPECIFIC_{x.command:02X}" + return + name, fmt, unit = c + x.command_name = name + d = [int(p, 16) for p in x.data_hex.split()] if x.data_hex else [] + word = d[0] | d[1] << 8 if len(d) == 2 else None + if fmt == "L11" and word is not None: + x.value = f"{_g4(linear11(word))} {unit}".strip() + elif fmt == "L16" and word is not None: + if x.addr in vout_exp: + x.value = f"{_g4(word * 2.0 ** vout_exp[x.addr])} V" + else: + x.value = f"0x{word:04X} (VOUT_MODE not seen)" + elif fmt == "vmode" and len(d) == 1: + mode = d[0] >> 5 + if mode == 0: + e = d[0] & 0x1F + if e > 15: + e -= 32 + vout_exp[x.addr] = e + x.value = f"linear, exponent {e}" + else: + x.value = f"mode {mode}" + elif fmt in ("sb", "sw"): + v = d[0] if d else 0 + if len(d) == 2 and fmt == "sw": + v |= d[1] << 8 + names = [(_STATUS_LOW[b] if b < 8 else _STATUS_HIGH[b - 8]) for b in range(16) if v & (1 << b)] + x.value = ", ".join(names) if names else "no faults" + elif fmt == "block": + if d and all(0x20 <= b <= 0x7E for b in d): + s = "".join(chr(b) for b in d) + x.value = '"' + s.replace("\\", "\\\\").replace('"', '\\"') + '"' diff --git a/packages/embeddedci/tests/api_surface.json b/packages/embeddedci/tests/api_surface.json index c5e60ac..ff766cb 100644 --- a/packages/embeddedci/tests/api_surface.json +++ b/packages/embeddedci/tests/api_surface.json @@ -472,7 +472,7 @@ "DacPinoutMismatchError": { "__init__": "(self, message: 'str', *, cmd: 'Optional[str]' = None, digital: 'str' = '', module: 'str' = '') -> 'None'" }, - "DecodeProtocol": "Literal['i2c', 'uart', 'spi', 'usb']", + "DecodeProtocol": "Literal['i2c', 'uart', 'spi', 'usb', 'modbus', 'can', 'pwm', 'onewire', 'smbus', 'pmbus']", "DefinitionError": { "__init__": "(self, message: 'str', *, path: 'Optional[str]' = None) -> 'None'" }, diff --git a/packages/embeddedci/tests/test_client_v2.py b/packages/embeddedci/tests/test_client_v2.py index 1b38c04..5106880 100644 --- a/packages/embeddedci/tests/test_client_v2.py +++ b/packages/embeddedci/tests/test_client_v2.py @@ -524,7 +524,7 @@ def test_command_needs_a_cmd(): def test_decode_rejects_unknown_protocol(): bp, _ = _bp() with pytest.raises(ValueError, match="protocol"): - bp.decode([0, 1], "can") # type: ignore[arg-type] + bp.decode([0, 1], "lin") # type: ignore[arg-type] def test_a_failed_status_read_does_not_cache_empty_capabilities(): diff --git a/packages/embeddedci/tests/test_la_decoders.py b/packages/embeddedci/tests/test_la_decoders.py new file mode 100644 index 0000000..b51d623 --- /dev/null +++ b/packages/embeddedci/tests/test_la_decoders.py @@ -0,0 +1,113 @@ +"""Modbus RTU, CAN / CAN FD, PWM, 1-Wire and SMBus/PMBus: Go<->Python parity and own checks. + +``tests/testdata/{modbus,can,pwm,onewire,smbus}_decode_vectors.json`` are byte-identical copies +of the EmbeddedCI server's ``testdata/shared`` files: synthetic captures as run-length edges, the +channels and options, and what the Go decoder returns. Python must decode them the same. +""" + +from __future__ import annotations + +import json +import math +from pathlib import Path + +import pytest + +from embeddedci.benchpod.can_decode import can_crc, stuff_count +from embeddedci.benchpod.decode import decode +from embeddedci.benchpod.modbus_decode import modbus_crc +from embeddedci.benchpod.onewire_decode import crc8 +from embeddedci.benchpod.smbus_decode import linear11, pec8 + +TESTDATA = Path(__file__).resolve().parent / "testdata" +NAMES = ["modbus", "can", "pwm", "onewire", "smbus"] +#: vector option names -> Python keyword names +KW = {"baud": "baud", "bitrate": "bitrate", "data_bitrate": "data_bitrate", "sample_point": "sample_point", + "data_sample_point": "data_sample_point", "channels": "channels", "pec": "pec"} + + +def _cases(): + for n in NAMES: + for c in json.loads((TESTDATA / f"{n}_decode_vectors.json").read_text())["cases"]: + yield pytest.param(c, id=f"{n}-{c['name']}") + + +def _words(case) -> list: + words = [0] * case["count"] + edges = case["edges"] + for k, (at, w) in enumerate(edges): + end = edges[k + 1][0] if k + 1 < len(edges) else case["count"] + words[at:end] = [w] * (end - at) + return words + + +def _close(a, b, path="") -> None: + if isinstance(b, dict): + assert isinstance(a, dict) and set(a) == set(b), f"{path}: keys {sorted(a)} != {sorted(b)}" + for k in b: + _close(a[k], b[k], f"{path}.{k}") + elif isinstance(b, list): + assert isinstance(a, list) and len(a) == len(b), f"{path}: {len(a) if isinstance(a, list) else a} items, want {len(b)}" + for k, (x, y) in enumerate(zip(a, b)): + _close(x, y, f"{path}[{k}]") + elif isinstance(b, (int, float)) and not isinstance(b, bool) and isinstance(a, (int, float)) and not isinstance(a, bool): + assert math.isclose(a, b, rel_tol=1e-9, abs_tol=1e-9), f"{path}: {a} != {b}" + else: + assert a == b, f"{path}: {a!r} != {b!r}" + + +def _as_go(proto: str, res): + if proto == "pwm": + return res.as_dict() + key = "frames" if proto in ("modbus", "can") else "transactions" + return {key: [x.as_dict() for x in res]} + + +@pytest.mark.parametrize("case", list(_cases())) +def test_go_parity(case): + kw = dict(case["channels"]) + kw.update({KW[k]: v for k, v in case["options"].items()}) + res = decode(_words(case), case["protocol"], sample_rate_hz=case["sample_rate_hz"], **kw) + got = _as_go(case["protocol"], res) + exp = dict(case["expect"]) + exp.pop("protocol", None) + got.pop("protocol", None) + _close(got, exp) + + +def test_checksums(): + f = bytes([0x11, 0x03, 0x00, 0x6B, 0x00, 0x03]) + assert modbus_crc(f) == 0x8776 + assert crc8(bytes([0x02, 0x1C, 0xB8, 0x01, 0x00, 0x00, 0x00])) == 0xA2 + assert pec8(b"123456789") == 0xF4 + assert linear11(0xD3E8) == 15.625 and linear11(0xFFFF) == -0.5 + assert can_crc([], 15, 0x4599, 0) == 0 and can_crc([1], 15, 0x4599, 0) == 0x4599 + assert stuff_count(3) == [0, 1, 0, 1] + + +def test_readable_results(): + cases = {c.values[0]["name"]: c.values[0] for c in _cases()} + mb = cases["rtu_19200_session"] + frames = decode(_words(mb), "modbus", sample_rate_hz=mb["sample_rate_hz"], rx=3, baud=19200) + assert frames[1].summary == "READ_HOLDING_REGISTERS 107: 555 0 100" and frames[1].reply_to == 1 + can = cases["fd_500k_2m_48msps"] + cf = decode(_words(can), "can", sample_rate_hz=can["sample_rate_hz"], can=4, bitrate=500e3, data_bitrate=2e6) + assert any(f.fd and f.brs and f.ok and f.len == 64 for f in cf) + assert any(f.kind == "error" for f in cf) + ow = cases["standard_and_overdrive_4msps"] + tx = decode(_words(ow), "onewire", sample_rate_hz=ow["sample_rate_hz"], onewire=6) + assert any(t.function == "READ_SCRATCHPAD" and t.detail == "21.5 °C" for t in tx) + pm = cases["pmbus_100k_1msps"] + st = decode(_words(pm), "pmbus", sample_rate_hz=pm["sample_rate_hz"], sda=1, scl=2) + assert [t.value for t in st[:2]] == ["linear, exponent -9", "3 V"] + + +@pytest.mark.parametrize("proto, kw, msg", [ + ("can", {"can": 1, "bitrate": 1e6}, "too low"), + ("pwm", {"channels": []}, "one or more"), + ("onewire", {"onewire": 1}, "too low"), + ("smbus", {"sda": 1, "scl": 2, "pec": "maybe"}, "auto, on or off"), +]) +def test_bad_arguments(proto, kw, msg): + with pytest.raises(ValueError, match=msg): + decode([1] * 100, proto, sample_rate_hz=100e3, **kw) diff --git a/packages/embeddedci/tests/testdata/can_decode_vectors.json b/packages/embeddedci/tests/testdata/can_decode_vectors.json new file mode 100644 index 0000000..093bb40 --- /dev/null +++ b/packages/embeddedci/tests/testdata/can_decode_vectors.json @@ -0,0 +1 @@ +{"_comment":"Shared can decode parity vectors: synthetic captures as run-length edges [sample, word] from sample 0, the channels and options, and what the Go decoder returns (the /analyzer/decode response without protocol). Verified by the Go server and the Python SDK.","cases":[{"name":"fd_500k_2m_48msps","protocol":"can","sample_rate_hz":48000000,"channels":{"can":4},"options":{"bitrate":500000,"data_bitrate":2000000},"count":88607,"edges":[[0,8],[1921,0],[2209,8],[2305,0],[2496,8],[2592,0],[2881,8],[3072,0],[3552,8],[3840,0],[4128,8],[4224,0],[4513,8],[4608,0],[4800,8],[4896,0],[5184,8],[5280,0],[5568,8],[5761,0],[5952,8],[6336,0],[6528,8],[6624,0],[6721,8],[7104,0],[7200,8],[7393,0],[7488,8],[7681,0],[7777,8],[8832,0],[8928,8],[9408,0],[9505,8],[9985,0],[10080,8],[10176,0],[10464,8],[10561,0],[11040,8],[11136,0],[11616,8],[11712,0],[12192,8],[12288,0],[12768,8],[12864,0],[13344,8],[13441,0],[13920,8],[14017,0],[14496,8],[14593,0],[15072,8],[15169,0],[15648,8],[15744,0],[16225,8],[16320,0],[16800,8],[16897,0],[17377,8],[17473,0],[17953,8],[18048,0],[18336,8],[18433,0],[18529,8],[18625,0],[18721,8],[18816,0],[19008,8],[19105,0],[19489,8],[19776,0],[19873,8],[20929,0],[21024,8],[21217,0],[21504,8],[21697,0],[21792,8],[21984,0],[22081,8],[22369,0],[22464,8],[22849,0],[23137,8],[23232,0],[23521,8],[23617,0],[24096,8],[24192,0],[24576,8],[24768,0],[25248,8],[25345,0],[25440,8],[25536,0],[25920,8],[26016,0],[26497,8],[26592,0],[27073,8],[27361,0],[27553,8],[27744,0],[27841,8],[28320,0],[28416,8],[28801,0],[28896,8],[28992,0],[29088,8],[30144,0],[30241,8],[30336,0],[30624,8],[30721,0],[30817,8],[30912,0],[31009,8],[31200,0],[31297,8],[31392,0],[31873,8],[31968,0],[32064,8],[32160,0],[32353,8],[32449,0],[32544,8],[32640,0],[32737,8],[32833,0],[32928,8],[33121,0],[33216,8],[33408,0],[33505,8],[33600,0],[33697,8],[34752,0],[35040,8],[35136,0],[35616,8],[35712,0],[36193,8],[36384,0],[36480,8],[36558,0],[36582,8],[36606,0],[36655,8],[36679,0],[36798,8],[36823,0],[36870,8],[36894,0],[37014,8],[37039,0],[37063,8],[37086,0],[37206,8],[37230,0],[37278,8],[37326,0],[37446,8],[37494,0],[37614,8],[37638,0],[37686,8],[37710,0],[37734,8],[37759,0],[37879,8],[37950,0],[38071,8],[38095,0],[38119,8],[38190,0],[38286,8],[38310,0],[38430,8],[38455,0],[38502,8],[38526,0],[38574,8],[38598,0],[38694,8],[38718,0],[38742,8],[38766,0],[38886,8],[38935,0],[38959,8],[39006,0],[39103,8],[39150,0],[39198,8],[39223,0],[39246,8],[39270,0],[39295,8],[39318,0],[39439,8],[39559,0],[39630,8],[39678,0],[39727,8],[39750,0],[39775,8],[39798,0],[39822,8],[39888,0],[39984,8],[41041,0],[41520,8],[41617,0],[42001,8],[42192,0],[42288,8],[42576,0],[42672,8],[42769,0],[42864,8],[43248,0],[43441,8],[43632,0],[43729,8],[44112,0],[44305,8],[44401,0],[44496,8],[44574,0],[44599,8],[44695,0],[44815,8],[44839,0],[44959,8],[44982,0],[45055,8],[45126,0],[45223,8],[45295,0],[45391,8],[45415,0],[45438,8],[45462,0],[45486,8],[45510,0],[45583,8],[45655,0],[45751,8],[45775,0],[45846,8],[45895,0],[45943,8],[45966,0],[45990,8],[46015,0],[46039,8],[46062,0],[46135,8],[46182,0],[46255,8],[46278,0],[46327,8],[46399,0],[46518,8],[46639,0],[46662,8],[46710,0],[46734,8],[46759,0],[46831,8],[46878,0],[46927,8],[46950,0],[46998,8],[47047,0],[47070,8],[47094,0],[47118,8],[47143,0],[47166,8],[47190,0],[47215,8],[47238,0],[47310,8],[47335,0],[47359,8],[47407,0],[47430,8],[47478,0],[47502,8],[47551,0],[47622,8],[47647,0],[47694,8],[47742,0],[47766,8],[47791,0],[47838,8],[47862,0],[47886,8],[47958,0],[48078,8],[48174,0],[48199,8],[48271,0],[48294,8],[48415,0],[48438,8],[48463,0],[48486,8],[48511,0],[48607,8],[48631,0],[48655,8],[48702,0],[48775,8],[48823,0],[48870,8],[48895,0],[48943,8],[48966,0],[49014,8],[49087,0],[49135,8],[49182,0],[49206,8],[49231,0],[49254,8],[49278,0],[49302,8],[49327,0],[49423,8],[49470,0],[49495,8],[49519,0],[49542,8],[49566,0],[49638,8],[49662,0],[49687,8],[49710,0],[49735,8],[49854,0],[49902,8],[49950,0],[49975,8],[50022,0],[50046,8],[50070,0],[50094,8],[50191,0],[50214,8],[50286,0],[50358,8],[50383,0],[50430,8],[50479,0],[50527,8],[50550,0],[50574,8],[50670,0],[50694,8],[50719,0],[50767,8],[50790,0],[50814,8],[50862,0],[50887,8],[50934,0],[50983,8],[51078,0],[51198,8],[51295,0],[51343,8],[51463,0],[51486,8],[51511,0],[51534,8],[51606,0],[51630,8],[51726,0],[51750,8],[51775,0],[51798,8],[51919,0],[51943,8],[51991,0],[52110,8],[52135,0],[52207,8],[52254,0],[52350,8],[52374,0],[52399,8],[52422,0],[52518,8],[52542,0],[52615,8],[52639,0],[52711,8],[52758,0],[52879,8],[52902,0],[52927,8],[53046,0],[53118,8],[53143,0],[53190,8],[53238,0],[53311,8],[53334,0],[53358,8],[53406,0],[53431,8],[53454,0],[53502,8],[53550,0],[53575,8],[53599,0],[53694,8],[53767,0],[53790,8],[53838,0],[53863,8],[53887,0],[53983,8],[54006,0],[54054,8],[54078,0],[54127,8],[54151,0],[54198,8],[54222,0],[54247,8],[54270,0],[54295,8],[54319,0],[54439,8],[54487,0],[54510,8],[54534,0],[54559,8],[54630,0],[54654,8],[54678,0],[54702,8],[54799,0],[54847,8],[54895,0],[54942,8],[54966,0],[54990,8],[55014,0],[55039,8],[55086,0],[55111,8],[55158,0],[55231,8],[55303,0],[55350,8],[55398,0],[55422,8],[55519,0],[55542,8],[55567,0],[55591,8],[55615,0],[55735,8],[55758,0],[55782,8],[55830,0],[55902,8],[55927,0],[55999,8],[56022,0],[56095,8],[56214,0],[56286,8],[56311,0],[56334,8],[56382,0],[56406,8],[56430,0],[56478,8],[56550,0],[56574,8],[56622,0],[56647,8],[56671,0],[56718,8],[56743,0],[56791,8],[56814,0],[56838,8],[56862,0],[56887,8],[56911,0],[56935,8],[57006,0],[57031,8],[57078,0],[57126,8],[57150,0],[57174,8],[57198,0],[57222,8],[57294,0],[57343,8],[57366,0],[57438,8],[57487,0],[57510,8],[57534,0],[57558,8],[57583,0],[57606,8],[57654,0],[57679,8],[57726,0],[57774,8],[57822,0],[57846,8],[57895,0],[57967,8],[58062,0],[58086,8],[58110,0],[58134,8],[58176,0],[58272,8],[59329,0],[59521,8],[59616,0],[60096,8],[60192,0],[60672,8],[60768,0],[60864,8],[60961,0],[61440,8],[61920,0],[62016,8],[62496,0],[62592,8],[63072,0],[63169,8],[63649,0],[63744,8],[64225,0],[64320,8],[64512,0],[64992,8],[65280,0],[65376,8],[65472,0],[65568,8],[65761,0],[65953,8],[66048,0],[66144,8],[66432,0],[66528,8],[66624,0],[66816,8],[66912,0],[67105,8],[67201,0],[67296,8],[68353,0],[68545,8],[68736,0],[68928,8],[69025,0],[69408,8],[69504,0],[69984,8],[70080,0],[70176,8],[70368,0],[70465,8],[70560,0],[70657,8],[70752,0],[70849,8],[70944,0],[71041,8],[71136,0],[71328,8],[71521,0],[71616,8],[71712,0],[72001,8],[72192,0],[72288,8],[72384,0],[72480,8],[73729,0],[74209,8],[74401,0],[74496,8],[74592,0],[74689,8],[74784,0],[74881,8],[74976,0],[75457,8],[75648,0],[76129,8],[76225,0],[76513,8],[76609,0],[77088,8],[77185,0],[77281,8],[77376,0],[77569,8],[77664,0],[77952,8],[78144,0],[78432,8],[78529,0],[78913,8],[79008,0],[79104,8],[80161,0],[80544,8],[80928,0],[81889,8],[82944,0],[83425,8],[83521,0],[84001,8],[84096,0],[84193,8],[84289,0],[84769,8],[84865,0],[84961,8],[85056,0],[85152,8],[85248,0],[85632,8],[85728,0],[85825,8],[85920,0],[86400,8],[86592,0],[86688,8],[86784,0],[87168,8],[87264,0],[87360,8],[87457,0],[87552,8]],"expect":{"frames":[{"index":1,"start_us":40.02083333333333,"end_us":178.02083333333331,"kind":"data","id":291,"id_hex":"0x123","extended":false,"fd":false,"brs":false,"esi":false,"dlc":3,"len":3,"data_hex":"11 22 33","crc":"0x65ED","ack":true,"stuff_bits":1,"ok":true},{"index":2,"start_us":184,"end_us":430.0208333333333,"kind":"data","id":2047,"id_hex":"0x7FF","extended":false,"fd":false,"brs":false,"esi":false,"dlc":8,"len":8,"data_hex":"00 00 00 00 00 00 00 00","crc":"0x2A43","ack":true,"stuff_bits":15,"ok":true},{"index":3,"start_us":436.0208333333333,"end_us":622,"kind":"data","id":417001744,"id_hex":"0x18DAF110","extended":true,"fd":false,"brs":false,"esi":false,"dlc":3,"len":3,"data_hex":"02 10 03","crc":"0x1BFE","ack":true,"stuff_bits":5,"ok":true},{"index":4,"start_us":628,"end_us":718.0208333333333,"kind":"remote","id":1110,"id_hex":"0x456","extended":false,"fd":false,"brs":false,"esi":false,"dlc":0,"len":0,"data_hex":"","crc":"0x4AB6","ack":true,"stuff_bits":1,"ok":true},{"index":5,"start_us":724,"end_us":849,"kind":"data","id":256,"id_hex":"0x100","extended":false,"fd":true,"brs":true,"esi":false,"dlc":9,"len":12,"data_hex":"01 02 03 04 05 06 07 08 09 0A 0B 0C","crc":"0x001E6B","ack":true,"stuff_bits":11,"ok":true},{"index":6,"start_us":855.0208333333333,"end_us":1230,"kind":"data","id":1752286,"id_hex":"0x001ABCDE","extended":true,"fd":true,"brs":true,"esi":false,"dlc":15,"len":64,"data_hex":"00 07 0E 15 1C 23 2A 31 38 3F 46 4D 54 5B 62 69 70 77 7E 85 8C 93 9A A1 A8 AF B6 BD C4 CB D2 D9 E0 E7 EE F5 FC 03 0A 11 18 1F 26 2D 34 3B 42 49 50 57 5E 65 6C 73 7A 81 88 8F 96 9D A4 AB B2 B9","crc":"0x156D1C","ack":true,"stuff_bits":17,"ok":true},{"index":7,"start_us":1236.0208333333333,"end_us":1418,"kind":"data","id":512,"id_hex":"0x200","extended":false,"fd":true,"brs":false,"esi":false,"dlc":3,"len":3,"data_hex":"FF FF FF","crc":"0x01B8F2","ack":true,"stuff_bits":8,"ok":true},{"index":8,"start_us":1424.0208333333333,"end_us":1530,"kind":"data","id":801,"id_hex":"0x321","extended":false,"fd":false,"brs":false,"esi":false,"dlc":1,"len":1,"data_hex":"AA","crc":"0x4D1A","ack":false,"stuff_bits":1,"ok":false,"error":"no ACK"},{"index":9,"start_us":1536.0208333333333,"end_us":1664,"kind":"data","id":85,"id_hex":"0x055","extended":false,"fd":false,"brs":false,"esi":false,"dlc":2,"len":2,"data_hex":"01 02","crc":"0x2310","ack":true,"stuff_bits":4,"ok":false,"error":"bad CRC"},{"index":10,"start_us":1670.0208333333333,"end_us":1708.0208333333333,"kind":"error","id":240,"id_hex":"0x0F0","extended":false,"fd":false,"brs":false,"esi":false,"dlc":0,"len":0,"data_hex":"","crc":"","ack":false,"stuff_bits":1,"ok":false,"error":"stuff error, error frame"},{"index":11,"start_us":1728,"end_us":1840,"kind":"data","id":1,"id_hex":"0x001","extended":false,"fd":false,"brs":false,"esi":false,"dlc":1,"len":1,"data_hex":"42","crc":"0x4142","ack":true,"stuff_bits":4,"ok":true}]}},{"name":"classic_125k_4msps","protocol":"can","sample_rate_hz":4000000,"channels":{"can":4},"options":{"bitrate":125000},"count":46431,"edges":[[0,8],[640,0],[736,8],[767,0],[832,8],[865,0],[961,8],[1024,0],[1184,8],[1280,0],[1376,8],[1409,0],[1505,8],[1536,0],[1600,8],[1633,0],[1729,8],[1760,0],[1855,8],[1920,0],[1985,8],[2112,0],[2176,8],[2208,0],[2240,8],[2368,0],[2401,8],[2465,0],[2496,8],[2560,0],[2592,8],[2945,0],[2976,8],[3136,0],[3168,8],[3329,0],[3361,8],[3393,0],[3488,8],[3520,0],[3680,8],[3712,0],[3872,8],[3904,0],[4064,8],[4096,0],[4255,8],[4288,0],[4448,8],[4481,0],[4640,8],[4672,0],[4832,8],[4864,0],[5023,8],[5057,0],[5216,8],[5248,0],[5407,8],[5441,0],[5600,8],[5632,0],[5793,8],[5825,0],[5984,8],[6016,0],[6112,8],[6145,0],[6176,8],[6209,0],[6240,8],[6272,0],[6337,8],[6368,0],[6495,8],[6593,0],[6624,8],[6976,0],[7008,8],[7072,0],[7168,8],[7233,0],[7265,8],[7329,0],[7361,8],[7456,0],[7489,8],[7616,0],[7713,8],[7743,0],[7840,8],[7872,0],[8032,8],[8064,0],[8193,8],[8256,0],[8416,8],[8449,0],[8481,8],[8512,0],[8640,8],[8672,0],[8832,8],[8865,0],[9024,8],[9121,0],[9185,8],[9247,0],[9280,8],[9441,0],[9473,8],[9601,0],[9633,8],[9665,0],[9697,8],[10048,0],[10079,8],[10112,0],[10209,8],[10240,0],[10272,8],[10305,0],[10336,8],[10400,0],[10433,8],[10464,0],[10624,8],[10657,0],[10687,8],[10720,0],[10785,8],[10816,0],[10849,8],[10879,0],[10912,8],[10945,0],[10977,8],[11040,0],[11072,8],[11137,0],[11168,8],[11200,0],[11233,8],[11584,0],[11681,8],[11712,0],[11872,8],[11904,0],[12063,8],[12128,0],[12160,8],[12192,0],[12224,8],[12257,0],[12321,8],[12353,0],[12511,8],[12544,0],[12609,8],[12640,0],[12800,8],[12832,0],[12865,8],[12896,0],[13056,8],[13089,0],[13151,8],[13217,0],[13376,8],[13441,0],[13600,8],[13632,0],[13697,8],[13727,0],[13761,8],[13792,0],[13952,8],[14048,0],[14209,8],[14240,0],[14272,8],[14369,0],[14496,8],[14527,0],[14689,8],[14720,0],[14784,8],[14816,0],[14881,8],[14912,0],[15040,8],[15071,0],[15105,8],[15136,0],[15296,8],[15361,0],[15392,8],[15456,0],[15584,8],[15649,0],[15712,8],[15744,0],[15775,8],[15808,0],[15841,8],[15872,0],[16033,8],[16192,0],[16287,8],[16352,0],[16417,8],[16448,0],[16480,8],[16513,0],[16544,8],[16608,0],[16641,8],[16993,0],[17152,8],[17185,0],[17312,8],[17377,0],[17408,8],[17504,0],[17537,8],[17567,0],[17599,8],[17729,0],[17792,8],[17857,0],[17888,8],[18017,0],[18081,8],[18112,0],[18145,8],[18176,0],[18208,8],[18336,0],[18496,8],[18529,0],[18687,8],[18719,0],[18817,8],[18912,0],[19040,8],[19137,0],[19264,8],[19296,0],[19328,8],[19360,0],[19393,8],[19424,0],[19521,8],[19616,0],[19745,8],[19775,0],[19873,8],[19936,0],[20001,8],[20032,0],[20064,8],[20097,0],[20128,8],[20160,0],[20256,8],[20321,0],[20416,8],[20447,0],[20512,8],[20609,0],[20768,8],[20928,0],[20961,8],[21024,0],[21056,8],[21089,0],[21185,8],[21248,0],[21311,8],[21345,0],[21409,8],[21472,0],[21505,8],[21535,0],[21569,8],[21599,0],[21632,8],[21664,0],[21696,8],[21729,0],[21824,8],[21856,0],[21889,8],[21951,0],[21984,8],[22048,0],[22080,8],[22144,0],[22240,8],[22272,0],[22337,8],[22401,0],[22432,8],[22464,0],[22529,8],[22561,0],[22593,8],[22688,0],[22847,8],[22976,0],[23008,8],[23105,0],[23136,8],[23297,0],[23329,8],[23361,0],[23393,8],[23425,0],[23553,8],[23585,0],[23616,8],[23680,0],[23777,8],[23840,0],[23904,8],[23937,0],[24001,8],[24033,0],[24096,8],[24193,0],[24255,8],[24320,0],[24352,8],[24384,0],[24416,8],[24447,0],[24481,8],[24512,0],[24641,8],[24703,0],[24736,8],[24768,0],[24800,8],[24833,0],[24928,8],[24960,0],[24993,8],[25024,0],[25057,8],[25216,0],[25280,8],[25344,0],[25375,8],[25441,0],[25471,8],[25505,0],[25537,8],[25665,0],[25696,8],[25791,0],[25889,8],[25921,0],[25983,8],[26049,0],[26112,8],[26145,0],[26177,8],[26304,0],[26337,8],[26369,0],[26432,8],[26465,0],[26497,8],[26560,0],[26592,8],[26656,0],[26721,8],[26849,0],[27008,8],[27136,0],[27201,8],[27360,0],[27392,8],[27423,0],[27457,8],[27553,0],[27584,8],[27713,0],[27744,8],[27776,0],[27808,8],[27968,0],[28001,8],[28064,0],[28224,8],[28255,0],[28352,8],[28416,0],[28544,8],[28577,0],[28608,8],[28639,0],[28769,8],[28800,0],[28897,8],[28928,0],[29025,8],[29088,0],[29248,8],[29279,0],[29312,8],[29472,0],[29569,8],[29599,0],[29664,8],[29729,0],[29825,8],[29857,0],[29889,8],[29953,0],[29984,8],[30016,0],[30080,8],[30144,0],[30177,8],[30208,0],[30337,8],[30433,0],[30463,8],[30528,0],[30560,8],[30592,0],[30720,8],[30752,0],[30817,8],[30849,0],[30911,8],[30944,0],[31008,8],[31041,0],[31073,8],[31105,0],[31136,8],[31168,0],[31328,8],[31392,0],[31424,8],[31455,0],[31487,8],[31584,0],[31617,8],[31649,0],[31680,8],[31807,0],[31872,8],[31937,0],[31999,8],[32033,0],[32065,8],[32095,0],[32128,8],[32193,0],[32224,8],[32288,0],[32385,8],[32481,0],[32545,8],[32609,0],[32640,8],[32768,0],[32801,8],[32833,0],[32864,8],[32895,0],[33057,8],[33088,0],[33120,8],[33185,0],[33281,8],[33312,0],[33408,8],[33441,0],[33537,8],[33697,0],[33792,8],[33825,0],[33856,8],[33921,0],[33953,8],[33983,0],[34048,8],[34145,0],[34176,8],[34240,0],[34273,8],[34305,0],[34369,8],[34400,0],[34465,8],[34497,0],[34528,8],[34561,0],[34592,8],[34624,0],[34657,8],[34752,0],[34784,8],[34848,0],[34913,8],[34945,0],[34976,8],[35008,0],[35040,8],[35137,0],[35201,8],[35232,0],[35328,8],[35391,0],[35424,8],[35456,0],[35488,8],[35521,0],[35553,8],[35617,0],[35648,8],[35713,0],[35776,8],[35840,0],[35873,8],[35936,0],[36032,8],[36160,0],[36192,8],[36225,0],[36257,8],[36289,0],[36320,8],[36672,0],[36736,8],[36768,0],[36928,8],[36961,0],[37119,8],[37153,0],[37184,8],[37216,0],[37376,8],[37536,0],[37569,8],[37728,0],[37761,8],[37920,0],[37952,8],[38112,0],[38145,8],[38304,0],[38337,8],[38401,0],[38560,8],[38656,0],[38689,8],[38720,0],[38753,8],[38816,0],[38881,8],[38912,0],[38944,8],[39040,0],[39072,8],[39105,0],[39168,8],[39200,0],[39265,8],[39296,0],[39328,8],[39680,0],[39745,8],[39809,0],[39872,8],[39905,0],[40032,8],[40064,0],[40225,8],[40257,0],[40288,8],[40352,0],[40384,8],[40417,0],[40447,8],[40480,0],[40512,8],[40545,0],[40576,8],[40608,0],[40672,8],[40736,0],[40768,8],[40801,0],[40895,8],[40961,0],[40993,8],[41025,0],[41056,8],[41472,0],[41633,8],[41696,0],[41728,8],[41760,0],[41792,8],[41824,0],[41856,8],[41889,0],[42049,8],[42112,0],[42272,8],[42305,0],[42400,8],[42432,0],[42593,8],[42625,0],[42657,8],[42688,0],[42753,8],[42784,0],[42881,8],[42943,0],[43040,8],[43073,0],[43200,8],[43233,0],[43264,8],[43617,0],[43744,8],[43873,0],[44192,8],[44544,0],[44704,8],[44737,0],[44896,8],[44928,0],[44961,8],[44993,0],[45153,8],[45184,0],[45217,8],[45248,0],[45281,8],[45313,0],[45441,8],[45472,0],[45505,8],[45537,0],[45697,8],[45761,0],[45792,8],[45823,0],[45953,8],[45984,0],[46017,8],[46049,0],[46081,8]],"expect":{"frames":[{"index":1,"start_us":160,"end_us":712,"kind":"data","id":291,"id_hex":"0x123","extended":false,"fd":false,"brs":false,"esi":false,"dlc":3,"len":3,"data_hex":"11 22 33","crc":"0x65ED","ack":true,"stuff_bits":1,"ok":true},{"index":2,"start_us":736.25,"end_us":1720,"kind":"data","id":2047,"id_hex":"0x7FF","extended":false,"fd":false,"brs":false,"esi":false,"dlc":8,"len":8,"data_hex":"00 00 00 00 00 00 00 00","crc":"0x2A43","ack":true,"stuff_bits":15,"ok":true},{"index":3,"start_us":1744,"end_us":2488.25,"kind":"data","id":417001744,"id_hex":"0x18DAF110","extended":true,"fd":false,"brs":false,"esi":false,"dlc":3,"len":3,"data_hex":"02 10 03","crc":"0x1BFE","ack":true,"stuff_bits":5,"ok":true},{"index":4,"start_us":2512,"end_us":2872.25,"kind":"remote","id":1110,"id_hex":"0x456","extended":false,"fd":false,"brs":false,"esi":false,"dlc":0,"len":0,"data_hex":"","crc":"0x4AB6","ack":true,"stuff_bits":1,"ok":true},{"index":5,"start_us":2896,"end_us":4224.25,"kind":"data","id":256,"id_hex":"0x100","extended":false,"fd":true,"brs":true,"esi":false,"dlc":9,"len":12,"data_hex":"01 02 03 04 05 06 07 08 09 0A 0B 0C","crc":"0x001E6B","ack":true,"stuff_bits":11,"ok":true},{"index":6,"start_us":4248.25,"end_us":9144,"kind":"data","id":1752286,"id_hex":"0x001ABCDE","extended":true,"fd":true,"brs":true,"esi":false,"dlc":15,"len":64,"data_hex":"00 07 0E 15 1C 23 2A 31 38 3F 46 4D 54 5B 62 69 70 77 7E 85 8C 93 9A A1 A8 AF B6 BD C4 CB D2 D9 E0 E7 EE F5 FC 03 0A 11 18 1F 26 2D 34 3B 42 49 50 57 5E 65 6C 73 7A 81 88 8F 96 9D A4 AB B2 B9","crc":"0x156D1C","ack":true,"stuff_bits":17,"ok":true},{"index":7,"start_us":9168,"end_us":9896,"kind":"data","id":512,"id_hex":"0x200","extended":false,"fd":true,"brs":false,"esi":false,"dlc":3,"len":3,"data_hex":"FF FF FF","crc":"0x01B8F2","ack":true,"stuff_bits":8,"ok":true},{"index":8,"start_us":9920,"end_us":10344,"kind":"data","id":801,"id_hex":"0x321","extended":false,"fd":false,"brs":false,"esi":false,"dlc":1,"len":1,"data_hex":"AA","crc":"0x4D1A","ack":false,"stuff_bits":1,"ok":false,"error":"no ACK"},{"index":9,"start_us":10368,"end_us":10880,"kind":"data","id":85,"id_hex":"0x055","extended":false,"fd":false,"brs":false,"esi":false,"dlc":2,"len":2,"data_hex":"01 02","crc":"0x2310","ack":true,"stuff_bits":4,"ok":false,"error":"bad CRC"},{"index":10,"start_us":10904.25,"end_us":11056,"kind":"error","id":240,"id_hex":"0x0F0","extended":false,"fd":false,"brs":false,"esi":false,"dlc":0,"len":0,"data_hex":"","crc":"","ack":false,"stuff_bits":1,"ok":false,"error":"stuff error, error frame"},{"index":11,"start_us":11136,"end_us":11584.25,"kind":"data","id":1,"id_hex":"0x001","extended":false,"fd":false,"brs":false,"esi":false,"dlc":1,"len":1,"data_hex":"42","crc":"0x4142","ack":true,"stuff_bits":4,"ok":true}]}}]} diff --git a/packages/embeddedci/tests/testdata/modbus_decode_vectors.json b/packages/embeddedci/tests/testdata/modbus_decode_vectors.json new file mode 100644 index 0000000..d45ef0d --- /dev/null +++ b/packages/embeddedci/tests/testdata/modbus_decode_vectors.json @@ -0,0 +1 @@ +{"_comment":"Shared modbus decode parity vectors: synthetic captures as run-length edges [sample, word] from sample 0, the channels and options, and what the Go decoder returns (the /analyzer/decode response without protocol). Verified by the Go server and the Python SDK.","cases":[{"name":"rtu_19200_session","protocol":"modbus","sample_rate_hz":1000000,"channels":{"rx":3},"options":{"baud":19200},"count":125520,"edges":[[0,4],[2002,0],[2052,4],[2104,0],[2262,4],[2313,0],[2520,4],[2745,0],[2797,4],[2900,0],[3266,4],[3490,0],[4010,4],[4234,0],[4288,4],[4390,0],[4442,4],[4496,0],[4548,4],[4652,0],[4702,4],[4981,0],[5500,4],[5725,0],[5775,4],[5880,0],[6246,4],[6469,0],[6574,4],[6678,0],[6729,4],[6887,0],[6937,4],[7215,0],[7267,4],[7423,0],[7630,4],[7681,0],[7736,4],[12958,0],[13010,4],[13064,0],[13220,4],[13271,0],[13480,4],[13703,0],[13754,4],[13859,0],[14225,4],[14450,0],[14551,4],[14657,0],[14970,4],[15192,0],[15297,4],[15349,0],[15663,4],[15938,0],[15991,4],[16094,0],[16145,4],[16200,0],[16249,4],[16303,0],[16457,4],[16684,0],[17203,4],[17427,0],[17947,4],[18172,0],[18692,4],[18916,0],[19074,4],[19126,0],[19229,4],[19332,0],[19387,4],[19662,0],[19870,4],[19921,0],[20027,4],[20408,0],[20509,4],[20562,0],[20615,4],[20773,0],[20822,4],[26153,0],[26205,4],[26257,0],[26412,4],[26465,0],[26673,4],[26896,0],[26947,4],[27001,0],[27364,4],[27642,0],[28161,4],[28387,0],[28437,4],[28543,0],[28646,4],[28700,0],[28855,4],[29131,0],[29652,4],[29875,0],[29978,4],[30032,0],[30083,4],[30135,0],[30397,4],[30619,0],[30674,4],[30879,0],[30986,4],[31035,0],[31088,4],[31365,0],[31574,4],[31679,0],[31728,4],[31783,0],[31835,4],[37111,0],[37161,4],[37215,0],[37372,4],[37423,0],[37631,4],[37854,0],[37905,4],[37959,0],[38325,4],[38599,0],[38704,4],[38755,0],[39068,4],[39344,0],[39396,4],[39449,0],[39501,4],[39604,0],[39710,4],[40088,0],[40142,4],[40194,0],[40559,4],[40835,0],[40884,4],[40937,0],[40990,4],[41094,0],[41145,4],[41302,0],[41354,4],[41580,0],[41631,4],[41840,0],[41889,4],[41994,0],[42098,4],[47324,0],[47377,4],[47428,0],[47583,4],[47635,0],[47844,4],[48067,0],[48120,4],[48172,0],[48226,4],[48277,0],[48588,4],[48812,0],[49333,4],[49556,0],[49713,4],[49818,0],[49870,4],[49923,0],[49975,4],[50026,0],[50079,4],[50303,0],[50354,4],[50772,0],[50824,4],[51048,0],[51569,4],[51792,0],[51898,4],[52052,0],[52158,4],[52210,0],[52312,4],[52538,0],[52588,4],[52693,0],[52744,4],[52798,0],[52954,4],[53006,0],[53057,4],[58283,0],[58335,4],[58385,0],[58542,4],[58593,0],[58802,4],[59025,0],[59077,4],[59131,0],[59181,4],[59234,0],[59547,4],[59771,0],[60293,4],[60515,0],[60671,4],[60777,0],[60829,4],[60882,0],[60934,4],[60986,0],[61038,4],[61260,0],[61313,4],[61730,0],[61781,4],[62004,0],[62528,4],[62749,0],[62856,4],[63012,0],[63116,4],[63166,0],[63272,4],[63494,0],[63547,4],[63652,0],[63703,4],[63756,0],[63912,4],[63964,0],[64015,4],[69239,0],[69291,4],[69344,0],[69502,4],[69553,0],[69761,4],[69984,0],[70245,4],[70296,0],[70452,4],[70730,0],[71251,4],[71473,0],[71527,4],[71578,0],[71943,4],[72220,0],[72741,4],[72965,0],[73069,4],[73120,0],[73432,4],[73709,0],[73865,4],[73916,0],[74177,4],[74454,0],[74975,4],[75199,0],[75302,4],[75356,0],[75405,4],[75459,0],[75720,4],[75942,0],[75995,4],[76046,0],[76413,4],[76689,0],[76792,4],[76844,0],[77157,4],[77433,0],[77538,4],[77640,0],[77799,4],[77900,0],[77953,4],[78177,0],[78437,4],[78648,0],[78699,4],[83923,0],[83974,4],[84028,0],[84184,4],[84236,0],[84442,4],[84668,0],[84928,4],[84981,0],[85136,4],[85411,0],[85932,4],[86155,0],[86208,4],[86261,0],[86626,4],[86902,0],[87423,4],[87646,0],[87751,4],[87803,0],[88116,4],[88391,0],[88494,4],[88546,0],[88650,4],[88702,0],[88912,4],[89136,0],[89345,4],[89448,0],[89551,4],[94880,0],[94933,4],[94985,0],[95142,4],[95195,0],[95401,4],[95625,0],[95730,4],[95834,0],[96145,4],[96371,0],[96891,4],[97114,0],[97167,4],[97220,0],[97582,4],[97860,0],[98380,4],[98603,0],[98657,4],[98762,0],[99125,4],[99350,0],[99453,4],[99505,0],[99559,4],[99661,0],[99766,4],[99818,0],[99869,4],[100094,0],[100146,4],[100252,0],[100302,4],[100407,0],[100512,4],[105840,0],[105889,4],[105944,0],[106101,4],[106151,0],[106359,4],[106582,0],[106687,4],[106792,0],[107000,4],[107329,0],[107432,4],[107483,0],[107798,4],[108074,0],[108179,4],[108230,0],[108438,4],[108818,0],[108973,4],[109026,0],[109129,4],[109235,0],[109286,4],[114563,0],[115084,4],[115309,0],[115411,4],[115516,0],[115829,4],[116051,0],[116574,4],[116797,0],[117057,4],[117110,0],[117266,4],[117544,0],[117646,4],[117699,0],[117801,4],[117853,0],[118062,4],[118286,0],[118442,4],[118494,0],[118546,4],[118652,0],[118755,4],[119030,0],[119189,4],[119241,0],[119449,4],[119500,0],[119552,4],[119777,0],[119829,4],[119882,0],[119985,4],[120037,0],[120088,4],[120140,0],[120194,4],[120245,0],[120298,4]],"expect":{"frames":[{"index":1,"start_us":2002,"end_us":7762,"role":"request","addr":17,"function":3,"function_name":"READ_HOLDING_REGISTERS","start":107,"quantity":3,"summary":"READ_HOLDING_REGISTERS 107 x3","data_hex":"00 6B 00 03","crc":"0x8776","ok":true},{"index":2,"start_us":12958,"end_us":20955,"role":"response","addr":17,"function":3,"function_name":"READ_HOLDING_REGISTERS","start":107,"values":[555,0,100],"summary":"READ_HOLDING_REGISTERS 107: 555 0 100","data_hex":"06 02 2B 00 00 00 64","crc":"0xBAC8","reply_to":1,"response_us":5196,"ok":true},{"index":3,"start_us":26153,"end_us":31912,"role":"request","addr":17,"function":1,"function_name":"READ_COILS","start":19,"quantity":10,"summary":"READ_COILS 19 x10","data_hex":"00 13 00 0A","crc":"0x584F","ok":true},{"index":4,"start_us":37111,"end_us":42127,"role":"response","addr":17,"function":1,"function_name":"READ_COILS","start":19,"values":[1,0,1,1,0,0,1,1,1,0],"summary":"READ_COILS 19: 1 0 1 1 0 0 1 1 1 0","data_hex":"02 CD 01","crc":"0x6FED","reply_to":3,"response_us":5199,"ok":true},{"index":5,"start_us":47324,"end_us":53085,"role":"request","addr":17,"function":5,"function_name":"WRITE_SINGLE_COIL","start":172,"values":[1],"summary":"WRITE_SINGLE_COIL 172 ON","data_hex":"00 AC FF 00","crc":"0x8B4E","ok":true},{"index":6,"start_us":58283,"end_us":64041,"role":"response","addr":17,"function":5,"function_name":"WRITE_SINGLE_COIL","start":172,"values":[1],"summary":"WRITE_SINGLE_COIL 172 ON","data_hex":"00 AC FF 00","crc":"0x8B4E","reply_to":5,"response_us":5198,"ok":true},{"index":7,"start_us":69239,"end_us":78724,"role":"request","addr":17,"function":16,"function_name":"WRITE_MULTIPLE_REGISTERS","start":1,"quantity":2,"values":[10,258],"summary":"WRITE_MULTIPLE_REGISTERS 1: 10 258","data_hex":"00 01 00 02 04 00 0A 01 02","crc":"0xF0C6","ok":true},{"index":8,"start_us":83923,"end_us":89683,"role":"response","addr":17,"function":16,"function_name":"WRITE_MULTIPLE_REGISTERS","start":1,"quantity":2,"summary":"WRITE_MULTIPLE_REGISTERS 1 x2 done","data_hex":"00 01 00 02","crc":"0x9812","reply_to":7,"response_us":5199,"ok":true},{"index":9,"start_us":94880,"end_us":100641,"role":"request","addr":17,"function":6,"function_name":"WRITE_SINGLE_REGISTER","start":1,"values":[3],"summary":"WRITE_SINGLE_REGISTER 1 = 3","data_hex":"00 01 00 03","crc":"0x9B9A","ok":true},{"index":10,"start_us":105840,"end_us":109365,"role":"response","addr":17,"function":134,"function_name":"WRITE_SINGLE_REGISTER exception","exception":"ILLEGAL_DATA_ADDRESS","summary":"WRITE_SINGLE_REGISTER: ILLEGAL_DATA_ADDRESS","data_hex":"02","crc":"0x64C2","reply_to":9,"response_us":5199,"ok":true},{"index":11,"start_us":114563,"end_us":120324,"role":"request","addr":0,"function":6,"function_name":"WRITE_SINGLE_REGISTER","start":16,"values":[4660],"summary":"WRITE_SINGLE_REGISTER 16 = 4660","data_hex":"00 10 12 34","crc":"0xA984","ok":true}]}}]} diff --git a/packages/embeddedci/tests/testdata/onewire_decode_vectors.json b/packages/embeddedci/tests/testdata/onewire_decode_vectors.json new file mode 100644 index 0000000..c82c70a --- /dev/null +++ b/packages/embeddedci/tests/testdata/onewire_decode_vectors.json @@ -0,0 +1 @@ +{"_comment":"Shared onewire decode parity vectors: synthetic captures as run-length edges [sample, word] from sample 0, the channels and options, and what the Go decoder returns (the /analyzer/decode response without protocol). Verified by the Go server and the Python SDK.","cases":[{"name":"standard_and_overdrive_4msps","protocol":"onewire","sample_rate_hz":4000000,"channels":{"onewire":6},"options":{},"count":146143,"edges":[[0,32],[400,0],[2400,32],[2521,0],[3000,32],[4400,0],[4424,32],[4680,0],[4705,32],[4960,0],[5201,32],[5239,0],[5480,32],[5520,0],[5543,32],[5800,0],[5824,32],[6080,0],[6320,32],[6359,0],[6600,32],[6639,0],[6880,32],[6920,0],[7161,32],[7201,0],[7440,32],[7480,0],[7504,32],[7760,0],[8000,32],[8039,0],[8064,32],[8319,0],[8561,32],[8600,0],[8839,32],[8881,0],[9121,32],[9161,0],[9184,32],[9440,0],[9680,32],[9719,0],[9959,32],[10001,0],[10024,32],[10280,0],[10519,32],[10560,0],[10800,32],[10839,0],[11080,32],[11120,0],[11144,32],[11400,0],[11424,32],[11679,0],[11920,32],[11959,0],[11984,32],[12239,0],[12264,32],[12520,0],[12543,32],[12799,0],[13040,32],[13080,0],[13320,32],[13361,0],[13600,32],[13640,0],[13664,32],[13919,0],[14159,32],[14200,0],[14224,32],[14480,0],[14503,32],[14760,0],[15000,32],[15040,0],[15063,32],[15320,0],[15560,32],[15599,0],[15624,32],[15880,0],[15904,32],[16160,0],[16184,32],[16440,0],[16680,32],[16720,0],[16960,32],[17000,0],[17240,32],[17280,0],[17520,32],[17560,0],[17800,32],[17841,0],[18080,32],[18120,0],[18360,32],[18400,0],[18640,32],[18680,0],[18919,32],[18960,0],[19199,32],[19240,0],[19481,32],[19520,0],[19760,32],[19799,0],[20040,32],[20079,0],[20321,32],[20361,0],[20599,32],[20640,0],[20881,32],[20919,0],[21160,32],[21199,0],[21440,32],[21480,0],[21720,32],[21760,0],[22000,32],[22040,0],[22280,32],[22320,0],[22560,32],[22599,0],[22624,32],[22880,0],[22904,32],[23160,0],[23401,32],[23440,0],[23680,32],[23720,0],[23743,32],[24000,0],[24024,32],[24280,0],[24519,32],[24560,0],[26560,32],[26680,0],[27160,32],[28559,0],[28584,32],[28841,0],[29079,32],[29120,0],[29144,32],[29400,0],[29641,32],[29681,0],[29704,32],[29960,0],[30199,32],[30240,0],[30264,32],[30519,0],[30760,32],[30800,0],[31040,32],[31079,0],[31319,32],[31361,0],[31600,32],[31640,0],[31664,32],[31920,0],[32160,32],[32201,0],[32224,32],[32480,0],[32719,32],[32760,0],[33001,32],[33040,0],[33280,32],[33320,0],[33343,32],[33600,0],[33840,32],[33880,0],[34120,32],[34159,0],[34183,32],[34439,0],[34681,32],[34719,0],[34959,32],[35000,0],[35239,32],[35279,0],[35305,32],[35560,0],[35585,32],[35840,0],[36080,32],[36119,0],[36143,32],[36400,0],[36424,32],[36679,0],[36704,32],[36960,0],[37199,32],[37240,0],[37480,32],[37521,0],[37759,32],[37800,0],[37824,32],[38080,0],[38320,32],[38361,0],[38384,32],[38640,0],[38664,32],[38920,0],[39160,32],[39200,0],[39224,32],[39479,0],[39720,32],[39760,0],[39784,32],[40040,0],[40065,32],[40319,0],[40345,32],[40599,0],[40841,32],[40880,0],[41119,32],[41161,0],[41400,32],[41440,0],[41681,32],[41719,0],[41961,32],[42000,0],[42240,32],[42280,0],[42520,32],[42559,0],[42801,32],[42840,0],[43079,32],[43120,0],[43360,32],[43400,0],[43641,32],[43680,0],[43921,32],[43959,0],[44200,32],[44240,0],[44479,32],[44520,0],[44760,32],[44800,0],[45040,32],[45080,0],[45319,32],[45360,0],[45601,32],[45640,0],[45879,32],[45920,0],[46160,32],[46201,0],[46441,32],[46480,0],[46720,32],[46760,0],[46784,32],[47041,0],[47064,32],[47320,0],[47560,32],[47600,0],[47841,32],[47880,0],[47904,32],[48160,0],[48184,32],[48439,0],[48681,32],[48719,0],[48960,32],[49000,0],[49024,32],[49280,0],[49304,32],[49560,0],[49583,32],[49840,0],[49864,32],[50120,0],[50145,32],[50400,0],[50640,32],[50680,0],[50703,32],[50960,0],[51201,32],[51239,0],[51481,32],[51520,0],[51760,32],[51800,0],[51824,32],[52080,0],[52103,32],[52360,0],[52600,32],[52640,0],[52664,32],[52920,0],[53161,32],[53201,0],[53224,32],[53480,0],[53721,32],[53760,0],[54000,32],[54039,0],[54280,32],[54319,0],[54560,32],[54601,0],[54840,32],[54880,0],[55119,32],[55160,0],[55399,32],[55441,0],[55464,32],[55720,0],[55743,32],[56000,0],[56240,32],[56280,0],[56304,32],[56559,0],[56800,32],[56839,0],[57079,32],[57119,0],[57144,32],[57401,0],[57639,32],[57679,0],[57920,32],[57960,0],[57985,32],[58240,0],[58264,32],[58519,0],[58761,32],[58801,0],[59040,32],[59080,0],[59321,32],[59360,0],[59384,32],[59641,0],[59880,32],[59920,0],[59943,32],[60200,0],[60224,32],[60479,0],[60504,32],[60759,0],[60785,32],[61041,0],[61064,32],[61320,0],[61343,32],[61599,0],[61625,32],[61880,0],[62120,32],[62159,0],[62184,32],[62439,0],[62464,32],[62720,0],[62744,32],[62999,0],[63025,32],[63280,0],[63304,32],[63560,0],[63584,32],[63841,0],[63865,32],[64120,0],[64145,32],[64401,0],[64639,32],[64679,0],[64921,32],[64960,0],[65200,32],[65239,0],[65265,32],[65519,0],[65759,32],[65800,0],[66040,32],[66080,0],[66320,32],[66359,0],[66600,32],[66640,0],[66881,32],[66920,0],[67159,32],[67200,0],[67440,32],[67480,0],[67719,32],[67760,0],[67784,32],[68041,0],[68280,32],[68321,0],[68559,32],[68600,0],[68840,32],[68880,0],[68904,32],[69161,0],[69400,32],[69439,0],[69680,32],[69720,0],[69745,32],[70001,0],[70023,32],[70280,0],[70304,32],[70559,0],[70584,32],[70840,0],[70864,32],[71119,0],[73120,32],[73239,0],[73721,32],[75120,0],[75359,32],[75400,0],[75640,32],[75680,0],[75919,32],[75959,0],[76200,32],[76240,0],[76263,32],[76521,0],[76544,32],[76800,0],[76823,32],[77079,0],[77104,32],[77360,0],[77600,32],[77639,0],[77663,32],[77920,0],[78160,32],[78200,0],[78439,32],[78479,0],[78504,32],[78760,0],[78999,32],[79039,0],[79280,32],[79320,0],[79344,32],[79600,0],[79839,32],[79881,0],[79904,32],[80160,0],[80400,32],[80439,0],[80464,32],[80720,0],[80959,32],[80999,0],[81023,32],[81280,0],[81519,32],[81560,0],[81584,32],[81840,0],[82080,32],[82121,0],[82144,32],[82400,0],[82639,32],[82680,0],[82703,32],[82959,0],[83201,32],[83240,0],[83479,32],[83519,0],[83544,32],[83801,0],[84040,32],[84080,0],[84320,32],[84361,0],[84383,32],[84639,0],[84881,32],[84920,0],[84944,32],[85200,0],[85440,32],[85480,0],[85504,32],[85759,0],[86001,32],[86039,0],[86063,32],[86320,0],[86560,32],[86600,0],[86839,32],[86880,0],[86904,32],[87160,0],[87399,32],[87440,0],[87464,32],[87720,0],[87960,32],[87999,0],[88024,32],[88279,0],[88520,32],[88560,0],[88584,32],[88840,0],[89080,32],[89121,0],[89360,32],[89399,0],[89424,32],[89680,0],[89920,32],[89960,0],[90200,32],[90240,0],[90264,32],[90520,0],[90760,32],[90800,0],[90824,32],[91079,0],[91320,32],[91360,0],[91384,32],[91641,0],[91664,32],[91920,0],[92160,32],[92199,0],[92224,32],[92480,0],[92720,32],[92761,0],[92783,32],[93040,0],[93280,32],[93320,0],[93344,32],[93599,0],[93840,32],[93880,0],[93904,32],[94159,0],[94183,32],[94440,0],[94680,32],[94720,0],[94744,32],[95001,0],[95024,32],[95279,0],[95520,32],[95560,0],[95584,32],[95840,0],[96079,32],[96119,0],[96144,32],[96400,0],[96641,32],[96679,0],[96920,32],[96959,0],[96985,32],[97240,0],[97480,32],[97520,0],[97760,32],[97800,0],[97824,32],[98080,0],[98320,32],[98360,0],[98383,32],[98640,0],[98880,32],[98919,0],[98945,32],[99200,0],[99440,32],[99479,0],[99503,32],[99760,0],[100001,32],[100040,0],[100064,32],[100320,0],[100560,32],[100600,0],[100624,32],[100880,0],[100904,32],[101160,0],[101400,32],[101440,0],[101465,32],[101719,0],[101960,32],[102000,0],[102024,32],[102280,0],[102520,32],[102559,0],[102583,32],[102840,0],[103079,32],[103121,0],[103144,32],[103400,0],[103640,32],[103680,0],[103703,32],[103959,0],[104199,32],[104240,0],[104264,32],[104521,0],[104759,32],[104800,0],[104824,32],[105079,0],[105104,32],[105360,0],[105600,32],[105640,0],[105664,32],[105919,0],[105944,32],[106200,0],[106440,32],[106479,0],[106504,32],[106761,0],[107000,32],[107039,0],[107064,32],[107320,0],[107560,32],[107599,0],[107840,32],[107879,0],[107904,32],[108159,0],[108399,32],[108440,0],[108680,32],[108721,0],[108743,32],[109001,0],[109240,32],[109281,0],[109520,32],[109560,0],[109584,32],[109840,0],[110079,32],[110120,0],[110360,32],[110400,0],[110423,32],[110680,0],[110920,32],[110960,0],[111200,32],[111239,0],[111263,32],[111519,0],[111761,32],[111801,0],[112041,32],[112080,0],[112103,32],[112360,0],[112599,32],[112640,0],[112879,32],[112920,0],[112943,32],[113200,0],[113441,32],[113480,0],[113720,32],[113759,0],[113784,32],[114040,0],[114280,32],[114321,0],[114561,32],[114601,0],[114624,32],[114881,0],[115120,32],[115159,0],[115400,32],[115439,0],[115464,32],[115720,0],[115960,32],[116000,0],[116239,32],[116280,0],[116304,32],[116560,0],[116800,32],[116839,0],[117081,32],[117121,0],[117143,32],[117399,0],[117641,32],[117680,0],[117920,32],[117959,0],[117984,32],[118240,0],[118479,32],[118520,0],[118760,32],[118799,0],[118824,32],[119080,0],[119320,32],[119360,0],[119600,32],[119640,0],[119664,32],[119920,0],[120160,32],[120200,0],[120439,32],[120480,0],[120504,32],[120760,0],[121001,32],[121040,0],[121280,32],[121321,0],[121345,32],[121600,0],[121839,32],[121880,0],[122120,32],[122160,0],[122184,32],[122441,0],[122679,32],[122719,0],[122959,32],[123000,0],[123024,32],[123280,0],[123519,32],[123560,0],[123800,32],[123840,0],[123864,32],[124121,0],[124360,32],[124400,0],[124640,32],[124680,0],[124705,32],[124960,0],[125200,32],[125239,0],[125263,32],[125519,0],[125761,32],[125800,0],[125824,32],[126080,0],[126104,32],[126360,0],[126600,32],[126639,0],[126664,32],[126921,0],[127160,32],[127200,0],[127224,32],[127480,0],[127721,32],[127760,0],[128000,32],[128039,0],[128064,32],[128319,0],[128560,32],[128599,0],[128624,32],[128880,0],[129120,32],[129160,0],[129184,32],[129440,0],[129464,32],[129720,0],[129960,32],[130000,0],[130024,32],[130280,0],[130520,32],[130561,0],[130585,32],[130840,0],[131079,32],[131119,0],[133119,32],[135120,0],[137120,32],[137241,0],[137720,32],[139120,0],[139360,32],[139400,0],[139639,32],[139680,0],[139704,32],[139960,0],[139983,32],[140241,0],[140264,32],[140520,0],[140545,32],[140800,0],[141040,32],[141080,0],[141319,32],[141360,0],[141390,32],[141401,0],[141430,32],[141440,0],[141444,32],[141479,0],[141511,32],[141519,0],[141550,32],[141560,0],[141590,32],[141600,0],[141604,32],[141640,0],[141670,32],[141680,0],[141961,32],[141976,0],[142025,32],[142224,0],[142254,32],[142264,0],[142293,32],[142303,0],[142308,32],[142345,0],[142348,32],[142383,0],[142413,32],[142425,0],[142454,32],[142464,0],[142469,32],[142504,0],[142508,32],[142545,0],[142574,32],[142584,0],[142588,32],[142624,0],[142628,32],[142664,0],[142668,32],[142704,0],[142708,32],[142744,0],[142747,32],[142785,0],[142813,32],[142824,0],[142828,32],[142864,0],[142894,32],[142903,0],[142934,32],[142943,0],[142974,32],[142984,0],[142988,32],[143024,0],[143027,32],[143064,0],[143094,32],[143103,0],[143108,32],[143144,0],[143174,32],[143184,0],[143188,32],[143223,0],[143254,32],[143265,0],[143295,32],[143303,0],[143335,32],[143343,0],[143373,32],[143384,0],[143413,32],[143424,0],[143455,32],[143465,0],[143493,32],[143504,0],[143507,32],[143543,0],[143548,32],[143583,0],[143614,32],[143623,0],[143627,32],[143665,0],[143694,32],[143704,0],[143734,32],[143744,0],[143748,32],[143784,0],[143814,32],[143825,0],[143854,32],[143864,0],[143868,32],[143904,0],[143908,32],[143943,0],[143974,32],[143984,0],[144013,32],[144025,0],[144054,32],[144063,0],[144069,32],[144105,0],[144134,32],[144144,0],[144148,32],[144184,0],[144188,32],[144225,0],[144228,32],[144265,0],[144268,32],[144305,0],[144308,32],[144345,0],[144348,32],[144385,0],[144388,32],[144424,0],[144453,32],[144464,0],[144468,32],[144504,0],[144507,32],[144544,0],[144548,32],[144584,0],[144588,32],[144624,0],[144628,32],[144665,0],[144667,32],[144704,0],[144708,32],[144744,0],[144748,32],[144783,0],[144814,32],[144825,0],[144854,32],[144864,0],[144894,32],[144904,0],[144908,32],[144944,0],[144974,32],[144984,0],[145013,32],[145024,0],[145054,32],[145064,0],[145094,32],[145103,0],[145133,32],[145145,0],[145174,32],[145185,0],[145214,32],[145225,0],[145254,32],[145264,0],[145268,32],[145303,0],[145333,32],[145345,0],[145374,32],[145384,0],[145414,32],[145424,0],[145429,32],[145464,0],[145495,32],[145503,0],[145534,32],[145544,0],[145548,32],[145584,0],[145588,32],[145623,0],[145628,32],[145664,0],[145668,32],[145704,0],[145708,32]],"expect":{"transactions":[{"index":1,"start_us":100,"end_us":6129.75,"reset":true,"presence":true,"overdrive":false,"rom_command":51,"rom_command_name":"READ_ROM","rom":"28 12 3B 5A 07 00 00 66","rom_crc_ok":true,"bytes_hex":"","ok":true},{"index":2,"start_us":6140,"end_us":17716,"reset":true,"presence":true,"overdrive":false,"rom_command":85,"rom_command_name":"MATCH_ROM","rom":"28 12 3B 5A 07 00 00 66","rom_crc_ok":true,"function":"READ_SCRATCHPAD","bytes_hex":"BE 58 01 4B 46 7F FF 08 10 F9","detail":"21.5 °C","ok":true},{"index":3,"start_us":17779.75,"end_us":32769.75,"reset":true,"presence":true,"overdrive":false,"rom_command":240,"rom_command_name":"SEARCH_ROM","rom":"28 12 3B 5A 07 00 00 66","rom_crc_ok":true,"bytes_hex":"","ok":true},{"index":4,"start_us":32779.75,"end_us":33279.75,"reset":true,"presence":false,"overdrive":false,"bytes_hex":"","ok":false,"error":"no presence pulse"},{"index":5,"start_us":33780,"end_us":35417.5,"reset":true,"presence":true,"overdrive":true,"rom_command":60,"rom_command_name":"OVERDRIVE_SKIP_ROM","function":"CONVERT_T","bytes_hex":"44","ok":true},{"index":6,"start_us":35420,"end_us":36427,"reset":true,"presence":true,"overdrive":true,"rom_command":204,"rom_command_name":"SKIP_ROM","function":"READ_SCRATCHPAD","bytes_hex":"BE 58 01 4B 46 7F FF 08 10 F9","detail":"21.5 °C","ok":true}]}}]} diff --git a/packages/embeddedci/tests/testdata/pwm_decode_vectors.json b/packages/embeddedci/tests/testdata/pwm_decode_vectors.json new file mode 100644 index 0000000..b96c628 --- /dev/null +++ b/packages/embeddedci/tests/testdata/pwm_decode_vectors.json @@ -0,0 +1 @@ +{"_comment":"Shared pwm decode parity vectors: synthetic captures as run-length edges [sample, word] from sample 0, the channels and options, and what the Go decoder returns (the /analyzer/decode response without protocol). Verified by the Go server and the Python SDK.","cases":[{"name":"fan_and_servo_1msps","protocol":"pwm","sample_rate_hz":1000000,"channels":{},"options":{"channels":[1,2,3]},"count":61999,"edges":[[0,0],[20,1],[32,0],[60,1],[72,0],[100,1],[112,0],[140,1],[152,0],[180,1],[192,0],[220,1],[232,0],[260,1],[272,0],[300,1],[312,0],[340,1],[352,0],[380,1],[392,0],[420,1],[432,0],[460,1],[472,0],[500,1],[512,0],[540,1],[552,0],[580,1],[592,0],[620,1],[632,0],[660,1],[672,0],[700,1],[712,0],[740,1],[752,0],[780,1],[792,0],[820,1],[832,0],[860,1],[872,0],[900,1],[912,0],[940,1],[952,0],[980,1],[992,0],[1000,2],[1020,3],[1032,2],[1060,3],[1072,2],[1100,3],[1112,2],[1140,3],[1152,2],[1180,3],[1192,2],[1220,3],[1232,2],[1260,3],[1272,2],[1300,3],[1312,2],[1340,3],[1352,2],[1380,3],[1392,2],[1420,3],[1432,2],[1460,3],[1472,2],[1500,3],[1512,2],[1540,3],[1552,2],[1580,3],[1592,2],[1620,3],[1632,2],[1660,3],[1672,2],[1700,3],[1712,2],[1740,3],[1752,2],[1780,3],[1792,2],[1820,3],[1832,2],[1860,3],[1872,2],[1900,3],[1912,2],[1940,3],[1952,2],[1980,3],[1992,2],[2000,0],[2020,1],[2021,0],[2051,1],[2063,0],[2091,1],[2103,0],[2131,1],[2143,0],[2171,1],[2183,0],[2211,1],[2223,0],[2251,1],[2263,0],[2291,1],[2303,0],[2331,1],[2343,0],[2371,1],[2383,0],[2411,1],[2423,0],[2451,1],[2463,0],[2491,1],[2503,0],[2531,1],[2543,0],[2571,1],[2583,0],[2611,1],[2623,0],[2651,1],[2663,0],[2691,1],[2703,0],[2731,1],[2743,0],[2771,1],[2783,0],[2811,1],[2823,0],[21000,2],[22250,0],[41000,2],[43000,0],[61000,2]],"expect":{"protocol":"pwm","channels":[{"channel":1,"count":70,"freq_hz":{"min":25000,"max":32258.064516129034,"mean":25103.6866359447},"period_us":{"min":31,"max":40,"mean":39.871428571428574},"duty":{"min":0.03225806451612903,"max":0.3,"mean":0.29617511520737366},"high_us":{"min":1,"max":12,"mean":11.842857142857143},"low_us":{"min":28,"max":30,"mean":28.02857142857143},"jitter_us":1.0679944966608947,"glitches":0,"periods":[{"index":1,"start_us":20,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":2,"start_us":60,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":3,"start_us":100,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":4,"start_us":140,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":5,"start_us":180,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":6,"start_us":220,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":7,"start_us":260,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":8,"start_us":300,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":9,"start_us":340,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":10,"start_us":380,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":11,"start_us":420,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":12,"start_us":460,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":13,"start_us":500,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":14,"start_us":540,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":15,"start_us":580,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":16,"start_us":620,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":17,"start_us":660,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":18,"start_us":700,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":19,"start_us":740,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":20,"start_us":780,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":21,"start_us":820,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":22,"start_us":860,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":23,"start_us":900,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":24,"start_us":940,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":25,"start_us":980,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":26,"start_us":1020,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":27,"start_us":1060,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":28,"start_us":1100,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":29,"start_us":1140,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":30,"start_us":1180,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":31,"start_us":1220,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":32,"start_us":1260,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":33,"start_us":1300,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":34,"start_us":1340,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":35,"start_us":1380,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":36,"start_us":1420,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":37,"start_us":1460,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":38,"start_us":1500,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":39,"start_us":1540,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":40,"start_us":1580,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":41,"start_us":1620,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":42,"start_us":1660,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":43,"start_us":1700,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":44,"start_us":1740,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":45,"start_us":1780,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":46,"start_us":1820,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":47,"start_us":1860,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":48,"start_us":1900,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":49,"start_us":1940,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":50,"start_us":1980,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":51,"start_us":2020,"period_us":31,"freq_hz":32258.064516129034,"high_us":1,"low_us":30,"duty":0.03225806451612903},{"index":52,"start_us":2051,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":53,"start_us":2091,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":54,"start_us":2131,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":55,"start_us":2171,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":56,"start_us":2211,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":57,"start_us":2251,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":58,"start_us":2291,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":59,"start_us":2331,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":60,"start_us":2371,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":61,"start_us":2411,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":62,"start_us":2451,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":63,"start_us":2491,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":64,"start_us":2531,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":65,"start_us":2571,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":66,"start_us":2611,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":67,"start_us":2651,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":68,"start_us":2691,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":69,"start_us":2731,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":70,"start_us":2771,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3}],"truncated":false},{"channel":2,"count":3,"freq_hz":{"min":50,"max":50,"mean":50},"period_us":{"min":20000,"max":20000,"mean":20000},"duty":{"min":0.05,"max":0.1,"mean":0.07083333333333335},"high_us":{"min":1000,"max":2000,"mean":1416.6666666666667},"low_us":{"min":18000,"max":19000,"mean":18583.333333333332},"jitter_us":0,"glitches":0,"servo":{"pulse_ms":{"min":1,"max":2,"mean":1.4166666666666667},"position_pct":{"min":0,"max":100,"mean":41.666666666666664}},"periods":[{"index":1,"start_us":1000,"period_us":20000,"freq_hz":50,"high_us":1000,"low_us":19000,"duty":0.05},{"index":2,"start_us":21000,"period_us":20000,"freq_hz":50,"high_us":1250,"low_us":18750,"duty":0.0625},{"index":3,"start_us":41000,"period_us":20000,"freq_hz":50,"high_us":2000,"low_us":18000,"duty":0.1}],"truncated":false},{"channel":3,"count":0,"level":0,"freq_hz":{"min":0,"max":0,"mean":0},"period_us":{"min":0,"max":0,"mean":0},"duty":{"min":0,"max":0,"mean":0},"high_us":{"min":0,"max":0,"mean":0},"low_us":{"min":0,"max":0,"mean":0},"jitter_us":0,"glitches":0,"periods":[],"truncated":false}]}}]} diff --git a/packages/embeddedci/tests/testdata/smbus_decode_vectors.json b/packages/embeddedci/tests/testdata/smbus_decode_vectors.json new file mode 100644 index 0000000..cf3464f --- /dev/null +++ b/packages/embeddedci/tests/testdata/smbus_decode_vectors.json @@ -0,0 +1 @@ +{"_comment":"Shared smbus decode parity vectors: synthetic captures as run-length edges [sample, word] from sample 0, the channels and options, and what the Go decoder returns (the /analyzer/decode response without protocol). Verified by the Go server and the Python SDK.","cases":[{"name":"pmbus_100k_1msps","protocol":"pmbus","sample_rate_hz":1000000,"channels":{"scl":2,"sda":1},"options":{},"count":3901,"edges":[[0,3],[5,2],[7,0],[10,1],[12,3],[17,1],[20,0],[22,2],[27,0],[32,2],[37,0],[42,2],[47,0],[52,2],[57,0],[62,2],[67,0],[72,2],[77,0],[82,2],[87,0],[92,2],[97,0],[102,2],[107,0],[112,2],[117,0],[120,1],[122,3],[127,1],[130,0],[132,2],[137,0],[142,2],[147,0],[152,2],[157,0],[162,2],[167,0],[172,2],[177,0],[182,2],[187,0],[190,1],[192,3],[195,2],[197,0],[200,1],[202,3],[207,1],[210,0],[212,2],[217,0],[222,2],[227,0],[232,2],[237,0],[242,2],[247,0],[252,2],[257,0],[262,2],[267,0],[270,1],[272,3],[277,1],[280,0],[282,2],[287,0],[292,2],[297,0],[302,2],[307,0],[312,2],[317,0],[320,1],[322,3],[327,1],[330,0],[332,2],[337,0],[340,1],[342,3],[347,1],[352,3],[357,1],[362,3],[367,1],[370,0],[372,2],[377,0],[380,1],[382,3],[387,1],[390,0],[392,2],[397,0],[400,1],[402,3],[407,1],[412,3],[417,1],[420,0],[422,2],[427,0],[430,1],[432,3],[437,1],[440,0],[442,2],[447,0],[452,2],[457,0],[460,1],[462,3],[467,1],[470,0],[472,2],[475,3],[485,2],[487,0],[490,1],[492,3],[497,1],[500,0],[502,2],[507,0],[512,2],[517,0],[522,2],[527,0],[532,2],[537,0],[542,2],[547,0],[552,2],[557,0],[562,2],[567,0],[572,2],[577,0],[580,1],[582,3],[587,1],[590,0],[592,2],[597,0],[602,2],[607,0],[612,2],[617,0],[620,1],[622,3],[627,1],[630,0],[632,2],[637,0],[640,1],[642,3],[647,1],[652,3],[657,1],[660,0],[662,2],[667,0],[670,1],[672,3],[675,2],[677,0],[680,1],[682,3],[687,1],[690,0],[692,2],[697,0],[702,2],[707,0],[712,2],[717,0],[722,2],[727,0],[732,2],[737,0],[742,2],[747,0],[750,1],[752,3],[757,1],[760,0],[762,2],[767,0],[772,2],[777,0],[782,2],[787,0],[792,2],[797,0],[802,2],[807,0],[812,2],[817,0],[822,2],[827,0],[832,2],[837,0],[842,2],[847,0],[852,2],[857,0],[862,2],[867,0],[872,2],[877,0],[882,2],[887,0],[892,2],[897,0],[902,2],[907,0],[910,1],[912,3],[917,1],[922,3],[927,1],[930,0],[932,2],[937,0],[942,2],[947,0],[952,2],[957,0],[960,1],[962,3],[967,1],[970,0],[972,2],[977,0],[980,1],[982,3],[987,1],[992,3],[997,1],[1002,3],[1007,1],[1012,3],[1017,1],[1020,0],[1022,2],[1027,0],[1030,1],[1032,3],[1037,1],[1040,0],[1042,2],[1045,3],[1055,2],[1057,0],[1060,1],[1062,3],[1067,1],[1070,0],[1072,2],[1077,0],[1082,2],[1087,0],[1092,2],[1097,0],[1102,2],[1107,0],[1112,2],[1117,0],[1122,2],[1127,0],[1132,2],[1137,0],[1142,2],[1147,0],[1150,1],[1152,3],[1157,1],[1160,0],[1162,2],[1167,0],[1172,2],[1177,0],[1182,2],[1187,0],[1190,1],[1192,3],[1197,1],[1200,0],[1202,2],[1207,0],[1212,2],[1217,0],[1222,2],[1227,0],[1232,2],[1237,0],[1240,1],[1242,3],[1245,2],[1247,0],[1250,1],[1252,3],[1257,1],[1260,0],[1262,2],[1267,0],[1272,2],[1277,0],[1282,2],[1287,0],[1292,2],[1297,0],[1302,2],[1307,0],[1312,2],[1317,0],[1320,1],[1322,3],[1327,1],[1330,0],[1332,2],[1337,0],[1340,1],[1342,3],[1347,1],[1352,3],[1357,1],[1362,3],[1367,1],[1370,0],[1372,2],[1377,0],[1380,1],[1382,3],[1387,1],[1390,0],[1392,2],[1397,0],[1402,2],[1407,0],[1412,2],[1417,0],[1422,2],[1427,0],[1430,1],[1432,3],[1437,1],[1442,3],[1447,1],[1450,0],[1452,2],[1457,0],[1460,1],[1462,3],[1467,1],[1470,0],[1472,2],[1477,0],[1482,2],[1487,0],[1490,1],[1492,3],[1497,1],[1502,3],[1507,1],[1510,0],[1512,2],[1517,0],[1520,1],[1522,3],[1527,1],[1530,0],[1532,2],[1537,0],[1540,1],[1542,3],[1547,1],[1550,0],[1552,2],[1557,0],[1560,1],[1562,3],[1567,1],[1570,0],[1572,2],[1577,0],[1580,1],[1582,3],[1587,1],[1590,0],[1592,2],[1597,0],[1600,1],[1602,3],[1607,1],[1610,0],[1612,2],[1615,3],[1625,2],[1627,0],[1630,1],[1632,3],[1637,1],[1640,0],[1642,2],[1647,0],[1652,2],[1657,0],[1662,2],[1667,0],[1672,2],[1677,0],[1682,2],[1687,0],[1692,2],[1697,0],[1702,2],[1707,0],[1712,2],[1717,0],[1722,2],[1727,0],[1730,1],[1732,3],[1737,1],[1742,3],[1747,1],[1752,3],[1757,1],[1762,3],[1767,1],[1770,0],[1772,2],[1777,0],[1782,2],[1787,0],[1790,1],[1792,3],[1797,1],[1800,0],[1802,2],[1807,0],[1810,1],[1812,3],[1815,2],[1817,0],[1820,1],[1822,3],[1827,1],[1830,0],[1832,2],[1837,0],[1842,2],[1847,0],[1852,2],[1857,0],[1862,2],[1867,0],[1872,2],[1877,0],[1882,2],[1887,0],[1890,1],[1892,3],[1897,1],[1900,0],[1902,2],[1907,0],[1912,2],[1917,0],[1920,1],[1922,3],[1927,1],[1930,0],[1932,2],[1937,0],[1942,2],[1947,0],[1952,2],[1957,0],[1962,2],[1967,0],[1972,2],[1977,0],[1980,1],[1982,3],[1987,1],[1990,0],[1992,2],[1997,0],[2002,2],[2007,0],[2012,2],[2017,0],[2022,2],[2027,0],[2032,2],[2037,0],[2040,1],[2042,3],[2047,1],[2050,0],[2052,2],[2057,0],[2062,2],[2067,0],[2072,2],[2077,0],[2082,2],[2087,0],[2092,2],[2097,0],[2102,2],[2107,0],[2112,2],[2117,0],[2120,1],[2122,3],[2127,1],[2130,0],[2132,2],[2137,0],[2140,1],[2142,3],[2147,1],[2150,0],[2152,2],[2157,0],[2160,1],[2162,3],[2167,1],[2172,3],[2177,1],[2180,0],[2182,2],[2185,3],[2195,2],[2197,0],[2200,1],[2202,3],[2207,1],[2210,0],[2212,2],[2217,0],[2222,2],[2227,0],[2232,2],[2237,0],[2242,2],[2247,0],[2252,2],[2257,0],[2262,2],[2267,0],[2272,2],[2277,0],[2282,2],[2287,0],[2290,1],[2292,3],[2297,1],[2300,0],[2302,2],[2307,0],[2312,2],[2317,0],[2320,1],[2322,3],[2327,1],[2332,3],[2337,1],[2340,0],[2342,2],[2347,0],[2350,1],[2352,3],[2357,1],[2360,0],[2362,2],[2367,0],[2372,2],[2377,0],[2380,1],[2382,3],[2385,2],[2387,0],[2390,1],[2392,3],[2397,1],[2400,0],[2402,2],[2407,0],[2412,2],[2417,0],[2422,2],[2427,0],[2432,2],[2437,0],[2442,2],[2447,0],[2452,2],[2457,0],[2460,1],[2462,3],[2467,1],[2470,0],[2472,2],[2477,0],[2482,2],[2487,0],[2492,2],[2497,0],[2502,2],[2507,0],[2512,2],[2517,0],[2522,2],[2527,0],[2530,1],[2532,3],[2537,1],[2540,0],[2542,2],[2547,0],[2550,1],[2552,3],[2557,1],[2560,0],[2562,2],[2567,0],[2572,2],[2577,0],[2580,1],[2582,3],[2587,1],[2590,0],[2592,2],[2597,0],[2600,1],[2602,3],[2607,1],[2610,0],[2612,2],[2617,0],[2622,2],[2627,0],[2632,2],[2637,0],[2642,2],[2647,0],[2652,2],[2657,0],[2662,2],[2667,0],[2670,1],[2672,3],[2677,1],[2680,0],[2682,2],[2687,0],[2690,1],[2692,3],[2697,1],[2700,0],[2702,2],[2707,0],[2712,2],[2717,0],[2720,1],[2722,3],[2727,1],[2732,3],[2737,1],[2740,0],[2742,2],[2747,0],[2752,2],[2757,0],[2760,1],[2762,3],[2767,1],[2770,0],[2772,2],[2777,0],[2780,1],[2782,3],[2787,1],[2790,0],[2792,2],[2797,0],[2800,1],[2802,3],[2807,1],[2810,0],[2812,2],[2817,0],[2820,1],[2822,3],[2827,1],[2830,0],[2832,2],[2837,0],[2842,2],[2847,0],[2852,2],[2857,0],[2860,1],[2862,3],[2867,1],[2870,0],[2872,2],[2877,0],[2880,1],[2882,3],[2887,1],[2892,3],[2897,1],[2900,0],[2902,2],[2907,0],[2910,1],[2912,3],[2917,1],[2920,0],[2922,2],[2927,0],[2932,2],[2937,0],[2942,2],[2947,0],[2950,1],[2952,3],[2957,1],[2962,3],[2967,1],[2970,0],[2972,2],[2977,0],[2982,2],[2987,0],[2992,2],[2997,0],[3000,1],[3002,3],[3007,1],[3010,0],[3012,2],[3017,0],[3020,1],[3022,3],[3027,1],[3032,3],[3037,1],[3040,0],[3042,2],[3047,0],[3050,1],[3052,3],[3057,1],[3060,0],[3062,2],[3067,0],[3072,2],[3077,0],[3080,1],[3082,3],[3087,1],[3090,0],[3092,2],[3097,0],[3100,1],[3102,3],[3107,1],[3110,0],[3112,2],[3115,3],[3125,2],[3127,0],[3130,1],[3132,3],[3137,1],[3140,0],[3142,2],[3147,0],[3152,2],[3157,0],[3162,2],[3167,0],[3172,2],[3177,0],[3182,2],[3187,0],[3192,2],[3197,0],[3202,2],[3207,0],[3212,2],[3217,0],[3222,2],[3227,0],[3232,2],[3237,0],[3240,1],[3242,3],[3247,1],[3250,0],[3252,2],[3257,0],[3262,2],[3267,0],[3272,2],[3277,0],[3282,2],[3287,0],[3290,1],[3292,3],[3297,1],[3300,0],[3302,2],[3307,0],[3312,2],[3317,0],[3322,2],[3327,0],[3332,2],[3337,0],[3342,2],[3347,0],[3352,2],[3357,0],[3362,2],[3367,0],[3372,2],[3377,0],[3382,2],[3387,0],[3392,2],[3397,0],[3402,2],[3407,0],[3412,2],[3417,0],[3422,2],[3427,0],[3432,2],[3437,0],[3442,2],[3447,0],[3450,1],[3452,3],[3457,1],[3462,3],[3467,1],[3472,3],[3477,1],[3480,0],[3482,2],[3487,0],[3492,2],[3497,0],[3502,2],[3507,0],[3512,2],[3517,0],[3522,2],[3527,0],[3530,1],[3532,3],[3537,1],[3542,3],[3547,1],[3550,0],[3552,2],[3557,0],[3562,2],[3567,0],[3572,2],[3577,0],[3582,2],[3585,3],[3595,2],[3597,0],[3600,1],[3602,3],[3607,1],[3610,0],[3612,2],[3617,0],[3622,2],[3627,0],[3632,2],[3637,0],[3642,2],[3647,0],[3652,2],[3657,0],[3662,2],[3667,0],[3672,2],[3677,0],[3682,2],[3687,0],[3692,2],[3697,0],[3702,2],[3707,0],[3712,2],[3717,0],[3722,2],[3727,0],[3732,2],[3737,0],[3742,2],[3747,0],[3750,1],[3752,3],[3757,1],[3762,3],[3767,1],[3770,0],[3772,2],[3777,0],[3782,2],[3785,3],[3795,2],[3797,0],[3800,1],[3802,3],[3807,1],[3810,0],[3812,2],[3817,0],[3822,2],[3827,0],[3832,2],[3837,0],[3842,2],[3847,0],[3852,2],[3857,0],[3860,1],[3862,3],[3867,1],[3870,0],[3872,2],[3877,0],[3882,2],[3887,0],[3892,2],[3895,3]],"expect":{"transactions":[{"index":1,"start_us":5,"end_us":475,"addr":64,"addr_hex":"0x40","kind":"read byte","command":32,"command_name":"VOUT_MODE","data_hex":"17","value":"linear, exponent -9","pec":"ok","ok":true},{"index":2,"start_us":485,"end_us":1045,"addr":64,"addr_hex":"0x40","kind":"read word","command":139,"command_name":"READ_VOUT","data_hex":"00 06","value":"3 V","pec":"ok","ok":true},{"index":3,"start_us":1055,"end_us":1615,"addr":64,"addr_hex":"0x40","kind":"read word","command":136,"command_name":"READ_VIN","data_hex":"E8 D3","value":"15.62 V","pec":"ok","ok":true},{"index":4,"start_us":1625,"end_us":2185,"addr":64,"addr_hex":"0x40","kind":"read word","command":121,"command_name":"STATUS_WORD","data_hex":"41 08","value":"NONE_OF_THE_ABOVE, OFF, POWER_GOOD#","pec":"ok","ok":true},{"index":5,"start_us":2195,"end_us":3115,"addr":64,"addr_hex":"0x40","kind":"block read","command":154,"command_name":"MFR_MODEL","data_hex":"50 53 55 2D 31","value":"\"PSU-1\"","pec":"ok","ok":true},{"index":6,"start_us":3125,"end_us":3585,"addr":64,"addr_hex":"0x40","kind":"write word","command":33,"command_name":"VOUT_COMMAND","data_hex":"00 07","value":"3.5 V","pec":"ok","ok":true},{"index":7,"start_us":3595,"end_us":3785,"addr":64,"addr_hex":"0x40","kind":"send byte","command":3,"command_name":"CLEAR_FAULTS","data_hex":"","pec":"none","ok":true},{"index":8,"start_us":3795,"end_us":3895,"addr":65,"addr_hex":"0x41","kind":"quick command","data_hex":"","pec":"none","ok":true}]}},{"name":"smbus_pec_on_1msps","protocol":"smbus","sample_rate_hz":1000000,"channels":{"scl":2,"sda":1},"options":{"pec":"on"},"count":3901,"edges":[[0,3],[5,2],[7,0],[10,1],[12,3],[17,1],[20,0],[22,2],[27,0],[32,2],[37,0],[42,2],[47,0],[52,2],[57,0],[62,2],[67,0],[72,2],[77,0],[82,2],[87,0],[92,2],[97,0],[102,2],[107,0],[112,2],[117,0],[120,1],[122,3],[127,1],[130,0],[132,2],[137,0],[142,2],[147,0],[152,2],[157,0],[162,2],[167,0],[172,2],[177,0],[182,2],[187,0],[190,1],[192,3],[195,2],[197,0],[200,1],[202,3],[207,1],[210,0],[212,2],[217,0],[222,2],[227,0],[232,2],[237,0],[242,2],[247,0],[252,2],[257,0],[262,2],[267,0],[270,1],[272,3],[277,1],[280,0],[282,2],[287,0],[292,2],[297,0],[302,2],[307,0],[312,2],[317,0],[320,1],[322,3],[327,1],[330,0],[332,2],[337,0],[340,1],[342,3],[347,1],[352,3],[357,1],[362,3],[367,1],[370,0],[372,2],[377,0],[380,1],[382,3],[387,1],[390,0],[392,2],[397,0],[400,1],[402,3],[407,1],[412,3],[417,1],[420,0],[422,2],[427,0],[430,1],[432,3],[437,1],[440,0],[442,2],[447,0],[452,2],[457,0],[460,1],[462,3],[467,1],[470,0],[472,2],[475,3],[485,2],[487,0],[490,1],[492,3],[497,1],[500,0],[502,2],[507,0],[512,2],[517,0],[522,2],[527,0],[532,2],[537,0],[542,2],[547,0],[552,2],[557,0],[562,2],[567,0],[572,2],[577,0],[580,1],[582,3],[587,1],[590,0],[592,2],[597,0],[602,2],[607,0],[612,2],[617,0],[620,1],[622,3],[627,1],[630,0],[632,2],[637,0],[640,1],[642,3],[647,1],[652,3],[657,1],[660,0],[662,2],[667,0],[670,1],[672,3],[675,2],[677,0],[680,1],[682,3],[687,1],[690,0],[692,2],[697,0],[702,2],[707,0],[712,2],[717,0],[722,2],[727,0],[732,2],[737,0],[742,2],[747,0],[750,1],[752,3],[757,1],[760,0],[762,2],[767,0],[772,2],[777,0],[782,2],[787,0],[792,2],[797,0],[802,2],[807,0],[812,2],[817,0],[822,2],[827,0],[832,2],[837,0],[842,2],[847,0],[852,2],[857,0],[862,2],[867,0],[872,2],[877,0],[882,2],[887,0],[892,2],[897,0],[902,2],[907,0],[910,1],[912,3],[917,1],[922,3],[927,1],[930,0],[932,2],[937,0],[942,2],[947,0],[952,2],[957,0],[960,1],[962,3],[967,1],[970,0],[972,2],[977,0],[980,1],[982,3],[987,1],[992,3],[997,1],[1002,3],[1007,1],[1012,3],[1017,1],[1020,0],[1022,2],[1027,0],[1030,1],[1032,3],[1037,1],[1040,0],[1042,2],[1045,3],[1055,2],[1057,0],[1060,1],[1062,3],[1067,1],[1070,0],[1072,2],[1077,0],[1082,2],[1087,0],[1092,2],[1097,0],[1102,2],[1107,0],[1112,2],[1117,0],[1122,2],[1127,0],[1132,2],[1137,0],[1142,2],[1147,0],[1150,1],[1152,3],[1157,1],[1160,0],[1162,2],[1167,0],[1172,2],[1177,0],[1182,2],[1187,0],[1190,1],[1192,3],[1197,1],[1200,0],[1202,2],[1207,0],[1212,2],[1217,0],[1222,2],[1227,0],[1232,2],[1237,0],[1240,1],[1242,3],[1245,2],[1247,0],[1250,1],[1252,3],[1257,1],[1260,0],[1262,2],[1267,0],[1272,2],[1277,0],[1282,2],[1287,0],[1292,2],[1297,0],[1302,2],[1307,0],[1312,2],[1317,0],[1320,1],[1322,3],[1327,1],[1330,0],[1332,2],[1337,0],[1340,1],[1342,3],[1347,1],[1352,3],[1357,1],[1362,3],[1367,1],[1370,0],[1372,2],[1377,0],[1380,1],[1382,3],[1387,1],[1390,0],[1392,2],[1397,0],[1402,2],[1407,0],[1412,2],[1417,0],[1422,2],[1427,0],[1430,1],[1432,3],[1437,1],[1442,3],[1447,1],[1450,0],[1452,2],[1457,0],[1460,1],[1462,3],[1467,1],[1470,0],[1472,2],[1477,0],[1482,2],[1487,0],[1490,1],[1492,3],[1497,1],[1502,3],[1507,1],[1510,0],[1512,2],[1517,0],[1520,1],[1522,3],[1527,1],[1530,0],[1532,2],[1537,0],[1540,1],[1542,3],[1547,1],[1550,0],[1552,2],[1557,0],[1560,1],[1562,3],[1567,1],[1570,0],[1572,2],[1577,0],[1580,1],[1582,3],[1587,1],[1590,0],[1592,2],[1597,0],[1600,1],[1602,3],[1607,1],[1610,0],[1612,2],[1615,3],[1625,2],[1627,0],[1630,1],[1632,3],[1637,1],[1640,0],[1642,2],[1647,0],[1652,2],[1657,0],[1662,2],[1667,0],[1672,2],[1677,0],[1682,2],[1687,0],[1692,2],[1697,0],[1702,2],[1707,0],[1712,2],[1717,0],[1722,2],[1727,0],[1730,1],[1732,3],[1737,1],[1742,3],[1747,1],[1752,3],[1757,1],[1762,3],[1767,1],[1770,0],[1772,2],[1777,0],[1782,2],[1787,0],[1790,1],[1792,3],[1797,1],[1800,0],[1802,2],[1807,0],[1810,1],[1812,3],[1815,2],[1817,0],[1820,1],[1822,3],[1827,1],[1830,0],[1832,2],[1837,0],[1842,2],[1847,0],[1852,2],[1857,0],[1862,2],[1867,0],[1872,2],[1877,0],[1882,2],[1887,0],[1890,1],[1892,3],[1897,1],[1900,0],[1902,2],[1907,0],[1912,2],[1917,0],[1920,1],[1922,3],[1927,1],[1930,0],[1932,2],[1937,0],[1942,2],[1947,0],[1952,2],[1957,0],[1962,2],[1967,0],[1972,2],[1977,0],[1980,1],[1982,3],[1987,1],[1990,0],[1992,2],[1997,0],[2002,2],[2007,0],[2012,2],[2017,0],[2022,2],[2027,0],[2032,2],[2037,0],[2040,1],[2042,3],[2047,1],[2050,0],[2052,2],[2057,0],[2062,2],[2067,0],[2072,2],[2077,0],[2082,2],[2087,0],[2092,2],[2097,0],[2102,2],[2107,0],[2112,2],[2117,0],[2120,1],[2122,3],[2127,1],[2130,0],[2132,2],[2137,0],[2140,1],[2142,3],[2147,1],[2150,0],[2152,2],[2157,0],[2160,1],[2162,3],[2167,1],[2172,3],[2177,1],[2180,0],[2182,2],[2185,3],[2195,2],[2197,0],[2200,1],[2202,3],[2207,1],[2210,0],[2212,2],[2217,0],[2222,2],[2227,0],[2232,2],[2237,0],[2242,2],[2247,0],[2252,2],[2257,0],[2262,2],[2267,0],[2272,2],[2277,0],[2282,2],[2287,0],[2290,1],[2292,3],[2297,1],[2300,0],[2302,2],[2307,0],[2312,2],[2317,0],[2320,1],[2322,3],[2327,1],[2332,3],[2337,1],[2340,0],[2342,2],[2347,0],[2350,1],[2352,3],[2357,1],[2360,0],[2362,2],[2367,0],[2372,2],[2377,0],[2380,1],[2382,3],[2385,2],[2387,0],[2390,1],[2392,3],[2397,1],[2400,0],[2402,2],[2407,0],[2412,2],[2417,0],[2422,2],[2427,0],[2432,2],[2437,0],[2442,2],[2447,0],[2452,2],[2457,0],[2460,1],[2462,3],[2467,1],[2470,0],[2472,2],[2477,0],[2482,2],[2487,0],[2492,2],[2497,0],[2502,2],[2507,0],[2512,2],[2517,0],[2522,2],[2527,0],[2530,1],[2532,3],[2537,1],[2540,0],[2542,2],[2547,0],[2550,1],[2552,3],[2557,1],[2560,0],[2562,2],[2567,0],[2572,2],[2577,0],[2580,1],[2582,3],[2587,1],[2590,0],[2592,2],[2597,0],[2600,1],[2602,3],[2607,1],[2610,0],[2612,2],[2617,0],[2622,2],[2627,0],[2632,2],[2637,0],[2642,2],[2647,0],[2652,2],[2657,0],[2662,2],[2667,0],[2670,1],[2672,3],[2677,1],[2680,0],[2682,2],[2687,0],[2690,1],[2692,3],[2697,1],[2700,0],[2702,2],[2707,0],[2712,2],[2717,0],[2720,1],[2722,3],[2727,1],[2732,3],[2737,1],[2740,0],[2742,2],[2747,0],[2752,2],[2757,0],[2760,1],[2762,3],[2767,1],[2770,0],[2772,2],[2777,0],[2780,1],[2782,3],[2787,1],[2790,0],[2792,2],[2797,0],[2800,1],[2802,3],[2807,1],[2810,0],[2812,2],[2817,0],[2820,1],[2822,3],[2827,1],[2830,0],[2832,2],[2837,0],[2842,2],[2847,0],[2852,2],[2857,0],[2860,1],[2862,3],[2867,1],[2870,0],[2872,2],[2877,0],[2880,1],[2882,3],[2887,1],[2892,3],[2897,1],[2900,0],[2902,2],[2907,0],[2910,1],[2912,3],[2917,1],[2920,0],[2922,2],[2927,0],[2932,2],[2937,0],[2942,2],[2947,0],[2950,1],[2952,3],[2957,1],[2962,3],[2967,1],[2970,0],[2972,2],[2977,0],[2982,2],[2987,0],[2992,2],[2997,0],[3000,1],[3002,3],[3007,1],[3010,0],[3012,2],[3017,0],[3020,1],[3022,3],[3027,1],[3032,3],[3037,1],[3040,0],[3042,2],[3047,0],[3050,1],[3052,3],[3057,1],[3060,0],[3062,2],[3067,0],[3072,2],[3077,0],[3080,1],[3082,3],[3087,1],[3090,0],[3092,2],[3097,0],[3100,1],[3102,3],[3107,1],[3110,0],[3112,2],[3115,3],[3125,2],[3127,0],[3130,1],[3132,3],[3137,1],[3140,0],[3142,2],[3147,0],[3152,2],[3157,0],[3162,2],[3167,0],[3172,2],[3177,0],[3182,2],[3187,0],[3192,2],[3197,0],[3202,2],[3207,0],[3212,2],[3217,0],[3222,2],[3227,0],[3232,2],[3237,0],[3240,1],[3242,3],[3247,1],[3250,0],[3252,2],[3257,0],[3262,2],[3267,0],[3272,2],[3277,0],[3282,2],[3287,0],[3290,1],[3292,3],[3297,1],[3300,0],[3302,2],[3307,0],[3312,2],[3317,0],[3322,2],[3327,0],[3332,2],[3337,0],[3342,2],[3347,0],[3352,2],[3357,0],[3362,2],[3367,0],[3372,2],[3377,0],[3382,2],[3387,0],[3392,2],[3397,0],[3402,2],[3407,0],[3412,2],[3417,0],[3422,2],[3427,0],[3432,2],[3437,0],[3442,2],[3447,0],[3450,1],[3452,3],[3457,1],[3462,3],[3467,1],[3472,3],[3477,1],[3480,0],[3482,2],[3487,0],[3492,2],[3497,0],[3502,2],[3507,0],[3512,2],[3517,0],[3522,2],[3527,0],[3530,1],[3532,3],[3537,1],[3542,3],[3547,1],[3550,0],[3552,2],[3557,0],[3562,2],[3567,0],[3572,2],[3577,0],[3582,2],[3585,3],[3595,2],[3597,0],[3600,1],[3602,3],[3607,1],[3610,0],[3612,2],[3617,0],[3622,2],[3627,0],[3632,2],[3637,0],[3642,2],[3647,0],[3652,2],[3657,0],[3662,2],[3667,0],[3672,2],[3677,0],[3682,2],[3687,0],[3692,2],[3697,0],[3702,2],[3707,0],[3712,2],[3717,0],[3722,2],[3727,0],[3732,2],[3737,0],[3742,2],[3747,0],[3750,1],[3752,3],[3757,1],[3762,3],[3767,1],[3770,0],[3772,2],[3777,0],[3782,2],[3785,3],[3795,2],[3797,0],[3800,1],[3802,3],[3807,1],[3810,0],[3812,2],[3817,0],[3822,2],[3827,0],[3832,2],[3837,0],[3842,2],[3847,0],[3852,2],[3857,0],[3860,1],[3862,3],[3867,1],[3870,0],[3872,2],[3877,0],[3882,2],[3887,0],[3892,2],[3895,3]],"expect":{"transactions":[{"index":1,"start_us":5,"end_us":475,"addr":64,"addr_hex":"0x40","kind":"read byte","command":32,"data_hex":"17","pec":"ok","ok":true},{"index":2,"start_us":485,"end_us":1045,"addr":64,"addr_hex":"0x40","kind":"read word","command":139,"data_hex":"00 06","pec":"ok","ok":true},{"index":3,"start_us":1055,"end_us":1615,"addr":64,"addr_hex":"0x40","kind":"read word","command":136,"data_hex":"E8 D3","pec":"ok","ok":true},{"index":4,"start_us":1625,"end_us":2185,"addr":64,"addr_hex":"0x40","kind":"read word","command":121,"data_hex":"41 08","pec":"ok","ok":true},{"index":5,"start_us":2195,"end_us":3115,"addr":64,"addr_hex":"0x40","kind":"block read","command":154,"data_hex":"50 53 55 2D 31","pec":"ok","ok":true},{"index":6,"start_us":3125,"end_us":3585,"addr":64,"addr_hex":"0x40","kind":"write word","command":33,"data_hex":"00 07","pec":"ok","ok":true},{"index":7,"start_us":3595,"end_us":3785,"addr":64,"addr_hex":"0x40","kind":"quick command","data_hex":"","pec":"bad","ok":false,"error":"bad PEC"},{"index":8,"start_us":3795,"end_us":3895,"addr":65,"addr_hex":"0x41","kind":"quick command","data_hex":"","pec":"none","ok":true}]}}]} From edcc7a702932f9b3b74fa828cee7ef458a015106 Mon Sep 17 00:00:00 2001 From: Edward Viaene Date: Fri, 20 Nov 2026 20:53:06 -0600 Subject: [PATCH 6/7] CAN FD: no dynamic stuff bit at the end of the data field, ACK tolerances, falling-edge resync; USB rate check Mirrors embeddedci-server ab728b0a (from an independent review against ISO 11898-1:2015). Co-Authored-By: Claude Opus 5.5 --- packages/embeddedci/CHANGELOG.md | 3 ++ .../src/embeddedci/benchpod/can_decode.py | 42 +++++++++++++++---- .../src/embeddedci/benchpod/usb_decode.py | 2 +- .../tests/testdata/can_decode_vectors.json | 2 +- 4 files changed, 38 insertions(+), 11 deletions(-) diff --git a/packages/embeddedci/CHANGELOG.md b/packages/embeddedci/CHANGELOG.md index 9b759fb..bfdf04c 100644 --- a/packages/embeddedci/CHANGELOG.md +++ b/packages/embeddedci/CHANGELOG.md @@ -17,6 +17,9 @@ Not released yet. ROM commands and search, CRC8, scratchpad temperature) and `smbus`/`pmbus` (SMBus protocols, PEC, PMBus command names, LINEAR11/LINEAR16 values, status bits). All locked to the server's decoders by shared vectors. +- CAN FD follows ISO 11898-1:2015 at the end of the data field (no dynamic stuff bit where the + CRC field's fixed stuff bit stands), accepts a late or two-bit ACK, and re-synchronizes on + falling edges only, so a transceiver that stretches dominant bits still decodes. ## 4.0.1 diff --git a/packages/embeddedci/src/embeddedci/benchpod/can_decode.py b/packages/embeddedci/src/embeddedci/benchpod/can_decode.py index 3e069b5..4cc1fc6 100644 --- a/packages/embeddedci/src/embeddedci/benchpod/can_decode.py +++ b/packages/embeddedci/src/embeddedci/benchpod/can_decode.py @@ -1,8 +1,8 @@ """CAN 2.0 and ISO CAN FD decoding from one LA channel (the transceiver's RXD, low = dominant). The Python mirror of the EmbeddedCI server's ``decode/can.go`` (held to it by -``can_decode_vectors.json``). Bits are sampled at the sample point and re-synchronized on edges -near a bit boundary; a frame starts on a falling edge after 10 or more recessive bits. Dynamic +``can_decode_vectors.json``). Bits are sampled at the sample point and re-synchronized on falling edges +near a bit boundary; a frame starts on a falling edge after 9.5 or more recessive bits. Dynamic stuffing runs from SOF through the data field (classic: through the CRC); CAN FD switches to the data bit rate at the BRS sample point and back at the CRC delimiter's, and its CRC17/CRC21 covers the dynamic stuff bits and the stuff count (ISO 11898-1:2015). @@ -59,10 +59,14 @@ def __init__(self, line, edges, pos, spb, sp): self.last_sp = 0.0 def bit(self) -> int: + # Only recessive-to-dominant edges re-synchronize: RXD stretches dominant bits. win = 0.35 * self.spb k = bisect.bisect_left(self.edges, int(math.ceil(self.pos - win))) - if k < len(self.edges) and self.edges[k] <= self.pos + win: - self.pos = float(self.edges[k]) + while k < len(self.edges) and self.edges[k] <= self.pos + win: + if self.line[self.edges[k]] == 0: + self.pos = float(self.edges[k]) + break + k += 1 s = self.pos + self.sp * self.spb self.last_sp = s idx = int(s) @@ -86,6 +90,9 @@ def __init__(self, r: _Reader): self.last = 0 self.stuffed = 0 self.err = "" + # For the bit just read: does it end the FD data field? Then no stuff bit follows it, the + # CRC field's fixed stuff bit stands instead (ISO 11898-1:2015, 10.5). + self.final = None def raw_bit(self) -> int: b = self.r.bit() @@ -102,7 +109,7 @@ def get(self) -> int: if self.run == 6: self.err = "stuff error" self.bits.append(b) - if self.run == 5: + if self.run == 5 and (self.final is None or not self.final(b)): s = self.raw_bit() if self.run == 6: self.err = "stuff error" @@ -166,7 +173,7 @@ def decode_can(words: Sequence[int], *, can: int, sample_rate_hz: float, bitrate edges = [i for i in range(1, len(line)) if line[i] != line[i - 1]] us = 1e6 / sample_rate_hz out: List[CanFrame] = [] - idle_need = 10 * spb_n + idle_need = 9.5 * spb_n last_rec = 0.0 if line and line[0] == 0: last_rec = math.inf @@ -250,7 +257,11 @@ def why() -> str: if f.brs: r.switch_rate(spb_d, sp_d) f.esi = c.field(1) == 1 - f.dlc = c.field(4) + f.dlc = c.field(3) << 1 + if f.fd and f.dlc == 0: + c.final = lambda b: b == 0 + f.dlc |= c.field(1) + c.final = None if end(): return fail(why()) f.len = FD_LEN[f.dlc] if f.fd else min(f.dlc, 8) @@ -258,9 +269,16 @@ def why() -> str: f.kind = "remote" f.len = 0 data = [] - for _ in range(f.len): + for k in range(f.len): if end(): break + if f.fd and k == f.len - 1: + v = c.field(7) << 1 + c.final = lambda b: True + v |= c.field(1) + c.final = None + data.append(v) + continue data.append(c.field(8)) if end(): return fail(why()) @@ -309,8 +327,14 @@ def why() -> str: f.error = _join(f.error, "CRC delimiter dominant") if f.brs: r.switch_rate(spb_n, sp_n) + # CAN FD: a second delimiter bit before the ACK, and an ACK up to two bits long. f.ack = r.bit() == 0 - if r.bit() != 1: + if not f.ack and f.fd: + f.ack = r.bit() == 0 + nxt = r.bit() + if f.ack and f.fd and nxt == 0: + nxt = r.bit() + if nxt != 1: f.error = _join(f.error, "ACK delimiter dominant") for _ in range(7): if r.ended: diff --git a/packages/embeddedci/src/embeddedci/benchpod/usb_decode.py b/packages/embeddedci/src/embeddedci/benchpod/usb_decode.py index c05cdfc..e90ea08 100644 --- a/packages/embeddedci/src/embeddedci/benchpod/usb_decode.py +++ b/packages/embeddedci/src/embeddedci/benchpod/usb_decode.py @@ -156,7 +156,7 @@ def decode_usb(words: Sequence[int], *, dp: int, dm: int, sample_rate_hz: float, raise ValueError(f"usb speed must be full, low or auto, got {speed!r}") bps = LOW_SPEED_BPS if sp == "low" else FULL_SPEED_BPS spb = sample_rate_hz / bps - if spb < 2: + if spb < 2.5: # below ~2.7 samples a bit the run lengths round wrong need = "6 MS/s" if sp == "low" else "48 MS/s" raise ValueError(f"sample rate {sample_rate_hz:.0f} Hz is too low for {sp}-speed USB: " f"capture at {need} or more") diff --git a/packages/embeddedci/tests/testdata/can_decode_vectors.json b/packages/embeddedci/tests/testdata/can_decode_vectors.json index 093bb40..b86942c 100644 --- a/packages/embeddedci/tests/testdata/can_decode_vectors.json +++ b/packages/embeddedci/tests/testdata/can_decode_vectors.json @@ -1 +1 @@ -{"_comment":"Shared can decode parity vectors: synthetic captures as run-length edges [sample, word] from sample 0, the channels and options, and what the Go decoder returns (the /analyzer/decode response without protocol). Verified by the Go server and the Python SDK.","cases":[{"name":"fd_500k_2m_48msps","protocol":"can","sample_rate_hz":48000000,"channels":{"can":4},"options":{"bitrate":500000,"data_bitrate":2000000},"count":88607,"edges":[[0,8],[1921,0],[2209,8],[2305,0],[2496,8],[2592,0],[2881,8],[3072,0],[3552,8],[3840,0],[4128,8],[4224,0],[4513,8],[4608,0],[4800,8],[4896,0],[5184,8],[5280,0],[5568,8],[5761,0],[5952,8],[6336,0],[6528,8],[6624,0],[6721,8],[7104,0],[7200,8],[7393,0],[7488,8],[7681,0],[7777,8],[8832,0],[8928,8],[9408,0],[9505,8],[9985,0],[10080,8],[10176,0],[10464,8],[10561,0],[11040,8],[11136,0],[11616,8],[11712,0],[12192,8],[12288,0],[12768,8],[12864,0],[13344,8],[13441,0],[13920,8],[14017,0],[14496,8],[14593,0],[15072,8],[15169,0],[15648,8],[15744,0],[16225,8],[16320,0],[16800,8],[16897,0],[17377,8],[17473,0],[17953,8],[18048,0],[18336,8],[18433,0],[18529,8],[18625,0],[18721,8],[18816,0],[19008,8],[19105,0],[19489,8],[19776,0],[19873,8],[20929,0],[21024,8],[21217,0],[21504,8],[21697,0],[21792,8],[21984,0],[22081,8],[22369,0],[22464,8],[22849,0],[23137,8],[23232,0],[23521,8],[23617,0],[24096,8],[24192,0],[24576,8],[24768,0],[25248,8],[25345,0],[25440,8],[25536,0],[25920,8],[26016,0],[26497,8],[26592,0],[27073,8],[27361,0],[27553,8],[27744,0],[27841,8],[28320,0],[28416,8],[28801,0],[28896,8],[28992,0],[29088,8],[30144,0],[30241,8],[30336,0],[30624,8],[30721,0],[30817,8],[30912,0],[31009,8],[31200,0],[31297,8],[31392,0],[31873,8],[31968,0],[32064,8],[32160,0],[32353,8],[32449,0],[32544,8],[32640,0],[32737,8],[32833,0],[32928,8],[33121,0],[33216,8],[33408,0],[33505,8],[33600,0],[33697,8],[34752,0],[35040,8],[35136,0],[35616,8],[35712,0],[36193,8],[36384,0],[36480,8],[36558,0],[36582,8],[36606,0],[36655,8],[36679,0],[36798,8],[36823,0],[36870,8],[36894,0],[37014,8],[37039,0],[37063,8],[37086,0],[37206,8],[37230,0],[37278,8],[37326,0],[37446,8],[37494,0],[37614,8],[37638,0],[37686,8],[37710,0],[37734,8],[37759,0],[37879,8],[37950,0],[38071,8],[38095,0],[38119,8],[38190,0],[38286,8],[38310,0],[38430,8],[38455,0],[38502,8],[38526,0],[38574,8],[38598,0],[38694,8],[38718,0],[38742,8],[38766,0],[38886,8],[38935,0],[38959,8],[39006,0],[39103,8],[39150,0],[39198,8],[39223,0],[39246,8],[39270,0],[39295,8],[39318,0],[39439,8],[39559,0],[39630,8],[39678,0],[39727,8],[39750,0],[39775,8],[39798,0],[39822,8],[39888,0],[39984,8],[41041,0],[41520,8],[41617,0],[42001,8],[42192,0],[42288,8],[42576,0],[42672,8],[42769,0],[42864,8],[43248,0],[43441,8],[43632,0],[43729,8],[44112,0],[44305,8],[44401,0],[44496,8],[44574,0],[44599,8],[44695,0],[44815,8],[44839,0],[44959,8],[44982,0],[45055,8],[45126,0],[45223,8],[45295,0],[45391,8],[45415,0],[45438,8],[45462,0],[45486,8],[45510,0],[45583,8],[45655,0],[45751,8],[45775,0],[45846,8],[45895,0],[45943,8],[45966,0],[45990,8],[46015,0],[46039,8],[46062,0],[46135,8],[46182,0],[46255,8],[46278,0],[46327,8],[46399,0],[46518,8],[46639,0],[46662,8],[46710,0],[46734,8],[46759,0],[46831,8],[46878,0],[46927,8],[46950,0],[46998,8],[47047,0],[47070,8],[47094,0],[47118,8],[47143,0],[47166,8],[47190,0],[47215,8],[47238,0],[47310,8],[47335,0],[47359,8],[47407,0],[47430,8],[47478,0],[47502,8],[47551,0],[47622,8],[47647,0],[47694,8],[47742,0],[47766,8],[47791,0],[47838,8],[47862,0],[47886,8],[47958,0],[48078,8],[48174,0],[48199,8],[48271,0],[48294,8],[48415,0],[48438,8],[48463,0],[48486,8],[48511,0],[48607,8],[48631,0],[48655,8],[48702,0],[48775,8],[48823,0],[48870,8],[48895,0],[48943,8],[48966,0],[49014,8],[49087,0],[49135,8],[49182,0],[49206,8],[49231,0],[49254,8],[49278,0],[49302,8],[49327,0],[49423,8],[49470,0],[49495,8],[49519,0],[49542,8],[49566,0],[49638,8],[49662,0],[49687,8],[49710,0],[49735,8],[49854,0],[49902,8],[49950,0],[49975,8],[50022,0],[50046,8],[50070,0],[50094,8],[50191,0],[50214,8],[50286,0],[50358,8],[50383,0],[50430,8],[50479,0],[50527,8],[50550,0],[50574,8],[50670,0],[50694,8],[50719,0],[50767,8],[50790,0],[50814,8],[50862,0],[50887,8],[50934,0],[50983,8],[51078,0],[51198,8],[51295,0],[51343,8],[51463,0],[51486,8],[51511,0],[51534,8],[51606,0],[51630,8],[51726,0],[51750,8],[51775,0],[51798,8],[51919,0],[51943,8],[51991,0],[52110,8],[52135,0],[52207,8],[52254,0],[52350,8],[52374,0],[52399,8],[52422,0],[52518,8],[52542,0],[52615,8],[52639,0],[52711,8],[52758,0],[52879,8],[52902,0],[52927,8],[53046,0],[53118,8],[53143,0],[53190,8],[53238,0],[53311,8],[53334,0],[53358,8],[53406,0],[53431,8],[53454,0],[53502,8],[53550,0],[53575,8],[53599,0],[53694,8],[53767,0],[53790,8],[53838,0],[53863,8],[53887,0],[53983,8],[54006,0],[54054,8],[54078,0],[54127,8],[54151,0],[54198,8],[54222,0],[54247,8],[54270,0],[54295,8],[54319,0],[54439,8],[54487,0],[54510,8],[54534,0],[54559,8],[54630,0],[54654,8],[54678,0],[54702,8],[54799,0],[54847,8],[54895,0],[54942,8],[54966,0],[54990,8],[55014,0],[55039,8],[55086,0],[55111,8],[55158,0],[55231,8],[55303,0],[55350,8],[55398,0],[55422,8],[55519,0],[55542,8],[55567,0],[55591,8],[55615,0],[55735,8],[55758,0],[55782,8],[55830,0],[55902,8],[55927,0],[55999,8],[56022,0],[56095,8],[56214,0],[56286,8],[56311,0],[56334,8],[56382,0],[56406,8],[56430,0],[56478,8],[56550,0],[56574,8],[56622,0],[56647,8],[56671,0],[56718,8],[56743,0],[56791,8],[56814,0],[56838,8],[56862,0],[56887,8],[56911,0],[56935,8],[57006,0],[57031,8],[57078,0],[57126,8],[57150,0],[57174,8],[57198,0],[57222,8],[57294,0],[57343,8],[57366,0],[57438,8],[57487,0],[57510,8],[57534,0],[57558,8],[57583,0],[57606,8],[57654,0],[57679,8],[57726,0],[57774,8],[57822,0],[57846,8],[57895,0],[57967,8],[58062,0],[58086,8],[58110,0],[58134,8],[58176,0],[58272,8],[59329,0],[59521,8],[59616,0],[60096,8],[60192,0],[60672,8],[60768,0],[60864,8],[60961,0],[61440,8],[61920,0],[62016,8],[62496,0],[62592,8],[63072,0],[63169,8],[63649,0],[63744,8],[64225,0],[64320,8],[64512,0],[64992,8],[65280,0],[65376,8],[65472,0],[65568,8],[65761,0],[65953,8],[66048,0],[66144,8],[66432,0],[66528,8],[66624,0],[66816,8],[66912,0],[67105,8],[67201,0],[67296,8],[68353,0],[68545,8],[68736,0],[68928,8],[69025,0],[69408,8],[69504,0],[69984,8],[70080,0],[70176,8],[70368,0],[70465,8],[70560,0],[70657,8],[70752,0],[70849,8],[70944,0],[71041,8],[71136,0],[71328,8],[71521,0],[71616,8],[71712,0],[72001,8],[72192,0],[72288,8],[72384,0],[72480,8],[73729,0],[74209,8],[74401,0],[74496,8],[74592,0],[74689,8],[74784,0],[74881,8],[74976,0],[75457,8],[75648,0],[76129,8],[76225,0],[76513,8],[76609,0],[77088,8],[77185,0],[77281,8],[77376,0],[77569,8],[77664,0],[77952,8],[78144,0],[78432,8],[78529,0],[78913,8],[79008,0],[79104,8],[80161,0],[80544,8],[80928,0],[81889,8],[82944,0],[83425,8],[83521,0],[84001,8],[84096,0],[84193,8],[84289,0],[84769,8],[84865,0],[84961,8],[85056,0],[85152,8],[85248,0],[85632,8],[85728,0],[85825,8],[85920,0],[86400,8],[86592,0],[86688,8],[86784,0],[87168,8],[87264,0],[87360,8],[87457,0],[87552,8]],"expect":{"frames":[{"index":1,"start_us":40.02083333333333,"end_us":178.02083333333331,"kind":"data","id":291,"id_hex":"0x123","extended":false,"fd":false,"brs":false,"esi":false,"dlc":3,"len":3,"data_hex":"11 22 33","crc":"0x65ED","ack":true,"stuff_bits":1,"ok":true},{"index":2,"start_us":184,"end_us":430.0208333333333,"kind":"data","id":2047,"id_hex":"0x7FF","extended":false,"fd":false,"brs":false,"esi":false,"dlc":8,"len":8,"data_hex":"00 00 00 00 00 00 00 00","crc":"0x2A43","ack":true,"stuff_bits":15,"ok":true},{"index":3,"start_us":436.0208333333333,"end_us":622,"kind":"data","id":417001744,"id_hex":"0x18DAF110","extended":true,"fd":false,"brs":false,"esi":false,"dlc":3,"len":3,"data_hex":"02 10 03","crc":"0x1BFE","ack":true,"stuff_bits":5,"ok":true},{"index":4,"start_us":628,"end_us":718.0208333333333,"kind":"remote","id":1110,"id_hex":"0x456","extended":false,"fd":false,"brs":false,"esi":false,"dlc":0,"len":0,"data_hex":"","crc":"0x4AB6","ack":true,"stuff_bits":1,"ok":true},{"index":5,"start_us":724,"end_us":849,"kind":"data","id":256,"id_hex":"0x100","extended":false,"fd":true,"brs":true,"esi":false,"dlc":9,"len":12,"data_hex":"01 02 03 04 05 06 07 08 09 0A 0B 0C","crc":"0x001E6B","ack":true,"stuff_bits":11,"ok":true},{"index":6,"start_us":855.0208333333333,"end_us":1230,"kind":"data","id":1752286,"id_hex":"0x001ABCDE","extended":true,"fd":true,"brs":true,"esi":false,"dlc":15,"len":64,"data_hex":"00 07 0E 15 1C 23 2A 31 38 3F 46 4D 54 5B 62 69 70 77 7E 85 8C 93 9A A1 A8 AF B6 BD C4 CB D2 D9 E0 E7 EE F5 FC 03 0A 11 18 1F 26 2D 34 3B 42 49 50 57 5E 65 6C 73 7A 81 88 8F 96 9D A4 AB B2 B9","crc":"0x156D1C","ack":true,"stuff_bits":17,"ok":true},{"index":7,"start_us":1236.0208333333333,"end_us":1418,"kind":"data","id":512,"id_hex":"0x200","extended":false,"fd":true,"brs":false,"esi":false,"dlc":3,"len":3,"data_hex":"FF FF FF","crc":"0x01B8F2","ack":true,"stuff_bits":8,"ok":true},{"index":8,"start_us":1424.0208333333333,"end_us":1530,"kind":"data","id":801,"id_hex":"0x321","extended":false,"fd":false,"brs":false,"esi":false,"dlc":1,"len":1,"data_hex":"AA","crc":"0x4D1A","ack":false,"stuff_bits":1,"ok":false,"error":"no ACK"},{"index":9,"start_us":1536.0208333333333,"end_us":1664,"kind":"data","id":85,"id_hex":"0x055","extended":false,"fd":false,"brs":false,"esi":false,"dlc":2,"len":2,"data_hex":"01 02","crc":"0x2310","ack":true,"stuff_bits":4,"ok":false,"error":"bad CRC"},{"index":10,"start_us":1670.0208333333333,"end_us":1708.0208333333333,"kind":"error","id":240,"id_hex":"0x0F0","extended":false,"fd":false,"brs":false,"esi":false,"dlc":0,"len":0,"data_hex":"","crc":"","ack":false,"stuff_bits":1,"ok":false,"error":"stuff error, error frame"},{"index":11,"start_us":1728,"end_us":1840,"kind":"data","id":1,"id_hex":"0x001","extended":false,"fd":false,"brs":false,"esi":false,"dlc":1,"len":1,"data_hex":"42","crc":"0x4142","ack":true,"stuff_bits":4,"ok":true}]}},{"name":"classic_125k_4msps","protocol":"can","sample_rate_hz":4000000,"channels":{"can":4},"options":{"bitrate":125000},"count":46431,"edges":[[0,8],[640,0],[736,8],[767,0],[832,8],[865,0],[961,8],[1024,0],[1184,8],[1280,0],[1376,8],[1409,0],[1505,8],[1536,0],[1600,8],[1633,0],[1729,8],[1760,0],[1855,8],[1920,0],[1985,8],[2112,0],[2176,8],[2208,0],[2240,8],[2368,0],[2401,8],[2465,0],[2496,8],[2560,0],[2592,8],[2945,0],[2976,8],[3136,0],[3168,8],[3329,0],[3361,8],[3393,0],[3488,8],[3520,0],[3680,8],[3712,0],[3872,8],[3904,0],[4064,8],[4096,0],[4255,8],[4288,0],[4448,8],[4481,0],[4640,8],[4672,0],[4832,8],[4864,0],[5023,8],[5057,0],[5216,8],[5248,0],[5407,8],[5441,0],[5600,8],[5632,0],[5793,8],[5825,0],[5984,8],[6016,0],[6112,8],[6145,0],[6176,8],[6209,0],[6240,8],[6272,0],[6337,8],[6368,0],[6495,8],[6593,0],[6624,8],[6976,0],[7008,8],[7072,0],[7168,8],[7233,0],[7265,8],[7329,0],[7361,8],[7456,0],[7489,8],[7616,0],[7713,8],[7743,0],[7840,8],[7872,0],[8032,8],[8064,0],[8193,8],[8256,0],[8416,8],[8449,0],[8481,8],[8512,0],[8640,8],[8672,0],[8832,8],[8865,0],[9024,8],[9121,0],[9185,8],[9247,0],[9280,8],[9441,0],[9473,8],[9601,0],[9633,8],[9665,0],[9697,8],[10048,0],[10079,8],[10112,0],[10209,8],[10240,0],[10272,8],[10305,0],[10336,8],[10400,0],[10433,8],[10464,0],[10624,8],[10657,0],[10687,8],[10720,0],[10785,8],[10816,0],[10849,8],[10879,0],[10912,8],[10945,0],[10977,8],[11040,0],[11072,8],[11137,0],[11168,8],[11200,0],[11233,8],[11584,0],[11681,8],[11712,0],[11872,8],[11904,0],[12063,8],[12128,0],[12160,8],[12192,0],[12224,8],[12257,0],[12321,8],[12353,0],[12511,8],[12544,0],[12609,8],[12640,0],[12800,8],[12832,0],[12865,8],[12896,0],[13056,8],[13089,0],[13151,8],[13217,0],[13376,8],[13441,0],[13600,8],[13632,0],[13697,8],[13727,0],[13761,8],[13792,0],[13952,8],[14048,0],[14209,8],[14240,0],[14272,8],[14369,0],[14496,8],[14527,0],[14689,8],[14720,0],[14784,8],[14816,0],[14881,8],[14912,0],[15040,8],[15071,0],[15105,8],[15136,0],[15296,8],[15361,0],[15392,8],[15456,0],[15584,8],[15649,0],[15712,8],[15744,0],[15775,8],[15808,0],[15841,8],[15872,0],[16033,8],[16192,0],[16287,8],[16352,0],[16417,8],[16448,0],[16480,8],[16513,0],[16544,8],[16608,0],[16641,8],[16993,0],[17152,8],[17185,0],[17312,8],[17377,0],[17408,8],[17504,0],[17537,8],[17567,0],[17599,8],[17729,0],[17792,8],[17857,0],[17888,8],[18017,0],[18081,8],[18112,0],[18145,8],[18176,0],[18208,8],[18336,0],[18496,8],[18529,0],[18687,8],[18719,0],[18817,8],[18912,0],[19040,8],[19137,0],[19264,8],[19296,0],[19328,8],[19360,0],[19393,8],[19424,0],[19521,8],[19616,0],[19745,8],[19775,0],[19873,8],[19936,0],[20001,8],[20032,0],[20064,8],[20097,0],[20128,8],[20160,0],[20256,8],[20321,0],[20416,8],[20447,0],[20512,8],[20609,0],[20768,8],[20928,0],[20961,8],[21024,0],[21056,8],[21089,0],[21185,8],[21248,0],[21311,8],[21345,0],[21409,8],[21472,0],[21505,8],[21535,0],[21569,8],[21599,0],[21632,8],[21664,0],[21696,8],[21729,0],[21824,8],[21856,0],[21889,8],[21951,0],[21984,8],[22048,0],[22080,8],[22144,0],[22240,8],[22272,0],[22337,8],[22401,0],[22432,8],[22464,0],[22529,8],[22561,0],[22593,8],[22688,0],[22847,8],[22976,0],[23008,8],[23105,0],[23136,8],[23297,0],[23329,8],[23361,0],[23393,8],[23425,0],[23553,8],[23585,0],[23616,8],[23680,0],[23777,8],[23840,0],[23904,8],[23937,0],[24001,8],[24033,0],[24096,8],[24193,0],[24255,8],[24320,0],[24352,8],[24384,0],[24416,8],[24447,0],[24481,8],[24512,0],[24641,8],[24703,0],[24736,8],[24768,0],[24800,8],[24833,0],[24928,8],[24960,0],[24993,8],[25024,0],[25057,8],[25216,0],[25280,8],[25344,0],[25375,8],[25441,0],[25471,8],[25505,0],[25537,8],[25665,0],[25696,8],[25791,0],[25889,8],[25921,0],[25983,8],[26049,0],[26112,8],[26145,0],[26177,8],[26304,0],[26337,8],[26369,0],[26432,8],[26465,0],[26497,8],[26560,0],[26592,8],[26656,0],[26721,8],[26849,0],[27008,8],[27136,0],[27201,8],[27360,0],[27392,8],[27423,0],[27457,8],[27553,0],[27584,8],[27713,0],[27744,8],[27776,0],[27808,8],[27968,0],[28001,8],[28064,0],[28224,8],[28255,0],[28352,8],[28416,0],[28544,8],[28577,0],[28608,8],[28639,0],[28769,8],[28800,0],[28897,8],[28928,0],[29025,8],[29088,0],[29248,8],[29279,0],[29312,8],[29472,0],[29569,8],[29599,0],[29664,8],[29729,0],[29825,8],[29857,0],[29889,8],[29953,0],[29984,8],[30016,0],[30080,8],[30144,0],[30177,8],[30208,0],[30337,8],[30433,0],[30463,8],[30528,0],[30560,8],[30592,0],[30720,8],[30752,0],[30817,8],[30849,0],[30911,8],[30944,0],[31008,8],[31041,0],[31073,8],[31105,0],[31136,8],[31168,0],[31328,8],[31392,0],[31424,8],[31455,0],[31487,8],[31584,0],[31617,8],[31649,0],[31680,8],[31807,0],[31872,8],[31937,0],[31999,8],[32033,0],[32065,8],[32095,0],[32128,8],[32193,0],[32224,8],[32288,0],[32385,8],[32481,0],[32545,8],[32609,0],[32640,8],[32768,0],[32801,8],[32833,0],[32864,8],[32895,0],[33057,8],[33088,0],[33120,8],[33185,0],[33281,8],[33312,0],[33408,8],[33441,0],[33537,8],[33697,0],[33792,8],[33825,0],[33856,8],[33921,0],[33953,8],[33983,0],[34048,8],[34145,0],[34176,8],[34240,0],[34273,8],[34305,0],[34369,8],[34400,0],[34465,8],[34497,0],[34528,8],[34561,0],[34592,8],[34624,0],[34657,8],[34752,0],[34784,8],[34848,0],[34913,8],[34945,0],[34976,8],[35008,0],[35040,8],[35137,0],[35201,8],[35232,0],[35328,8],[35391,0],[35424,8],[35456,0],[35488,8],[35521,0],[35553,8],[35617,0],[35648,8],[35713,0],[35776,8],[35840,0],[35873,8],[35936,0],[36032,8],[36160,0],[36192,8],[36225,0],[36257,8],[36289,0],[36320,8],[36672,0],[36736,8],[36768,0],[36928,8],[36961,0],[37119,8],[37153,0],[37184,8],[37216,0],[37376,8],[37536,0],[37569,8],[37728,0],[37761,8],[37920,0],[37952,8],[38112,0],[38145,8],[38304,0],[38337,8],[38401,0],[38560,8],[38656,0],[38689,8],[38720,0],[38753,8],[38816,0],[38881,8],[38912,0],[38944,8],[39040,0],[39072,8],[39105,0],[39168,8],[39200,0],[39265,8],[39296,0],[39328,8],[39680,0],[39745,8],[39809,0],[39872,8],[39905,0],[40032,8],[40064,0],[40225,8],[40257,0],[40288,8],[40352,0],[40384,8],[40417,0],[40447,8],[40480,0],[40512,8],[40545,0],[40576,8],[40608,0],[40672,8],[40736,0],[40768,8],[40801,0],[40895,8],[40961,0],[40993,8],[41025,0],[41056,8],[41472,0],[41633,8],[41696,0],[41728,8],[41760,0],[41792,8],[41824,0],[41856,8],[41889,0],[42049,8],[42112,0],[42272,8],[42305,0],[42400,8],[42432,0],[42593,8],[42625,0],[42657,8],[42688,0],[42753,8],[42784,0],[42881,8],[42943,0],[43040,8],[43073,0],[43200,8],[43233,0],[43264,8],[43617,0],[43744,8],[43873,0],[44192,8],[44544,0],[44704,8],[44737,0],[44896,8],[44928,0],[44961,8],[44993,0],[45153,8],[45184,0],[45217,8],[45248,0],[45281,8],[45313,0],[45441,8],[45472,0],[45505,8],[45537,0],[45697,8],[45761,0],[45792,8],[45823,0],[45953,8],[45984,0],[46017,8],[46049,0],[46081,8]],"expect":{"frames":[{"index":1,"start_us":160,"end_us":712,"kind":"data","id":291,"id_hex":"0x123","extended":false,"fd":false,"brs":false,"esi":false,"dlc":3,"len":3,"data_hex":"11 22 33","crc":"0x65ED","ack":true,"stuff_bits":1,"ok":true},{"index":2,"start_us":736.25,"end_us":1720,"kind":"data","id":2047,"id_hex":"0x7FF","extended":false,"fd":false,"brs":false,"esi":false,"dlc":8,"len":8,"data_hex":"00 00 00 00 00 00 00 00","crc":"0x2A43","ack":true,"stuff_bits":15,"ok":true},{"index":3,"start_us":1744,"end_us":2488.25,"kind":"data","id":417001744,"id_hex":"0x18DAF110","extended":true,"fd":false,"brs":false,"esi":false,"dlc":3,"len":3,"data_hex":"02 10 03","crc":"0x1BFE","ack":true,"stuff_bits":5,"ok":true},{"index":4,"start_us":2512,"end_us":2872.25,"kind":"remote","id":1110,"id_hex":"0x456","extended":false,"fd":false,"brs":false,"esi":false,"dlc":0,"len":0,"data_hex":"","crc":"0x4AB6","ack":true,"stuff_bits":1,"ok":true},{"index":5,"start_us":2896,"end_us":4224.25,"kind":"data","id":256,"id_hex":"0x100","extended":false,"fd":true,"brs":true,"esi":false,"dlc":9,"len":12,"data_hex":"01 02 03 04 05 06 07 08 09 0A 0B 0C","crc":"0x001E6B","ack":true,"stuff_bits":11,"ok":true},{"index":6,"start_us":4248.25,"end_us":9144,"kind":"data","id":1752286,"id_hex":"0x001ABCDE","extended":true,"fd":true,"brs":true,"esi":false,"dlc":15,"len":64,"data_hex":"00 07 0E 15 1C 23 2A 31 38 3F 46 4D 54 5B 62 69 70 77 7E 85 8C 93 9A A1 A8 AF B6 BD C4 CB D2 D9 E0 E7 EE F5 FC 03 0A 11 18 1F 26 2D 34 3B 42 49 50 57 5E 65 6C 73 7A 81 88 8F 96 9D A4 AB B2 B9","crc":"0x156D1C","ack":true,"stuff_bits":17,"ok":true},{"index":7,"start_us":9168,"end_us":9896,"kind":"data","id":512,"id_hex":"0x200","extended":false,"fd":true,"brs":false,"esi":false,"dlc":3,"len":3,"data_hex":"FF FF FF","crc":"0x01B8F2","ack":true,"stuff_bits":8,"ok":true},{"index":8,"start_us":9920,"end_us":10344,"kind":"data","id":801,"id_hex":"0x321","extended":false,"fd":false,"brs":false,"esi":false,"dlc":1,"len":1,"data_hex":"AA","crc":"0x4D1A","ack":false,"stuff_bits":1,"ok":false,"error":"no ACK"},{"index":9,"start_us":10368,"end_us":10880,"kind":"data","id":85,"id_hex":"0x055","extended":false,"fd":false,"brs":false,"esi":false,"dlc":2,"len":2,"data_hex":"01 02","crc":"0x2310","ack":true,"stuff_bits":4,"ok":false,"error":"bad CRC"},{"index":10,"start_us":10904.25,"end_us":11056,"kind":"error","id":240,"id_hex":"0x0F0","extended":false,"fd":false,"brs":false,"esi":false,"dlc":0,"len":0,"data_hex":"","crc":"","ack":false,"stuff_bits":1,"ok":false,"error":"stuff error, error frame"},{"index":11,"start_us":11136,"end_us":11584.25,"kind":"data","id":1,"id_hex":"0x001","extended":false,"fd":false,"brs":false,"esi":false,"dlc":1,"len":1,"data_hex":"42","crc":"0x4142","ack":true,"stuff_bits":4,"ok":true}]}}]} +{"_comment":"Shared can decode parity vectors: synthetic captures as run-length edges [sample, word] from sample 0, the channels and options, and what the Go decoder returns (the /analyzer/decode response without protocol). Verified by the Go server and the Python SDK.","cases":[{"name":"fd_500k_2m_48msps","protocol":"can","sample_rate_hz":48000000,"channels":{"can":4},"options":{"bitrate":500000,"data_bitrate":2000000},"count":88607,"edges":[[0,8],[1921,0],[2209,8],[2305,0],[2496,8],[2592,0],[2881,8],[3072,0],[3552,8],[3840,0],[4128,8],[4224,0],[4513,8],[4608,0],[4800,8],[4896,0],[5184,8],[5280,0],[5568,8],[5761,0],[5952,8],[6336,0],[6528,8],[6624,0],[6721,8],[7104,0],[7200,8],[7393,0],[7488,8],[7681,0],[7777,8],[8832,0],[8928,8],[9408,0],[9505,8],[9985,0],[10080,8],[10176,0],[10464,8],[10561,0],[11040,8],[11136,0],[11616,8],[11712,0],[12192,8],[12288,0],[12768,8],[12864,0],[13344,8],[13441,0],[13920,8],[14017,0],[14496,8],[14593,0],[15072,8],[15169,0],[15648,8],[15744,0],[16225,8],[16320,0],[16800,8],[16897,0],[17377,8],[17473,0],[17953,8],[18048,0],[18336,8],[18433,0],[18529,8],[18625,0],[18721,8],[18816,0],[19008,8],[19105,0],[19489,8],[19776,0],[19873,8],[20929,0],[21024,8],[21217,0],[21504,8],[21697,0],[21792,8],[21984,0],[22081,8],[22369,0],[22464,8],[22849,0],[23137,8],[23232,0],[23521,8],[23617,0],[24096,8],[24192,0],[24576,8],[24768,0],[25248,8],[25345,0],[25440,8],[25536,0],[25920,8],[26016,0],[26497,8],[26592,0],[27073,8],[27361,0],[27553,8],[27744,0],[27841,8],[28320,0],[28416,8],[28801,0],[28896,8],[28992,0],[29088,8],[30144,0],[30241,8],[30336,0],[30624,8],[30721,0],[30817,8],[30912,0],[31009,8],[31200,0],[31297,8],[31392,0],[31873,8],[31968,0],[32064,8],[32160,0],[32353,8],[32449,0],[32544,8],[32640,0],[32737,8],[32833,0],[32928,8],[33121,0],[33216,8],[33408,0],[33505,8],[33600,0],[33697,8],[34752,0],[35040,8],[35136,0],[35616,8],[35712,0],[36193,8],[36384,0],[36480,8],[36558,0],[36582,8],[36606,0],[36655,8],[36679,0],[36798,8],[36823,0],[36870,8],[36894,0],[37014,8],[37039,0],[37063,8],[37086,0],[37206,8],[37230,0],[37278,8],[37326,0],[37446,8],[37494,0],[37614,8],[37638,0],[37686,8],[37710,0],[37734,8],[37759,0],[37879,8],[37950,0],[38071,8],[38095,0],[38119,8],[38190,0],[38286,8],[38310,0],[38430,8],[38455,0],[38502,8],[38526,0],[38574,8],[38598,0],[38694,8],[38718,0],[38742,8],[38766,0],[38886,8],[38935,0],[38959,8],[39006,0],[39103,8],[39150,0],[39198,8],[39223,0],[39246,8],[39270,0],[39295,8],[39318,0],[39439,8],[39559,0],[39630,8],[39678,0],[39727,8],[39750,0],[39775,8],[39798,0],[39822,8],[39888,0],[39984,8],[41041,0],[41520,8],[41617,0],[42001,8],[42192,0],[42288,8],[42576,0],[42672,8],[42769,0],[42864,8],[43248,0],[43441,8],[43632,0],[43729,8],[44112,0],[44305,8],[44401,0],[44496,8],[44574,0],[44599,8],[44695,0],[44815,8],[44839,0],[44959,8],[44982,0],[45055,8],[45126,0],[45223,8],[45295,0],[45391,8],[45415,0],[45438,8],[45462,0],[45486,8],[45510,0],[45583,8],[45655,0],[45751,8],[45775,0],[45846,8],[45895,0],[45943,8],[45966,0],[45990,8],[46015,0],[46039,8],[46062,0],[46135,8],[46182,0],[46255,8],[46278,0],[46327,8],[46399,0],[46518,8],[46639,0],[46662,8],[46710,0],[46734,8],[46759,0],[46831,8],[46878,0],[46927,8],[46950,0],[46998,8],[47047,0],[47070,8],[47094,0],[47118,8],[47143,0],[47166,8],[47190,0],[47215,8],[47238,0],[47310,8],[47335,0],[47359,8],[47407,0],[47430,8],[47478,0],[47502,8],[47551,0],[47622,8],[47647,0],[47694,8],[47742,0],[47766,8],[47791,0],[47838,8],[47862,0],[47886,8],[47958,0],[48078,8],[48174,0],[48199,8],[48271,0],[48294,8],[48415,0],[48438,8],[48463,0],[48486,8],[48511,0],[48607,8],[48631,0],[48655,8],[48702,0],[48775,8],[48823,0],[48870,8],[48895,0],[48943,8],[48966,0],[49014,8],[49087,0],[49135,8],[49182,0],[49206,8],[49231,0],[49254,8],[49278,0],[49302,8],[49327,0],[49423,8],[49470,0],[49495,8],[49519,0],[49542,8],[49566,0],[49638,8],[49662,0],[49687,8],[49710,0],[49735,8],[49854,0],[49902,8],[49950,0],[49975,8],[50022,0],[50046,8],[50070,0],[50094,8],[50191,0],[50214,8],[50286,0],[50358,8],[50383,0],[50430,8],[50479,0],[50527,8],[50550,0],[50574,8],[50670,0],[50694,8],[50719,0],[50767,8],[50790,0],[50814,8],[50862,0],[50887,8],[50934,0],[50983,8],[51078,0],[51198,8],[51295,0],[51343,8],[51463,0],[51486,8],[51511,0],[51534,8],[51606,0],[51630,8],[51726,0],[51750,8],[51775,0],[51798,8],[51919,0],[51943,8],[51991,0],[52110,8],[52135,0],[52207,8],[52254,0],[52350,8],[52374,0],[52399,8],[52422,0],[52518,8],[52542,0],[52615,8],[52639,0],[52711,8],[52758,0],[52879,8],[52902,0],[52927,8],[53046,0],[53118,8],[53143,0],[53190,8],[53238,0],[53311,8],[53334,0],[53358,8],[53406,0],[53431,8],[53454,0],[53502,8],[53550,0],[53575,8],[53599,0],[53694,8],[53767,0],[53790,8],[53838,0],[53863,8],[53887,0],[53983,8],[54006,0],[54054,8],[54078,0],[54127,8],[54151,0],[54198,8],[54222,0],[54247,8],[54270,0],[54295,8],[54319,0],[54439,8],[54487,0],[54510,8],[54534,0],[54559,8],[54630,0],[54654,8],[54678,0],[54702,8],[54799,0],[54847,8],[54895,0],[54942,8],[54966,0],[54990,8],[55014,0],[55039,8],[55086,0],[55111,8],[55158,0],[55231,8],[55303,0],[55350,8],[55398,0],[55422,8],[55519,0],[55542,8],[55567,0],[55591,8],[55615,0],[55735,8],[55758,0],[55782,8],[55830,0],[55902,8],[55927,0],[55999,8],[56022,0],[56095,8],[56214,0],[56286,8],[56311,0],[56334,8],[56382,0],[56406,8],[56430,0],[56478,8],[56550,0],[56574,8],[56622,0],[56647,8],[56671,0],[56718,8],[56743,0],[56791,8],[56814,0],[56838,8],[56862,0],[56887,8],[56911,0],[56935,8],[57006,0],[57031,8],[57078,0],[57126,8],[57150,0],[57174,8],[57198,0],[57222,8],[57294,0],[57343,8],[57366,0],[57438,8],[57487,0],[57510,8],[57534,0],[57558,8],[57583,0],[57606,8],[57654,0],[57679,8],[57726,0],[57774,8],[57822,0],[57846,8],[57895,0],[57967,8],[58062,0],[58086,8],[58110,0],[58134,8],[58176,0],[58272,8],[59329,0],[59521,8],[59616,0],[60096,8],[60192,0],[60672,8],[60768,0],[60864,8],[60961,0],[61440,8],[61920,0],[62016,8],[62496,0],[62592,8],[63072,0],[63169,8],[63649,0],[63744,8],[64225,0],[64320,8],[64512,0],[64992,8],[65280,0],[65376,8],[65472,0],[65568,8],[65761,0],[65953,8],[66048,0],[66144,8],[66432,0],[66528,8],[66624,0],[66816,8],[66912,0],[67105,8],[67201,0],[67296,8],[68353,0],[68545,8],[68736,0],[68928,8],[69025,0],[69408,8],[69504,0],[69984,8],[70080,0],[70176,8],[70368,0],[70465,8],[70560,0],[70657,8],[70752,0],[70849,8],[70944,0],[71041,8],[71136,0],[71328,8],[71521,0],[71616,8],[71712,0],[72001,8],[72192,0],[72288,8],[72384,0],[72480,8],[73729,0],[74209,8],[74401,0],[74496,8],[74592,0],[74689,8],[74784,0],[74881,8],[74976,0],[75457,8],[75648,0],[76129,8],[76225,0],[76513,8],[76609,0],[77088,8],[77185,0],[77281,8],[77376,0],[77569,8],[77664,0],[77952,8],[78144,0],[78432,8],[78529,0],[78913,8],[79008,0],[79104,8],[80161,0],[80544,8],[80928,0],[81889,8],[82944,0],[83425,8],[83521,0],[84001,8],[84096,0],[84193,8],[84289,0],[84769,8],[84865,0],[84961,8],[85056,0],[85152,8],[85248,0],[85632,8],[85728,0],[85825,8],[85920,0],[86400,8],[86592,0],[86688,8],[86784,0],[87168,8],[87264,0],[87360,8],[87457,0],[87552,8]],"expect":{"frames":[{"index":1,"start_us":40.02083333333333,"end_us":178.02083333333331,"kind":"data","id":291,"id_hex":"0x123","extended":false,"fd":false,"brs":false,"esi":false,"dlc":3,"len":3,"data_hex":"11 22 33","crc":"0x65ED","ack":true,"stuff_bits":1,"ok":true},{"index":2,"start_us":184,"end_us":430,"kind":"data","id":2047,"id_hex":"0x7FF","extended":false,"fd":false,"brs":false,"esi":false,"dlc":8,"len":8,"data_hex":"00 00 00 00 00 00 00 00","crc":"0x2A43","ack":true,"stuff_bits":15,"ok":true},{"index":3,"start_us":436.0208333333333,"end_us":622,"kind":"data","id":417001744,"id_hex":"0x18DAF110","extended":true,"fd":false,"brs":false,"esi":false,"dlc":3,"len":3,"data_hex":"02 10 03","crc":"0x1BFE","ack":true,"stuff_bits":5,"ok":true},{"index":4,"start_us":628,"end_us":718,"kind":"remote","id":1110,"id_hex":"0x456","extended":false,"fd":false,"brs":false,"esi":false,"dlc":0,"len":0,"data_hex":"","crc":"0x4AB6","ack":true,"stuff_bits":1,"ok":true},{"index":5,"start_us":724,"end_us":849,"kind":"data","id":256,"id_hex":"0x100","extended":false,"fd":true,"brs":true,"esi":false,"dlc":9,"len":12,"data_hex":"01 02 03 04 05 06 07 08 09 0A 0B 0C","crc":"0x001E6B","ack":true,"stuff_bits":11,"ok":true},{"index":6,"start_us":855.0208333333333,"end_us":1230,"kind":"data","id":1752286,"id_hex":"0x001ABCDE","extended":true,"fd":true,"brs":true,"esi":false,"dlc":15,"len":64,"data_hex":"00 07 0E 15 1C 23 2A 31 38 3F 46 4D 54 5B 62 69 70 77 7E 85 8C 93 9A A1 A8 AF B6 BD C4 CB D2 D9 E0 E7 EE F5 FC 03 0A 11 18 1F 26 2D 34 3B 42 49 50 57 5E 65 6C 73 7A 81 88 8F 96 9D A4 AB B2 B9","crc":"0x156D1C","ack":true,"stuff_bits":17,"ok":true},{"index":7,"start_us":1236.0208333333333,"end_us":1418.0208333333333,"kind":"data","id":512,"id_hex":"0x200","extended":false,"fd":true,"brs":false,"esi":false,"dlc":3,"len":3,"data_hex":"FF FF FF","crc":"0x01B8F2","ack":true,"stuff_bits":8,"ok":true},{"index":8,"start_us":1424.0208333333333,"end_us":1530,"kind":"data","id":801,"id_hex":"0x321","extended":false,"fd":false,"brs":false,"esi":false,"dlc":1,"len":1,"data_hex":"AA","crc":"0x4D1A","ack":false,"stuff_bits":1,"ok":false,"error":"no ACK"},{"index":9,"start_us":1536.0208333333333,"end_us":1664,"kind":"data","id":85,"id_hex":"0x055","extended":false,"fd":false,"brs":false,"esi":false,"dlc":2,"len":2,"data_hex":"01 02","crc":"0x2310","ack":true,"stuff_bits":4,"ok":false,"error":"bad CRC"},{"index":10,"start_us":1670.0208333333333,"end_us":1708,"kind":"error","id":240,"id_hex":"0x0F0","extended":false,"fd":false,"brs":false,"esi":false,"dlc":0,"len":0,"data_hex":"","crc":"","ack":false,"stuff_bits":1,"ok":false,"error":"stuff error, error frame"},{"index":11,"start_us":1728,"end_us":1840.0208333333333,"kind":"data","id":1,"id_hex":"0x001","extended":false,"fd":false,"brs":false,"esi":false,"dlc":1,"len":1,"data_hex":"42","crc":"0x4142","ack":true,"stuff_bits":4,"ok":true}]}},{"name":"classic_125k_4msps","protocol":"can","sample_rate_hz":4000000,"channels":{"can":4},"options":{"bitrate":125000},"count":46431,"edges":[[0,8],[640,0],[736,8],[767,0],[832,8],[865,0],[961,8],[1024,0],[1184,8],[1280,0],[1376,8],[1409,0],[1505,8],[1536,0],[1600,8],[1633,0],[1729,8],[1760,0],[1855,8],[1920,0],[1985,8],[2112,0],[2176,8],[2208,0],[2240,8],[2368,0],[2401,8],[2465,0],[2496,8],[2560,0],[2592,8],[2945,0],[2976,8],[3136,0],[3168,8],[3329,0],[3361,8],[3393,0],[3488,8],[3520,0],[3680,8],[3712,0],[3872,8],[3904,0],[4064,8],[4096,0],[4255,8],[4288,0],[4448,8],[4481,0],[4640,8],[4672,0],[4832,8],[4864,0],[5023,8],[5057,0],[5216,8],[5248,0],[5407,8],[5441,0],[5600,8],[5632,0],[5793,8],[5825,0],[5984,8],[6016,0],[6112,8],[6145,0],[6176,8],[6209,0],[6240,8],[6272,0],[6337,8],[6368,0],[6495,8],[6593,0],[6624,8],[6976,0],[7008,8],[7072,0],[7168,8],[7233,0],[7265,8],[7329,0],[7361,8],[7456,0],[7489,8],[7616,0],[7713,8],[7743,0],[7840,8],[7872,0],[8032,8],[8064,0],[8193,8],[8256,0],[8416,8],[8449,0],[8481,8],[8512,0],[8640,8],[8672,0],[8832,8],[8865,0],[9024,8],[9121,0],[9185,8],[9247,0],[9280,8],[9441,0],[9473,8],[9601,0],[9633,8],[9665,0],[9697,8],[10048,0],[10079,8],[10112,0],[10209,8],[10240,0],[10272,8],[10305,0],[10336,8],[10400,0],[10433,8],[10464,0],[10624,8],[10657,0],[10687,8],[10720,0],[10785,8],[10816,0],[10849,8],[10879,0],[10912,8],[10945,0],[10977,8],[11040,0],[11072,8],[11137,0],[11168,8],[11200,0],[11233,8],[11584,0],[11681,8],[11712,0],[11872,8],[11904,0],[12063,8],[12128,0],[12160,8],[12192,0],[12224,8],[12257,0],[12321,8],[12353,0],[12511,8],[12544,0],[12609,8],[12640,0],[12800,8],[12832,0],[12865,8],[12896,0],[13056,8],[13089,0],[13151,8],[13217,0],[13376,8],[13441,0],[13600,8],[13632,0],[13697,8],[13727,0],[13761,8],[13792,0],[13952,8],[14048,0],[14209,8],[14240,0],[14272,8],[14369,0],[14496,8],[14527,0],[14689,8],[14720,0],[14784,8],[14816,0],[14881,8],[14912,0],[15040,8],[15071,0],[15105,8],[15136,0],[15296,8],[15361,0],[15392,8],[15456,0],[15584,8],[15649,0],[15712,8],[15744,0],[15775,8],[15808,0],[15841,8],[15872,0],[16033,8],[16192,0],[16287,8],[16352,0],[16417,8],[16448,0],[16480,8],[16513,0],[16544,8],[16608,0],[16641,8],[16993,0],[17152,8],[17185,0],[17312,8],[17377,0],[17408,8],[17504,0],[17537,8],[17567,0],[17599,8],[17729,0],[17792,8],[17857,0],[17888,8],[18017,0],[18081,8],[18112,0],[18145,8],[18176,0],[18208,8],[18336,0],[18496,8],[18529,0],[18687,8],[18719,0],[18817,8],[18912,0],[19040,8],[19137,0],[19264,8],[19296,0],[19328,8],[19360,0],[19393,8],[19424,0],[19521,8],[19616,0],[19745,8],[19775,0],[19873,8],[19936,0],[20001,8],[20032,0],[20064,8],[20097,0],[20128,8],[20160,0],[20256,8],[20321,0],[20416,8],[20447,0],[20512,8],[20609,0],[20768,8],[20928,0],[20961,8],[21024,0],[21056,8],[21089,0],[21185,8],[21248,0],[21311,8],[21345,0],[21409,8],[21472,0],[21505,8],[21535,0],[21569,8],[21599,0],[21632,8],[21664,0],[21696,8],[21729,0],[21824,8],[21856,0],[21889,8],[21951,0],[21984,8],[22048,0],[22080,8],[22144,0],[22240,8],[22272,0],[22337,8],[22401,0],[22432,8],[22464,0],[22529,8],[22561,0],[22593,8],[22688,0],[22847,8],[22976,0],[23008,8],[23105,0],[23136,8],[23297,0],[23329,8],[23361,0],[23393,8],[23425,0],[23553,8],[23585,0],[23616,8],[23680,0],[23777,8],[23840,0],[23904,8],[23937,0],[24001,8],[24033,0],[24096,8],[24193,0],[24255,8],[24320,0],[24352,8],[24384,0],[24416,8],[24447,0],[24481,8],[24512,0],[24641,8],[24703,0],[24736,8],[24768,0],[24800,8],[24833,0],[24928,8],[24960,0],[24993,8],[25024,0],[25057,8],[25216,0],[25280,8],[25344,0],[25375,8],[25441,0],[25471,8],[25505,0],[25537,8],[25665,0],[25696,8],[25791,0],[25889,8],[25921,0],[25983,8],[26049,0],[26112,8],[26145,0],[26177,8],[26304,0],[26337,8],[26369,0],[26432,8],[26465,0],[26497,8],[26560,0],[26592,8],[26656,0],[26721,8],[26849,0],[27008,8],[27136,0],[27201,8],[27360,0],[27392,8],[27423,0],[27457,8],[27553,0],[27584,8],[27713,0],[27744,8],[27776,0],[27808,8],[27968,0],[28001,8],[28064,0],[28224,8],[28255,0],[28352,8],[28416,0],[28544,8],[28577,0],[28608,8],[28639,0],[28769,8],[28800,0],[28897,8],[28928,0],[29025,8],[29088,0],[29248,8],[29279,0],[29312,8],[29472,0],[29569,8],[29599,0],[29664,8],[29729,0],[29825,8],[29857,0],[29889,8],[29953,0],[29984,8],[30016,0],[30080,8],[30144,0],[30177,8],[30208,0],[30337,8],[30433,0],[30463,8],[30528,0],[30560,8],[30592,0],[30720,8],[30752,0],[30817,8],[30849,0],[30911,8],[30944,0],[31008,8],[31041,0],[31073,8],[31105,0],[31136,8],[31168,0],[31328,8],[31392,0],[31424,8],[31455,0],[31487,8],[31584,0],[31617,8],[31649,0],[31680,8],[31807,0],[31872,8],[31937,0],[31999,8],[32033,0],[32065,8],[32095,0],[32128,8],[32193,0],[32224,8],[32288,0],[32385,8],[32481,0],[32545,8],[32609,0],[32640,8],[32768,0],[32801,8],[32833,0],[32864,8],[32895,0],[33057,8],[33088,0],[33120,8],[33185,0],[33281,8],[33312,0],[33408,8],[33441,0],[33537,8],[33697,0],[33792,8],[33825,0],[33856,8],[33921,0],[33953,8],[33983,0],[34048,8],[34145,0],[34176,8],[34240,0],[34273,8],[34305,0],[34369,8],[34400,0],[34465,8],[34497,0],[34528,8],[34561,0],[34592,8],[34624,0],[34657,8],[34752,0],[34784,8],[34848,0],[34913,8],[34945,0],[34976,8],[35008,0],[35040,8],[35137,0],[35201,8],[35232,0],[35328,8],[35391,0],[35424,8],[35456,0],[35488,8],[35521,0],[35553,8],[35617,0],[35648,8],[35713,0],[35776,8],[35840,0],[35873,8],[35936,0],[36032,8],[36160,0],[36192,8],[36225,0],[36257,8],[36289,0],[36320,8],[36672,0],[36736,8],[36768,0],[36928,8],[36961,0],[37119,8],[37153,0],[37184,8],[37216,0],[37376,8],[37536,0],[37569,8],[37728,0],[37761,8],[37920,0],[37952,8],[38112,0],[38145,8],[38304,0],[38337,8],[38401,0],[38560,8],[38656,0],[38689,8],[38720,0],[38753,8],[38816,0],[38881,8],[38912,0],[38944,8],[39040,0],[39072,8],[39105,0],[39168,8],[39200,0],[39265,8],[39296,0],[39328,8],[39680,0],[39745,8],[39809,0],[39872,8],[39905,0],[40032,8],[40064,0],[40225,8],[40257,0],[40288,8],[40352,0],[40384,8],[40417,0],[40447,8],[40480,0],[40512,8],[40545,0],[40576,8],[40608,0],[40672,8],[40736,0],[40768,8],[40801,0],[40895,8],[40961,0],[40993,8],[41025,0],[41056,8],[41472,0],[41633,8],[41696,0],[41728,8],[41760,0],[41792,8],[41824,0],[41856,8],[41889,0],[42049,8],[42112,0],[42272,8],[42305,0],[42400,8],[42432,0],[42593,8],[42625,0],[42657,8],[42688,0],[42753,8],[42784,0],[42881,8],[42943,0],[43040,8],[43073,0],[43200,8],[43233,0],[43264,8],[43617,0],[43744,8],[43873,0],[44192,8],[44544,0],[44704,8],[44737,0],[44896,8],[44928,0],[44961,8],[44993,0],[45153,8],[45184,0],[45217,8],[45248,0],[45281,8],[45313,0],[45441,8],[45472,0],[45505,8],[45537,0],[45697,8],[45761,0],[45792,8],[45823,0],[45953,8],[45984,0],[46017,8],[46049,0],[46081,8]],"expect":{"frames":[{"index":1,"start_us":160,"end_us":712,"kind":"data","id":291,"id_hex":"0x123","extended":false,"fd":false,"brs":false,"esi":false,"dlc":3,"len":3,"data_hex":"11 22 33","crc":"0x65ED","ack":true,"stuff_bits":1,"ok":true},{"index":2,"start_us":736.25,"end_us":1720.25,"kind":"data","id":2047,"id_hex":"0x7FF","extended":false,"fd":false,"brs":false,"esi":false,"dlc":8,"len":8,"data_hex":"00 00 00 00 00 00 00 00","crc":"0x2A43","ack":true,"stuff_bits":15,"ok":true},{"index":3,"start_us":1744,"end_us":2488.25,"kind":"data","id":417001744,"id_hex":"0x18DAF110","extended":true,"fd":false,"brs":false,"esi":false,"dlc":3,"len":3,"data_hex":"02 10 03","crc":"0x1BFE","ack":true,"stuff_bits":5,"ok":true},{"index":4,"start_us":2512,"end_us":2872,"kind":"remote","id":1110,"id_hex":"0x456","extended":false,"fd":false,"brs":false,"esi":false,"dlc":0,"len":0,"data_hex":"","crc":"0x4AB6","ack":true,"stuff_bits":1,"ok":true},{"index":5,"start_us":2896,"end_us":4224,"kind":"data","id":256,"id_hex":"0x100","extended":false,"fd":true,"brs":true,"esi":false,"dlc":9,"len":12,"data_hex":"01 02 03 04 05 06 07 08 09 0A 0B 0C","crc":"0x001E6B","ack":true,"stuff_bits":11,"ok":true},{"index":6,"start_us":4248.25,"end_us":9144.25,"kind":"data","id":1752286,"id_hex":"0x001ABCDE","extended":true,"fd":true,"brs":true,"esi":false,"dlc":15,"len":64,"data_hex":"00 07 0E 15 1C 23 2A 31 38 3F 46 4D 54 5B 62 69 70 77 7E 85 8C 93 9A A1 A8 AF B6 BD C4 CB D2 D9 E0 E7 EE F5 FC 03 0A 11 18 1F 26 2D 34 3B 42 49 50 57 5E 65 6C 73 7A 81 88 8F 96 9D A4 AB B2 B9","crc":"0x156D1C","ack":true,"stuff_bits":17,"ok":true},{"index":7,"start_us":9168,"end_us":9896,"kind":"data","id":512,"id_hex":"0x200","extended":false,"fd":true,"brs":false,"esi":false,"dlc":3,"len":3,"data_hex":"FF FF FF","crc":"0x01B8F2","ack":true,"stuff_bits":8,"ok":true},{"index":8,"start_us":9920,"end_us":10344.25,"kind":"data","id":801,"id_hex":"0x321","extended":false,"fd":false,"brs":false,"esi":false,"dlc":1,"len":1,"data_hex":"AA","crc":"0x4D1A","ack":false,"stuff_bits":1,"ok":false,"error":"no ACK"},{"index":9,"start_us":10368,"end_us":10880.25,"kind":"data","id":85,"id_hex":"0x055","extended":false,"fd":false,"brs":false,"esi":false,"dlc":2,"len":2,"data_hex":"01 02","crc":"0x2310","ack":true,"stuff_bits":4,"ok":false,"error":"bad CRC"},{"index":10,"start_us":10904.25,"end_us":11056.25,"kind":"error","id":240,"id_hex":"0x0F0","extended":false,"fd":false,"brs":false,"esi":false,"dlc":0,"len":0,"data_hex":"","crc":"","ack":false,"stuff_bits":1,"ok":false,"error":"stuff error, error frame"},{"index":11,"start_us":11136,"end_us":11584.25,"kind":"data","id":1,"id_hex":"0x001","extended":false,"fd":false,"brs":false,"esi":false,"dlc":1,"len":1,"data_hex":"42","crc":"0x4142","ack":true,"stuff_bits":4,"ok":true}]}},{"name":"fd_stuff_at_data_end_ack_stretched_48msps","protocol":"can","sample_rate_hz":48000000,"channels":{"can":2},"options":{"bitrate":500000,"data_bitrate":2000000},"count":45431,"edges":[[0,2],[1920,0],[2213,2],[2305,0],[2789,2],[2881,0],[3076,2],[3168,0],[3365,2],[3456,0],[3557,2],[3630,0],[3707,2],[3727,0],[3827,2],[3847,0],[3899,2],[3918,0],[3947,2],[4014,0],[4139,2],[4158,0],[4212,2],[4254,0],[4283,2],[4350,0],[4378,2],[4398,0],[4474,2],[4495,0],[4547,2],[4566,0],[4595,2],[4614,0],[4691,2],[4710,0],[4739,2],[4824,0],[4925,2],[5976,0],[6269,2],[6360,0],[6845,2],[6935,0],[7037,2],[7128,0],[7420,2],[7511,0],[7613,2],[7687,0],[7715,2],[7734,0],[7762,2],[7782,0],[7907,2],[7926,0],[8051,2],[8070,0],[8194,2],[8214,0],[8339,2],[8358,0],[8482,2],[8502,0],[8627,2],[8647,0],[8771,2],[8790,0],[8914,2],[8934,0],[9058,2],[9078,0],[9202,2],[9222,0],[9346,2],[9366,0],[9490,2],[9510,0],[9635,2],[9654,0],[9779,2],[9798,0],[9923,2],[9941,0],[10067,2],[10087,0],[10211,2],[10230,0],[10355,2],[10375,0],[10499,2],[10519,0],[10643,2],[10662,0],[10787,2],[10806,0],[10931,2],[10950,0],[11074,2],[11095,0],[11219,2],[11238,0],[11362,2],[11382,0],[11482,2],[11502,0],[11531,2],[11574,0],[11603,2],[11646,0],[11675,2],[11718,0],[11746,2],[11790,0],[11843,2],[11863,0],[11914,2],[11934,0],[11963,2],[12054,0],[12083,2],[12102,0],[12131,2],[12168,0],[12268,2],[13319,0],[13613,2],[13704,0],[14189,2],[14280,0],[14380,2],[14568,0],[14765,2],[14856,0],[14957,2],[15030,0],[15058,2],[15102,0],[15131,2],[15149,0],[15275,2],[15294,0],[15419,2],[15439,0],[15562,2],[15583,0],[15707,2],[15726,0],[15850,2],[15871,0],[15994,2],[16015,0],[16139,2],[16158,0],[16283,2],[16302,0],[16426,2],[16447,0],[16571,2],[16590,0],[16715,2],[16734,0],[16858,2],[16877,0],[17002,2],[17023,0],[17147,2],[17166,0],[17290,2],[17309,0],[17435,2],[17454,0],[17579,2],[17598,0],[17723,2],[17743,0],[17867,2],[17886,0],[18010,2],[18030,0],[18155,2],[18174,0],[18299,2],[18318,0],[18443,2],[18462,0],[18587,2],[18606,0],[18731,2],[18749,0],[18875,2],[18894,0],[19019,2],[19038,0],[19163,2],[19182,0],[19307,2],[19326,0],[19451,2],[19470,0],[19594,2],[19614,0],[19739,2],[19758,0],[19882,2],[19901,0],[20026,2],[20045,0],[20171,2],[20191,0],[20315,2],[20333,0],[20458,2],[20478,0],[20603,2],[20622,0],[20747,2],[20766,0],[20890,2],[20911,0],[21035,2],[21054,0],[21179,2],[21199,0],[21323,2],[21343,0],[21467,2],[21486,0],[21610,2],[21629,0],[21755,2],[21773,0],[21898,2],[21919,0],[22044,2],[22063,0],[22186,2],[22206,0],[22283,2],[22302,0],[22427,2],[22446,0],[22499,2],[22518,0],[22546,2],[22566,0],[22594,2],[22615,0],[22642,2],[22685,0],[22714,2],[22735,0],[22763,2],[22807,0],[22835,2],[22854,0],[22931,2],[22950,0],[22980,2],[23046,0],[23099,2],[23166,0],[23218,2],[23238,0],[23266,2],[23305,0],[23404,2],[24456,0],[24749,2],[24840,0],[25325,2],[25512,0],[25901,2],[25992,0],[26476,2],[26569,0],[26764,2],[26856,0],[26957,2],[27144,0],[27245,2],[27336,0],[27533,2],[27625,0],[27725,2],[28009,0],[28109,2],[28200,0],[28397,2],[28584,0],[28684,2],[28776,0],[29165,2],[29256,0],[29357,2],[29448,0],[29549,2],[30600,0],[30893,2],[30985,0],[31468,2],[31656,0],[31756,2],[31848,0],[32044,2],[32136,0],[32621,2],[32712,0],[32813,2],[32904,0],[33196,2],[33673,0],[33869,2],[34057,0],[34157,2],[34248,0],[34637,2],[34728,0],[35117,2],[35208,0],[35308,2],[35401,0],[35597,2],[35688,0],[35884,2],[36073,0],[36269,2],[36360,0],[36461,2],[37511,0],[37805,2],[37896,0],[38381,2],[38665,0],[38957,2],[39047,0],[39148,2],[39221,0],[39322,2],[39366,0],[39395,2],[39414,0],[39443,2],[39462,0],[39491,2],[39510,0],[39539,2],[39559,0],[39611,2],[39654,0],[39731,2],[39774,0],[39803,2],[39822,0],[39898,2],[39917,0],[39947,2],[39990,0],[40019,2],[40038,0],[40138,2],[40224,0],[40421,2],[41472,0],[41764,2],[41856,0],[42342,2],[42720,0],[42917,2],[43008,0],[43109,2],[43182,0],[43283,2],[43302,0],[43331,2],[43351,0],[43379,2],[43398,0],[43427,2],[43446,0],[43475,2],[43494,0],[43571,2],[43614,0],[43642,2],[43686,0],[43739,2],[43853,0],[43882,2],[43951,0],[43979,2],[44069,0],[44099,2],[44280,0],[44381,2]],"expect":{"frames":[{"index":1,"start_us":40,"end_us":118.5,"kind":"data","id":257,"id_hex":"0x101","extended":false,"fd":true,"brs":true,"esi":false,"dlc":2,"len":2,"data_hex":"12 E0","crc":"0x01C2A5","ack":true,"stuff_bits":1,"ok":true},{"index":2,"start_us":124.5,"end_us":271.5,"kind":"data","id":258,"id_hex":"0x102","extended":false,"fd":true,"brs":true,"esi":false,"dlc":10,"len":16,"data_hex":"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00","crc":"0x01785C","ack":true,"stuff_bits":26,"ok":true},{"index":3,"start_us":277.47916666666663,"end_us":503.5208333333333,"kind":"data","id":259,"id_hex":"0x103","extended":false,"fd":true,"brs":true,"esi":false,"dlc":13,"len":32,"data_hex":"00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 80","crc":"0x1BA598","ack":true,"stuff_bits":51,"ok":true},{"index":4,"start_us":509.5,"end_us":631.5,"kind":"data","id":260,"id_hex":"0x104","extended":false,"fd":true,"brs":false,"esi":false,"dlc":0,"len":0,"data_hex":"","crc":"0x005AC0","ack":true,"stuff_bits":2,"ok":true},{"index":5,"start_us":637.5,"end_us":775.5,"kind":"data","id":261,"id_hex":"0x105","extended":false,"fd":true,"brs":false,"esi":false,"dlc":1,"len":1,"data_hex":"1F","crc":"0x000086","ack":true,"stuff_bits":2,"ok":true},{"index":6,"start_us":781.4791666666666,"end_us":858,"kind":"data","id":262,"id_hex":"0x106","extended":false,"fd":true,"brs":true,"esi":false,"dlc":1,"len":1,"data_hex":"AA","crc":"0x0070C1","ack":true,"stuff_bits":1,"ok":true},{"index":7,"start_us":864,"end_us":940.5,"kind":"data","id":263,"id_hex":"0x107","extended":false,"fd":true,"brs":true,"esi":false,"dlc":1,"len":1,"data_hex":"55","crc":"0x019FDD","ack":true,"stuff_bits":1,"ok":true}]}}]} From 54e19ec644d77c363d5c7ba35abe9e455c03c8fb Mon Sep 17 00:00:00 2001 From: Edward Viaene Date: Fri, 20 Nov 2026 21:23:16 -0600 Subject: [PATCH 7/7] PWM servo readings only on request (servo, also in decode_la); Modbus frames carry their line Mirrors embeddedci-server 05d4e992. Co-Authored-By: Claude Opus 5.5 --- packages/embeddedci-mcp/CHANGELOG.md | 2 +- packages/embeddedci-mcp/README.md | 2 +- .../embeddedci-mcp/src/embeddedci_mcp/server.py | 2 ++ .../embeddedci-mcp/tests/test_capture_resources.py | 2 +- packages/embeddedci-mcp/tests/tools_surface.json | 6 ++++++ packages/embeddedci/README.md | 4 ++-- .../src/embeddedci/benchpod/modbus_decode.py | 5 +++-- .../src/embeddedci/benchpod/pwm_decode.py | 13 +++++++------ packages/embeddedci/tests/test_la_decoders.py | 2 +- .../tests/testdata/modbus_decode_vectors.json | 2 +- .../tests/testdata/pwm_decode_vectors.json | 2 +- 11 files changed, 26 insertions(+), 16 deletions(-) diff --git a/packages/embeddedci-mcp/CHANGELOG.md b/packages/embeddedci-mcp/CHANGELOG.md index f78e130..7c3b253 100644 --- a/packages/embeddedci-mcp/CHANGELOG.md +++ b/packages/embeddedci-mcp/CHANGELOG.md @@ -10,7 +10,7 @@ Not released yet. Needs embeddedci 4.0.2. carries the packets, transactions and transfers. - **`decode_la` decodes Modbus RTU, CAN / CAN FD, PWM, 1-Wire and SMBus/PMBus:** new arguments `tx` (Modbus two-line tap), `can`, `bitrate`, `data_bitrate`, `sample_point`, - `channels` (PWM), `onewire`, `pec`. `items` has one line per frame, transaction or channel; + `channels` and `servo` (PWM), `onewire`, `pec`. `items` has one line per frame, transaction or channel; `errors` counts the bad ones. `benchpod://capture/decode` carries the full results. ## 4.0.1 diff --git a/packages/embeddedci-mcp/README.md b/packages/embeddedci-mcp/README.md index d742122..702a961 100644 --- a/packages/embeddedci-mcp/README.md +++ b/packages/embeddedci-mcp/README.md @@ -344,7 +344,7 @@ version the SDK pins (0.1.0, bundled) unless `BENCHPOD_SENSOR_LIBRARY`, the CLI' | `capture_adc` | Capture the ADC: calibrated statistics, dominant frequency and a min/max envelope; `clipped_samples` counts samples past the range's full scale. `oversample` converts at 400 kS/s and averages down to `sample_rate_hz` for lower noise, about 5 s at most. | `samples=4096`, `sample_rate_hz`, `source`, `points=200`, `trigger_la`, `trigger_edge=rising`, `trigger_timeout_s=10`, `range`, `oversample` | | `capture_la` | Capture all 14 LA channels: levels, edge count, first edge and frequency per channel. Up to 48 MS/s on gateware v50+. `send` (gateware v55+) runs one transaction right after the capture arms: `{"bus":"i2c","addr":118,"write_hex":"d0","read":1}` (the `i2c_open` session, else one from the wiring), `{"bus":"spi","tx_hex":"9f00"}` (SPI pins from the wiring) or `{"bus":"gpio","la":6,"level":0}` (a GPIO output); without `trigger_la` it triggers on SDA or CS falling or the pin's edge, and the result's `send` has the reply. | `samples=4096`, `sample_rate_hz`, `stop_dac_after_s`, `trigger_la`, `trigger_edge=rising`, `trigger_timeout_s=10`, `trigger_pre_samples=0`, `send` | | `capture_correlated` | ADC and LA from one hardware trigger, on one timebase. | `adc_samples=4096`, `adc_sample_rate_hz`, `la_samples=4096`, `la_sample_rate_hz`, `stop_dac_after_s`, `points=200`, `trigger_la`, `trigger_edge=rising`, `trigger_timeout_s=10`, `source` | -| `decode_la` | Decode I2C, UART, SPI, USB, Modbus RTU, CAN / CAN FD, PWM, 1-Wire, SMBus or PMBus from the last LA capture (or a new one). USB (full speed at 48 MS/s, low speed from 6 MS/s) returns transactions as `items` and the control transfers as `transfers`: an enumeration as a list. CAN needs 6 samples per data bit. | **`protocol`**, `sda`, `scl`, `rx`, `baud`, `sclk`, `mosi`, `miso`, `cs`, `mode=0`, `dp`, `dm`, `speed=auto`, `tx`, `can`, `bitrate`, `data_bitrate`, `sample_point`, `channels`, `onewire`, `pec=auto`, `capture=last`, `samples=16384`, `sample_rate_hz=1000000`, `max_items=200` | +| `decode_la` | Decode I2C, UART, SPI, USB, Modbus RTU, CAN / CAN FD, PWM, 1-Wire, SMBus or PMBus from the last LA capture (or a new one). USB (full speed at 48 MS/s, low speed from 6 MS/s) returns transactions as `items` and the control transfers as `transfers`: an enumeration as a list. CAN needs 6 samples per data bit. | **`protocol`**, `sda`, `scl`, `rx`, `baud`, `sclk`, `mosi`, `miso`, `cs`, `mode=0`, `dp`, `dm`, `speed=auto`, `tx`, `can`, `bitrate`, `data_bitrate`, `sample_point`, `channels`, `servo=false`, `onewire`, `pec=auto`, `capture=last`, `samples=16384`, `sample_rate_hz=1000000`, `max_items=200` | | `la_timing` | Edge timestamps, pulse widths, frequency, duty cycle and channel-to-channel delay from the last capture. | **`la`**, `edge=rising`, `to_la`, `to_edge=rising`, `after=0`, `max_edges=100` | ### DAC diff --git a/packages/embeddedci-mcp/src/embeddedci_mcp/server.py b/packages/embeddedci-mcp/src/embeddedci_mcp/server.py index e4406b6..1e8eda6 100644 --- a/packages/embeddedci-mcp/src/embeddedci_mcp/server.py +++ b/packages/embeddedci-mcp/src/embeddedci_mcp/server.py @@ -2380,6 +2380,7 @@ async def decode_la( sample_point: Annotated[Optional[float], Field(gt=0, lt=1, description=( "can: where a bit is read, as a fraction of it (default 0.75)."))] = None, channels: Annotated[Optional[List[LaPin]], Field(description="pwm: the channels to measure.")] = None, + servo: Annotated[bool, Field(description="pwm: also read the high pulses as servo positions (1 ms = 0 %, 2 ms = 100 %).")] = False, onewire: Annotated[Optional[LaPin], Field(description="onewire: the bus line.")] = None, pec: Annotated[Literal["auto", "on", "off"], Field(description=( "smbus/pmbus: auto = a trailing byte that matches is a PEC; on = every transaction ends in one."))] = "auto", @@ -2438,6 +2439,7 @@ def op() -> m.DecodeResult: if v is not None} if protocol == "pwm": channels["channels"] = list(channels_arg) + channels["servo"] = servo if protocol in ("smbus", "pmbus"): channels["pec"] = pec if protocol == "spi": diff --git a/packages/embeddedci-mcp/tests/test_capture_resources.py b/packages/embeddedci-mcp/tests/test_capture_resources.py index e51a028..e840cf1 100644 --- a/packages/embeddedci-mcp/tests/test_capture_resources.py +++ b/packages/embeddedci-mcp/tests/test_capture_resources.py @@ -133,7 +133,7 @@ def test_fieldbus_decoders_through_the_tool(connected): words, c = _vector("pwm", "fan_and_servo_1msps") SESSION.last_la = LaCapture(words=words, sample_rate_hz=c["sample_rate_hz"]) - r = call("decode_la", protocol="pwm", channels=[1, 2]) + r = call("decode_la", protocol="pwm", channels=[1, 2], servo=True) assert r["count"] == 2 and "servo" in r["items"][1] assert [ch["channel"] for ch in json.loads(capture_decode_resource())["channels"]] == [1, 2] diff --git a/packages/embeddedci-mcp/tests/tools_surface.json b/packages/embeddedci-mcp/tests/tools_surface.json index 93d98e8..c31ace8 100644 --- a/packages/embeddedci-mcp/tests/tools_surface.json +++ b/packages/embeddedci-mcp/tests/tools_surface.json @@ -2177,6 +2177,12 @@ "default": null, "title": "Sda" }, + "servo": { + "default": false, + "description": "pwm: also read the high pulses as servo positions (1 ms = 0 %, 2 ms = 100 %).", + "title": "Servo", + "type": "boolean" + }, "speed": { "default": "auto", "description": "usb: full (12 Mbit/s), low (1.5 Mbit/s) or auto (from the idle state).", diff --git a/packages/embeddedci/README.md b/packages/embeddedci/README.md index 2c5fac9..7e84e81 100644 --- a/packages/embeddedci/README.md +++ b/packages/embeddedci/README.md @@ -1996,9 +1996,9 @@ about 0.44 times the returned rate. | Protocol | Arguments | Result | |---|---|---| - | `modbus` (RTU) | `rx`, `baud`; optional `tx` (two-line tap), `data_bits`, `parity` (default `even`), `stop_bits` | `ModbusFrame` list: `role` (request/response), `addr`, `function_name`, `start`, `quantity`, `values`, `exception`, `summary`, `reply_to`, `response_us`, CRC checked | + | `modbus` (RTU) | `rx`, `baud`; optional `tx` (two-line tap), `data_bits`, `parity` (default `even`), `stop_bits` | `ModbusFrame` list: `role` (request/response), `line` (the channel it was on), `addr`, `function_name`, `start`, `quantity`, `values`, `exception`, `summary`, `reply_to`, `response_us`, CRC checked | | `can` (CAN, CAN FD) | `can` (the transceiver's RXD), `bitrate`; optional `data_bitrate`, `sample_point`, `data_sample_point` | `CanFrame` list: `id_hex`, `extended`, `fd`, `brs`, `dlc`, `len`, `data_hex`, `ack`, `kind` (data/remote/error), CRC and stuffing checked | - | `pwm` | `channels` | `PwmDecode`: per channel `periods` (period, frequency, high, low, duty), `freq_hz` / `duty` / `high_us` min, max, mean, `jitter_us`, `glitches`, `servo` | + | `pwm` | `channels`; optional `servo` (read the high pulses as servo positions) | `PwmDecode`: per channel `periods` (period, frequency, high, low, duty), `freq_hz` / `duty` / `high_us` min, max, mean, `jitter_us`, `glitches`, `servo` (with `servo=True`) | | `onewire` | `onewire` | `OneWireTransaction` list: `reset`, `presence`, `overdrive`, `rom_command_name`, `rom`, `rom_crc_ok`, `function`, `bytes_hex`, `detail` (a temperature) | | `smbus`, `pmbus` | `sda`, `scl`; optional `pec` (`auto`, `on`, `off`) | `SmbusTransaction` list: `kind`, `command`, `command_name`, `data_hex`, `value` (PMBus: volts, amps, status bits), `pec` | diff --git a/packages/embeddedci/src/embeddedci/benchpod/modbus_decode.py b/packages/embeddedci/src/embeddedci/benchpod/modbus_decode.py index 9325146..b18ac14 100644 --- a/packages/embeddedci/src/embeddedci/benchpod/modbus_decode.py +++ b/packages/embeddedci/src/embeddedci/benchpod/modbus_decode.py @@ -49,6 +49,7 @@ class ModbusFrame: crc: str = "" reply_to: int = 0 response_us: float = 0.0 + line: int = 0 # the LA channel the frame was on ok: bool = True error: str = "" _body: bytes = field(default=b"", repr=False) @@ -97,7 +98,7 @@ def decode_modbus(words: Sequence[int], *, rx: int, baud: float, sample_rate_hz: data_bits=data_bits, parity=parity, stop_bits=stop_bits) except ValueError as e: raise ValueError(f"modbus: {e}") from None - raw.extend((f.value & 0xFF, f.start_us, f.end_us, f.error, i) for f in frames) + raw.extend((f.value & 0xFF, f.start_us, f.end_us, f.error, ch) for f in frames) # One time order (stable, as the Go insertion sort). raw.sort(key=lambda b: b[1]) bits = 1 + data_bits + stop_bits + (1 if parity in ("even", "odd") else 0) @@ -117,7 +118,7 @@ def decode_modbus(words: Sequence[int], *, rx: int, baud: float, sample_rate_hz: def _frame(bs: list, index: int) -> ModbusFrame: - f = ModbusFrame(index, bs[0][1], bs[-1][2]) + f = ModbusFrame(index, bs[0][1], bs[-1][2], line=bs[0][4]) raw = bytes(b[0] for b in bs) for b in bs: if b[3] and not f.error: diff --git a/packages/embeddedci/src/embeddedci/benchpod/pwm_decode.py b/packages/embeddedci/src/embeddedci/benchpod/pwm_decode.py index 1adf5e9..b35fdd5 100644 --- a/packages/embeddedci/src/embeddedci/benchpod/pwm_decode.py +++ b/packages/embeddedci/src/embeddedci/benchpod/pwm_decode.py @@ -3,7 +3,7 @@ The Python mirror of the EmbeddedCI server's ``decode/pwm.go`` (held to it by ``pwm_decode_vectors.json``). A period runs from a rising edge to the next. 1-2 sample pulses on a signal whose typical pulse spans 20 samples or more are glitches, folded into the level around -them. A train of 0.4-2.6 ms pulses every 2.5-30 ms reads as a servo signal. +them. With ``servo=True`` the high pulses also read as servo positions (1 ms = 0 %, 2 ms = 100 %). """ from __future__ import annotations @@ -84,8 +84,9 @@ def _stat(v: List[float]) -> PwmStat: return PwmStat(min(v), max(v), s / len(v)) -def decode_pwm(words: Sequence[int], *, channels: Sequence[int], sample_rate_hz: float) -> PwmDecode: - """Measure each of ``channels`` (1-based).""" +def decode_pwm(words: Sequence[int], *, channels: Sequence[int], sample_rate_hz: float, + servo: bool = False) -> PwmDecode: + """Measure each of ``channels`` (1-based); ``servo`` adds servo pulse widths and positions.""" if not channels: raise ValueError("pwm needs one or more channels in 1..14") if sample_rate_hz <= 0: @@ -94,11 +95,11 @@ def decode_pwm(words: Sequence[int], *, channels: Sequence[int], sample_rate_hz: for ch in channels: if not 1 <= ch <= 14: raise ValueError(f"pwm channel {ch} is not in 1..14") - res.channels.append(_channel([(w >> (ch - 1)) & 1 for w in words], ch, sample_rate_hz)) + res.channels.append(_channel([(w >> (ch - 1)) & 1 for w in words], ch, sample_rate_hz, servo)) return res -def _channel(line: List[int], ch: int, rate: float) -> PwmChannel: +def _channel(line: List[int], ch: int, rate: float, servo: bool) -> PwmChannel: c = PwmChannel(ch) runs: List[list] = [] # [level, start, n] for i, v in enumerate(line): @@ -152,7 +153,7 @@ def _channel(line: List[int], ch: int, rate: float) -> PwmChannel: for p in per: sq += (p - c.period_us.mean) * (p - c.period_us.mean) c.jitter_us = math.sqrt(sq / len(per)) - if 2500 <= c.period_us.mean <= 30000 and c.high_us.min >= 400 and c.high_us.max <= 2600: + if servo: ms = [h / 1000 for h in hi] c.servo = PwmServo(_stat(ms), _stat([(m - 1) * 100 for m in ms])) return c diff --git a/packages/embeddedci/tests/test_la_decoders.py b/packages/embeddedci/tests/test_la_decoders.py index b51d623..f37240f 100644 --- a/packages/embeddedci/tests/test_la_decoders.py +++ b/packages/embeddedci/tests/test_la_decoders.py @@ -23,7 +23,7 @@ NAMES = ["modbus", "can", "pwm", "onewire", "smbus"] #: vector option names -> Python keyword names KW = {"baud": "baud", "bitrate": "bitrate", "data_bitrate": "data_bitrate", "sample_point": "sample_point", - "data_sample_point": "data_sample_point", "channels": "channels", "pec": "pec"} + "data_sample_point": "data_sample_point", "channels": "channels", "pec": "pec", "servo": "servo"} def _cases(): diff --git a/packages/embeddedci/tests/testdata/modbus_decode_vectors.json b/packages/embeddedci/tests/testdata/modbus_decode_vectors.json index d45ef0d..7c8d048 100644 --- a/packages/embeddedci/tests/testdata/modbus_decode_vectors.json +++ b/packages/embeddedci/tests/testdata/modbus_decode_vectors.json @@ -1 +1 @@ -{"_comment":"Shared modbus decode parity vectors: synthetic captures as run-length edges [sample, word] from sample 0, the channels and options, and what the Go decoder returns (the /analyzer/decode response without protocol). Verified by the Go server and the Python SDK.","cases":[{"name":"rtu_19200_session","protocol":"modbus","sample_rate_hz":1000000,"channels":{"rx":3},"options":{"baud":19200},"count":125520,"edges":[[0,4],[2002,0],[2052,4],[2104,0],[2262,4],[2313,0],[2520,4],[2745,0],[2797,4],[2900,0],[3266,4],[3490,0],[4010,4],[4234,0],[4288,4],[4390,0],[4442,4],[4496,0],[4548,4],[4652,0],[4702,4],[4981,0],[5500,4],[5725,0],[5775,4],[5880,0],[6246,4],[6469,0],[6574,4],[6678,0],[6729,4],[6887,0],[6937,4],[7215,0],[7267,4],[7423,0],[7630,4],[7681,0],[7736,4],[12958,0],[13010,4],[13064,0],[13220,4],[13271,0],[13480,4],[13703,0],[13754,4],[13859,0],[14225,4],[14450,0],[14551,4],[14657,0],[14970,4],[15192,0],[15297,4],[15349,0],[15663,4],[15938,0],[15991,4],[16094,0],[16145,4],[16200,0],[16249,4],[16303,0],[16457,4],[16684,0],[17203,4],[17427,0],[17947,4],[18172,0],[18692,4],[18916,0],[19074,4],[19126,0],[19229,4],[19332,0],[19387,4],[19662,0],[19870,4],[19921,0],[20027,4],[20408,0],[20509,4],[20562,0],[20615,4],[20773,0],[20822,4],[26153,0],[26205,4],[26257,0],[26412,4],[26465,0],[26673,4],[26896,0],[26947,4],[27001,0],[27364,4],[27642,0],[28161,4],[28387,0],[28437,4],[28543,0],[28646,4],[28700,0],[28855,4],[29131,0],[29652,4],[29875,0],[29978,4],[30032,0],[30083,4],[30135,0],[30397,4],[30619,0],[30674,4],[30879,0],[30986,4],[31035,0],[31088,4],[31365,0],[31574,4],[31679,0],[31728,4],[31783,0],[31835,4],[37111,0],[37161,4],[37215,0],[37372,4],[37423,0],[37631,4],[37854,0],[37905,4],[37959,0],[38325,4],[38599,0],[38704,4],[38755,0],[39068,4],[39344,0],[39396,4],[39449,0],[39501,4],[39604,0],[39710,4],[40088,0],[40142,4],[40194,0],[40559,4],[40835,0],[40884,4],[40937,0],[40990,4],[41094,0],[41145,4],[41302,0],[41354,4],[41580,0],[41631,4],[41840,0],[41889,4],[41994,0],[42098,4],[47324,0],[47377,4],[47428,0],[47583,4],[47635,0],[47844,4],[48067,0],[48120,4],[48172,0],[48226,4],[48277,0],[48588,4],[48812,0],[49333,4],[49556,0],[49713,4],[49818,0],[49870,4],[49923,0],[49975,4],[50026,0],[50079,4],[50303,0],[50354,4],[50772,0],[50824,4],[51048,0],[51569,4],[51792,0],[51898,4],[52052,0],[52158,4],[52210,0],[52312,4],[52538,0],[52588,4],[52693,0],[52744,4],[52798,0],[52954,4],[53006,0],[53057,4],[58283,0],[58335,4],[58385,0],[58542,4],[58593,0],[58802,4],[59025,0],[59077,4],[59131,0],[59181,4],[59234,0],[59547,4],[59771,0],[60293,4],[60515,0],[60671,4],[60777,0],[60829,4],[60882,0],[60934,4],[60986,0],[61038,4],[61260,0],[61313,4],[61730,0],[61781,4],[62004,0],[62528,4],[62749,0],[62856,4],[63012,0],[63116,4],[63166,0],[63272,4],[63494,0],[63547,4],[63652,0],[63703,4],[63756,0],[63912,4],[63964,0],[64015,4],[69239,0],[69291,4],[69344,0],[69502,4],[69553,0],[69761,4],[69984,0],[70245,4],[70296,0],[70452,4],[70730,0],[71251,4],[71473,0],[71527,4],[71578,0],[71943,4],[72220,0],[72741,4],[72965,0],[73069,4],[73120,0],[73432,4],[73709,0],[73865,4],[73916,0],[74177,4],[74454,0],[74975,4],[75199,0],[75302,4],[75356,0],[75405,4],[75459,0],[75720,4],[75942,0],[75995,4],[76046,0],[76413,4],[76689,0],[76792,4],[76844,0],[77157,4],[77433,0],[77538,4],[77640,0],[77799,4],[77900,0],[77953,4],[78177,0],[78437,4],[78648,0],[78699,4],[83923,0],[83974,4],[84028,0],[84184,4],[84236,0],[84442,4],[84668,0],[84928,4],[84981,0],[85136,4],[85411,0],[85932,4],[86155,0],[86208,4],[86261,0],[86626,4],[86902,0],[87423,4],[87646,0],[87751,4],[87803,0],[88116,4],[88391,0],[88494,4],[88546,0],[88650,4],[88702,0],[88912,4],[89136,0],[89345,4],[89448,0],[89551,4],[94880,0],[94933,4],[94985,0],[95142,4],[95195,0],[95401,4],[95625,0],[95730,4],[95834,0],[96145,4],[96371,0],[96891,4],[97114,0],[97167,4],[97220,0],[97582,4],[97860,0],[98380,4],[98603,0],[98657,4],[98762,0],[99125,4],[99350,0],[99453,4],[99505,0],[99559,4],[99661,0],[99766,4],[99818,0],[99869,4],[100094,0],[100146,4],[100252,0],[100302,4],[100407,0],[100512,4],[105840,0],[105889,4],[105944,0],[106101,4],[106151,0],[106359,4],[106582,0],[106687,4],[106792,0],[107000,4],[107329,0],[107432,4],[107483,0],[107798,4],[108074,0],[108179,4],[108230,0],[108438,4],[108818,0],[108973,4],[109026,0],[109129,4],[109235,0],[109286,4],[114563,0],[115084,4],[115309,0],[115411,4],[115516,0],[115829,4],[116051,0],[116574,4],[116797,0],[117057,4],[117110,0],[117266,4],[117544,0],[117646,4],[117699,0],[117801,4],[117853,0],[118062,4],[118286,0],[118442,4],[118494,0],[118546,4],[118652,0],[118755,4],[119030,0],[119189,4],[119241,0],[119449,4],[119500,0],[119552,4],[119777,0],[119829,4],[119882,0],[119985,4],[120037,0],[120088,4],[120140,0],[120194,4],[120245,0],[120298,4]],"expect":{"frames":[{"index":1,"start_us":2002,"end_us":7762,"role":"request","addr":17,"function":3,"function_name":"READ_HOLDING_REGISTERS","start":107,"quantity":3,"summary":"READ_HOLDING_REGISTERS 107 x3","data_hex":"00 6B 00 03","crc":"0x8776","ok":true},{"index":2,"start_us":12958,"end_us":20955,"role":"response","addr":17,"function":3,"function_name":"READ_HOLDING_REGISTERS","start":107,"values":[555,0,100],"summary":"READ_HOLDING_REGISTERS 107: 555 0 100","data_hex":"06 02 2B 00 00 00 64","crc":"0xBAC8","reply_to":1,"response_us":5196,"ok":true},{"index":3,"start_us":26153,"end_us":31912,"role":"request","addr":17,"function":1,"function_name":"READ_COILS","start":19,"quantity":10,"summary":"READ_COILS 19 x10","data_hex":"00 13 00 0A","crc":"0x584F","ok":true},{"index":4,"start_us":37111,"end_us":42127,"role":"response","addr":17,"function":1,"function_name":"READ_COILS","start":19,"values":[1,0,1,1,0,0,1,1,1,0],"summary":"READ_COILS 19: 1 0 1 1 0 0 1 1 1 0","data_hex":"02 CD 01","crc":"0x6FED","reply_to":3,"response_us":5199,"ok":true},{"index":5,"start_us":47324,"end_us":53085,"role":"request","addr":17,"function":5,"function_name":"WRITE_SINGLE_COIL","start":172,"values":[1],"summary":"WRITE_SINGLE_COIL 172 ON","data_hex":"00 AC FF 00","crc":"0x8B4E","ok":true},{"index":6,"start_us":58283,"end_us":64041,"role":"response","addr":17,"function":5,"function_name":"WRITE_SINGLE_COIL","start":172,"values":[1],"summary":"WRITE_SINGLE_COIL 172 ON","data_hex":"00 AC FF 00","crc":"0x8B4E","reply_to":5,"response_us":5198,"ok":true},{"index":7,"start_us":69239,"end_us":78724,"role":"request","addr":17,"function":16,"function_name":"WRITE_MULTIPLE_REGISTERS","start":1,"quantity":2,"values":[10,258],"summary":"WRITE_MULTIPLE_REGISTERS 1: 10 258","data_hex":"00 01 00 02 04 00 0A 01 02","crc":"0xF0C6","ok":true},{"index":8,"start_us":83923,"end_us":89683,"role":"response","addr":17,"function":16,"function_name":"WRITE_MULTIPLE_REGISTERS","start":1,"quantity":2,"summary":"WRITE_MULTIPLE_REGISTERS 1 x2 done","data_hex":"00 01 00 02","crc":"0x9812","reply_to":7,"response_us":5199,"ok":true},{"index":9,"start_us":94880,"end_us":100641,"role":"request","addr":17,"function":6,"function_name":"WRITE_SINGLE_REGISTER","start":1,"values":[3],"summary":"WRITE_SINGLE_REGISTER 1 = 3","data_hex":"00 01 00 03","crc":"0x9B9A","ok":true},{"index":10,"start_us":105840,"end_us":109365,"role":"response","addr":17,"function":134,"function_name":"WRITE_SINGLE_REGISTER exception","exception":"ILLEGAL_DATA_ADDRESS","summary":"WRITE_SINGLE_REGISTER: ILLEGAL_DATA_ADDRESS","data_hex":"02","crc":"0x64C2","reply_to":9,"response_us":5199,"ok":true},{"index":11,"start_us":114563,"end_us":120324,"role":"request","addr":0,"function":6,"function_name":"WRITE_SINGLE_REGISTER","start":16,"values":[4660],"summary":"WRITE_SINGLE_REGISTER 16 = 4660","data_hex":"00 10 12 34","crc":"0xA984","ok":true}]}}]} +{"_comment":"Shared modbus decode parity vectors: synthetic captures as run-length edges [sample, word] from sample 0, the channels and options, and what the Go decoder returns (the /analyzer/decode response without protocol). Verified by the Go server and the Python SDK.","cases":[{"name":"rtu_19200_session","protocol":"modbus","sample_rate_hz":1000000,"channels":{"rx":3},"options":{"baud":19200},"count":125520,"edges":[[0,4],[2002,0],[2052,4],[2104,0],[2262,4],[2313,0],[2520,4],[2745,0],[2797,4],[2900,0],[3266,4],[3490,0],[4010,4],[4234,0],[4288,4],[4390,0],[4442,4],[4496,0],[4548,4],[4652,0],[4702,4],[4981,0],[5500,4],[5725,0],[5775,4],[5880,0],[6246,4],[6469,0],[6574,4],[6678,0],[6729,4],[6887,0],[6937,4],[7215,0],[7267,4],[7423,0],[7630,4],[7681,0],[7736,4],[12958,0],[13010,4],[13064,0],[13220,4],[13271,0],[13480,4],[13703,0],[13754,4],[13859,0],[14225,4],[14450,0],[14551,4],[14657,0],[14970,4],[15192,0],[15297,4],[15349,0],[15663,4],[15938,0],[15991,4],[16094,0],[16145,4],[16200,0],[16249,4],[16303,0],[16457,4],[16684,0],[17203,4],[17427,0],[17947,4],[18172,0],[18692,4],[18916,0],[19074,4],[19126,0],[19229,4],[19332,0],[19387,4],[19662,0],[19870,4],[19921,0],[20027,4],[20408,0],[20509,4],[20562,0],[20615,4],[20773,0],[20822,4],[26153,0],[26205,4],[26257,0],[26412,4],[26465,0],[26673,4],[26896,0],[26947,4],[27001,0],[27364,4],[27642,0],[28161,4],[28387,0],[28437,4],[28543,0],[28646,4],[28700,0],[28855,4],[29131,0],[29652,4],[29875,0],[29978,4],[30032,0],[30083,4],[30135,0],[30397,4],[30619,0],[30674,4],[30879,0],[30986,4],[31035,0],[31088,4],[31365,0],[31574,4],[31679,0],[31728,4],[31783,0],[31835,4],[37111,0],[37161,4],[37215,0],[37372,4],[37423,0],[37631,4],[37854,0],[37905,4],[37959,0],[38325,4],[38599,0],[38704,4],[38755,0],[39068,4],[39344,0],[39396,4],[39449,0],[39501,4],[39604,0],[39710,4],[40088,0],[40142,4],[40194,0],[40559,4],[40835,0],[40884,4],[40937,0],[40990,4],[41094,0],[41145,4],[41302,0],[41354,4],[41580,0],[41631,4],[41840,0],[41889,4],[41994,0],[42098,4],[47324,0],[47377,4],[47428,0],[47583,4],[47635,0],[47844,4],[48067,0],[48120,4],[48172,0],[48226,4],[48277,0],[48588,4],[48812,0],[49333,4],[49556,0],[49713,4],[49818,0],[49870,4],[49923,0],[49975,4],[50026,0],[50079,4],[50303,0],[50354,4],[50772,0],[50824,4],[51048,0],[51569,4],[51792,0],[51898,4],[52052,0],[52158,4],[52210,0],[52312,4],[52538,0],[52588,4],[52693,0],[52744,4],[52798,0],[52954,4],[53006,0],[53057,4],[58283,0],[58335,4],[58385,0],[58542,4],[58593,0],[58802,4],[59025,0],[59077,4],[59131,0],[59181,4],[59234,0],[59547,4],[59771,0],[60293,4],[60515,0],[60671,4],[60777,0],[60829,4],[60882,0],[60934,4],[60986,0],[61038,4],[61260,0],[61313,4],[61730,0],[61781,4],[62004,0],[62528,4],[62749,0],[62856,4],[63012,0],[63116,4],[63166,0],[63272,4],[63494,0],[63547,4],[63652,0],[63703,4],[63756,0],[63912,4],[63964,0],[64015,4],[69239,0],[69291,4],[69344,0],[69502,4],[69553,0],[69761,4],[69984,0],[70245,4],[70296,0],[70452,4],[70730,0],[71251,4],[71473,0],[71527,4],[71578,0],[71943,4],[72220,0],[72741,4],[72965,0],[73069,4],[73120,0],[73432,4],[73709,0],[73865,4],[73916,0],[74177,4],[74454,0],[74975,4],[75199,0],[75302,4],[75356,0],[75405,4],[75459,0],[75720,4],[75942,0],[75995,4],[76046,0],[76413,4],[76689,0],[76792,4],[76844,0],[77157,4],[77433,0],[77538,4],[77640,0],[77799,4],[77900,0],[77953,4],[78177,0],[78437,4],[78648,0],[78699,4],[83923,0],[83974,4],[84028,0],[84184,4],[84236,0],[84442,4],[84668,0],[84928,4],[84981,0],[85136,4],[85411,0],[85932,4],[86155,0],[86208,4],[86261,0],[86626,4],[86902,0],[87423,4],[87646,0],[87751,4],[87803,0],[88116,4],[88391,0],[88494,4],[88546,0],[88650,4],[88702,0],[88912,4],[89136,0],[89345,4],[89448,0],[89551,4],[94880,0],[94933,4],[94985,0],[95142,4],[95195,0],[95401,4],[95625,0],[95730,4],[95834,0],[96145,4],[96371,0],[96891,4],[97114,0],[97167,4],[97220,0],[97582,4],[97860,0],[98380,4],[98603,0],[98657,4],[98762,0],[99125,4],[99350,0],[99453,4],[99505,0],[99559,4],[99661,0],[99766,4],[99818,0],[99869,4],[100094,0],[100146,4],[100252,0],[100302,4],[100407,0],[100512,4],[105840,0],[105889,4],[105944,0],[106101,4],[106151,0],[106359,4],[106582,0],[106687,4],[106792,0],[107000,4],[107329,0],[107432,4],[107483,0],[107798,4],[108074,0],[108179,4],[108230,0],[108438,4],[108818,0],[108973,4],[109026,0],[109129,4],[109235,0],[109286,4],[114563,0],[115084,4],[115309,0],[115411,4],[115516,0],[115829,4],[116051,0],[116574,4],[116797,0],[117057,4],[117110,0],[117266,4],[117544,0],[117646,4],[117699,0],[117801,4],[117853,0],[118062,4],[118286,0],[118442,4],[118494,0],[118546,4],[118652,0],[118755,4],[119030,0],[119189,4],[119241,0],[119449,4],[119500,0],[119552,4],[119777,0],[119829,4],[119882,0],[119985,4],[120037,0],[120088,4],[120140,0],[120194,4],[120245,0],[120298,4]],"expect":{"frames":[{"index":1,"start_us":2002,"end_us":7762,"role":"request","addr":17,"function":3,"function_name":"READ_HOLDING_REGISTERS","start":107,"quantity":3,"summary":"READ_HOLDING_REGISTERS 107 x3","data_hex":"00 6B 00 03","crc":"0x8776","line":3,"ok":true},{"index":2,"start_us":12958,"end_us":20955,"role":"response","addr":17,"function":3,"function_name":"READ_HOLDING_REGISTERS","start":107,"values":[555,0,100],"summary":"READ_HOLDING_REGISTERS 107: 555 0 100","data_hex":"06 02 2B 00 00 00 64","crc":"0xBAC8","reply_to":1,"response_us":5196,"line":3,"ok":true},{"index":3,"start_us":26153,"end_us":31912,"role":"request","addr":17,"function":1,"function_name":"READ_COILS","start":19,"quantity":10,"summary":"READ_COILS 19 x10","data_hex":"00 13 00 0A","crc":"0x584F","line":3,"ok":true},{"index":4,"start_us":37111,"end_us":42127,"role":"response","addr":17,"function":1,"function_name":"READ_COILS","start":19,"values":[1,0,1,1,0,0,1,1,1,0],"summary":"READ_COILS 19: 1 0 1 1 0 0 1 1 1 0","data_hex":"02 CD 01","crc":"0x6FED","reply_to":3,"response_us":5199,"line":3,"ok":true},{"index":5,"start_us":47324,"end_us":53085,"role":"request","addr":17,"function":5,"function_name":"WRITE_SINGLE_COIL","start":172,"values":[1],"summary":"WRITE_SINGLE_COIL 172 ON","data_hex":"00 AC FF 00","crc":"0x8B4E","line":3,"ok":true},{"index":6,"start_us":58283,"end_us":64041,"role":"response","addr":17,"function":5,"function_name":"WRITE_SINGLE_COIL","start":172,"values":[1],"summary":"WRITE_SINGLE_COIL 172 ON","data_hex":"00 AC FF 00","crc":"0x8B4E","reply_to":5,"response_us":5198,"line":3,"ok":true},{"index":7,"start_us":69239,"end_us":78724,"role":"request","addr":17,"function":16,"function_name":"WRITE_MULTIPLE_REGISTERS","start":1,"quantity":2,"values":[10,258],"summary":"WRITE_MULTIPLE_REGISTERS 1: 10 258","data_hex":"00 01 00 02 04 00 0A 01 02","crc":"0xF0C6","line":3,"ok":true},{"index":8,"start_us":83923,"end_us":89683,"role":"response","addr":17,"function":16,"function_name":"WRITE_MULTIPLE_REGISTERS","start":1,"quantity":2,"summary":"WRITE_MULTIPLE_REGISTERS 1 x2 done","data_hex":"00 01 00 02","crc":"0x9812","reply_to":7,"response_us":5199,"line":3,"ok":true},{"index":9,"start_us":94880,"end_us":100641,"role":"request","addr":17,"function":6,"function_name":"WRITE_SINGLE_REGISTER","start":1,"values":[3],"summary":"WRITE_SINGLE_REGISTER 1 = 3","data_hex":"00 01 00 03","crc":"0x9B9A","line":3,"ok":true},{"index":10,"start_us":105840,"end_us":109365,"role":"response","addr":17,"function":134,"function_name":"WRITE_SINGLE_REGISTER exception","exception":"ILLEGAL_DATA_ADDRESS","summary":"WRITE_SINGLE_REGISTER: ILLEGAL_DATA_ADDRESS","data_hex":"02","crc":"0x64C2","reply_to":9,"response_us":5199,"line":3,"ok":true},{"index":11,"start_us":114563,"end_us":120324,"role":"request","addr":0,"function":6,"function_name":"WRITE_SINGLE_REGISTER","start":16,"values":[4660],"summary":"WRITE_SINGLE_REGISTER 16 = 4660","data_hex":"00 10 12 34","crc":"0xA984","line":3,"ok":true}]}}]} diff --git a/packages/embeddedci/tests/testdata/pwm_decode_vectors.json b/packages/embeddedci/tests/testdata/pwm_decode_vectors.json index b96c628..ac60b12 100644 --- a/packages/embeddedci/tests/testdata/pwm_decode_vectors.json +++ b/packages/embeddedci/tests/testdata/pwm_decode_vectors.json @@ -1 +1 @@ -{"_comment":"Shared pwm decode parity vectors: synthetic captures as run-length edges [sample, word] from sample 0, the channels and options, and what the Go decoder returns (the /analyzer/decode response without protocol). Verified by the Go server and the Python SDK.","cases":[{"name":"fan_and_servo_1msps","protocol":"pwm","sample_rate_hz":1000000,"channels":{},"options":{"channels":[1,2,3]},"count":61999,"edges":[[0,0],[20,1],[32,0],[60,1],[72,0],[100,1],[112,0],[140,1],[152,0],[180,1],[192,0],[220,1],[232,0],[260,1],[272,0],[300,1],[312,0],[340,1],[352,0],[380,1],[392,0],[420,1],[432,0],[460,1],[472,0],[500,1],[512,0],[540,1],[552,0],[580,1],[592,0],[620,1],[632,0],[660,1],[672,0],[700,1],[712,0],[740,1],[752,0],[780,1],[792,0],[820,1],[832,0],[860,1],[872,0],[900,1],[912,0],[940,1],[952,0],[980,1],[992,0],[1000,2],[1020,3],[1032,2],[1060,3],[1072,2],[1100,3],[1112,2],[1140,3],[1152,2],[1180,3],[1192,2],[1220,3],[1232,2],[1260,3],[1272,2],[1300,3],[1312,2],[1340,3],[1352,2],[1380,3],[1392,2],[1420,3],[1432,2],[1460,3],[1472,2],[1500,3],[1512,2],[1540,3],[1552,2],[1580,3],[1592,2],[1620,3],[1632,2],[1660,3],[1672,2],[1700,3],[1712,2],[1740,3],[1752,2],[1780,3],[1792,2],[1820,3],[1832,2],[1860,3],[1872,2],[1900,3],[1912,2],[1940,3],[1952,2],[1980,3],[1992,2],[2000,0],[2020,1],[2021,0],[2051,1],[2063,0],[2091,1],[2103,0],[2131,1],[2143,0],[2171,1],[2183,0],[2211,1],[2223,0],[2251,1],[2263,0],[2291,1],[2303,0],[2331,1],[2343,0],[2371,1],[2383,0],[2411,1],[2423,0],[2451,1],[2463,0],[2491,1],[2503,0],[2531,1],[2543,0],[2571,1],[2583,0],[2611,1],[2623,0],[2651,1],[2663,0],[2691,1],[2703,0],[2731,1],[2743,0],[2771,1],[2783,0],[2811,1],[2823,0],[21000,2],[22250,0],[41000,2],[43000,0],[61000,2]],"expect":{"protocol":"pwm","channels":[{"channel":1,"count":70,"freq_hz":{"min":25000,"max":32258.064516129034,"mean":25103.6866359447},"period_us":{"min":31,"max":40,"mean":39.871428571428574},"duty":{"min":0.03225806451612903,"max":0.3,"mean":0.29617511520737366},"high_us":{"min":1,"max":12,"mean":11.842857142857143},"low_us":{"min":28,"max":30,"mean":28.02857142857143},"jitter_us":1.0679944966608947,"glitches":0,"periods":[{"index":1,"start_us":20,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":2,"start_us":60,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":3,"start_us":100,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":4,"start_us":140,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":5,"start_us":180,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":6,"start_us":220,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":7,"start_us":260,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":8,"start_us":300,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":9,"start_us":340,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":10,"start_us":380,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":11,"start_us":420,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":12,"start_us":460,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":13,"start_us":500,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":14,"start_us":540,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":15,"start_us":580,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":16,"start_us":620,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":17,"start_us":660,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":18,"start_us":700,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":19,"start_us":740,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":20,"start_us":780,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":21,"start_us":820,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":22,"start_us":860,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":23,"start_us":900,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":24,"start_us":940,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":25,"start_us":980,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":26,"start_us":1020,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":27,"start_us":1060,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":28,"start_us":1100,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":29,"start_us":1140,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":30,"start_us":1180,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":31,"start_us":1220,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":32,"start_us":1260,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":33,"start_us":1300,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":34,"start_us":1340,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":35,"start_us":1380,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":36,"start_us":1420,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":37,"start_us":1460,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":38,"start_us":1500,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":39,"start_us":1540,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":40,"start_us":1580,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":41,"start_us":1620,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":42,"start_us":1660,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":43,"start_us":1700,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":44,"start_us":1740,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":45,"start_us":1780,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":46,"start_us":1820,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":47,"start_us":1860,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":48,"start_us":1900,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":49,"start_us":1940,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":50,"start_us":1980,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":51,"start_us":2020,"period_us":31,"freq_hz":32258.064516129034,"high_us":1,"low_us":30,"duty":0.03225806451612903},{"index":52,"start_us":2051,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":53,"start_us":2091,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":54,"start_us":2131,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":55,"start_us":2171,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":56,"start_us":2211,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":57,"start_us":2251,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":58,"start_us":2291,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":59,"start_us":2331,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":60,"start_us":2371,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":61,"start_us":2411,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":62,"start_us":2451,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":63,"start_us":2491,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":64,"start_us":2531,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":65,"start_us":2571,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":66,"start_us":2611,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":67,"start_us":2651,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":68,"start_us":2691,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":69,"start_us":2731,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":70,"start_us":2771,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3}],"truncated":false},{"channel":2,"count":3,"freq_hz":{"min":50,"max":50,"mean":50},"period_us":{"min":20000,"max":20000,"mean":20000},"duty":{"min":0.05,"max":0.1,"mean":0.07083333333333335},"high_us":{"min":1000,"max":2000,"mean":1416.6666666666667},"low_us":{"min":18000,"max":19000,"mean":18583.333333333332},"jitter_us":0,"glitches":0,"servo":{"pulse_ms":{"min":1,"max":2,"mean":1.4166666666666667},"position_pct":{"min":0,"max":100,"mean":41.666666666666664}},"periods":[{"index":1,"start_us":1000,"period_us":20000,"freq_hz":50,"high_us":1000,"low_us":19000,"duty":0.05},{"index":2,"start_us":21000,"period_us":20000,"freq_hz":50,"high_us":1250,"low_us":18750,"duty":0.0625},{"index":3,"start_us":41000,"period_us":20000,"freq_hz":50,"high_us":2000,"low_us":18000,"duty":0.1}],"truncated":false},{"channel":3,"count":0,"level":0,"freq_hz":{"min":0,"max":0,"mean":0},"period_us":{"min":0,"max":0,"mean":0},"duty":{"min":0,"max":0,"mean":0},"high_us":{"min":0,"max":0,"mean":0},"low_us":{"min":0,"max":0,"mean":0},"jitter_us":0,"glitches":0,"periods":[],"truncated":false}]}}]} +{"_comment":"Shared pwm decode parity vectors: synthetic captures as run-length edges [sample, word] from sample 0, the channels and options, and what the Go decoder returns (the /analyzer/decode response without protocol). Verified by the Go server and the Python SDK.","cases":[{"name":"fan_and_servo_1msps","protocol":"pwm","sample_rate_hz":1000000,"channels":{},"options":{"channels":[1,2,3],"servo":true},"count":61999,"edges":[[0,0],[20,1],[32,0],[60,1],[72,0],[100,1],[112,0],[140,1],[152,0],[180,1],[192,0],[220,1],[232,0],[260,1],[272,0],[300,1],[312,0],[340,1],[352,0],[380,1],[392,0],[420,1],[432,0],[460,1],[472,0],[500,1],[512,0],[540,1],[552,0],[580,1],[592,0],[620,1],[632,0],[660,1],[672,0],[700,1],[712,0],[740,1],[752,0],[780,1],[792,0],[820,1],[832,0],[860,1],[872,0],[900,1],[912,0],[940,1],[952,0],[980,1],[992,0],[1000,2],[1020,3],[1032,2],[1060,3],[1072,2],[1100,3],[1112,2],[1140,3],[1152,2],[1180,3],[1192,2],[1220,3],[1232,2],[1260,3],[1272,2],[1300,3],[1312,2],[1340,3],[1352,2],[1380,3],[1392,2],[1420,3],[1432,2],[1460,3],[1472,2],[1500,3],[1512,2],[1540,3],[1552,2],[1580,3],[1592,2],[1620,3],[1632,2],[1660,3],[1672,2],[1700,3],[1712,2],[1740,3],[1752,2],[1780,3],[1792,2],[1820,3],[1832,2],[1860,3],[1872,2],[1900,3],[1912,2],[1940,3],[1952,2],[1980,3],[1992,2],[2000,0],[2020,1],[2021,0],[2051,1],[2063,0],[2091,1],[2103,0],[2131,1],[2143,0],[2171,1],[2183,0],[2211,1],[2223,0],[2251,1],[2263,0],[2291,1],[2303,0],[2331,1],[2343,0],[2371,1],[2383,0],[2411,1],[2423,0],[2451,1],[2463,0],[2491,1],[2503,0],[2531,1],[2543,0],[2571,1],[2583,0],[2611,1],[2623,0],[2651,1],[2663,0],[2691,1],[2703,0],[2731,1],[2743,0],[2771,1],[2783,0],[2811,1],[2823,0],[21000,2],[22250,0],[41000,2],[43000,0],[61000,2]],"expect":{"protocol":"pwm","channels":[{"channel":1,"count":70,"freq_hz":{"min":25000,"max":32258.064516129034,"mean":25103.6866359447},"period_us":{"min":31,"max":40,"mean":39.871428571428574},"duty":{"min":0.03225806451612903,"max":0.3,"mean":0.29617511520737366},"high_us":{"min":1,"max":12,"mean":11.842857142857143},"low_us":{"min":28,"max":30,"mean":28.02857142857143},"jitter_us":1.0679944966608947,"glitches":0,"servo":{"pulse_ms":{"min":0.001,"max":0.012,"mean":0.01184285714285715},"position_pct":{"min":-99.9,"max":-98.8,"mean":-98.81571428571439}},"periods":[{"index":1,"start_us":20,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":2,"start_us":60,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":3,"start_us":100,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":4,"start_us":140,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":5,"start_us":180,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":6,"start_us":220,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":7,"start_us":260,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":8,"start_us":300,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":9,"start_us":340,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":10,"start_us":380,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":11,"start_us":420,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":12,"start_us":460,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":13,"start_us":500,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":14,"start_us":540,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":15,"start_us":580,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":16,"start_us":620,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":17,"start_us":660,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":18,"start_us":700,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":19,"start_us":740,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":20,"start_us":780,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":21,"start_us":820,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":22,"start_us":860,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":23,"start_us":900,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":24,"start_us":940,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":25,"start_us":980,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":26,"start_us":1020,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":27,"start_us":1060,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":28,"start_us":1100,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":29,"start_us":1140,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":30,"start_us":1180,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":31,"start_us":1220,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":32,"start_us":1260,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":33,"start_us":1300,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":34,"start_us":1340,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":35,"start_us":1380,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":36,"start_us":1420,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":37,"start_us":1460,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":38,"start_us":1500,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":39,"start_us":1540,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":40,"start_us":1580,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":41,"start_us":1620,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":42,"start_us":1660,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":43,"start_us":1700,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":44,"start_us":1740,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":45,"start_us":1780,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":46,"start_us":1820,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":47,"start_us":1860,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":48,"start_us":1900,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":49,"start_us":1940,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":50,"start_us":1980,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":51,"start_us":2020,"period_us":31,"freq_hz":32258.064516129034,"high_us":1,"low_us":30,"duty":0.03225806451612903},{"index":52,"start_us":2051,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":53,"start_us":2091,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":54,"start_us":2131,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":55,"start_us":2171,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":56,"start_us":2211,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":57,"start_us":2251,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":58,"start_us":2291,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":59,"start_us":2331,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":60,"start_us":2371,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":61,"start_us":2411,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":62,"start_us":2451,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":63,"start_us":2491,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":64,"start_us":2531,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":65,"start_us":2571,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":66,"start_us":2611,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":67,"start_us":2651,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":68,"start_us":2691,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":69,"start_us":2731,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3},{"index":70,"start_us":2771,"period_us":40,"freq_hz":25000,"high_us":12,"low_us":28,"duty":0.3}],"truncated":false},{"channel":2,"count":3,"freq_hz":{"min":50,"max":50,"mean":50},"period_us":{"min":20000,"max":20000,"mean":20000},"duty":{"min":0.05,"max":0.1,"mean":0.07083333333333335},"high_us":{"min":1000,"max":2000,"mean":1416.6666666666667},"low_us":{"min":18000,"max":19000,"mean":18583.333333333332},"jitter_us":0,"glitches":0,"servo":{"pulse_ms":{"min":1,"max":2,"mean":1.4166666666666667},"position_pct":{"min":0,"max":100,"mean":41.666666666666664}},"periods":[{"index":1,"start_us":1000,"period_us":20000,"freq_hz":50,"high_us":1000,"low_us":19000,"duty":0.05},{"index":2,"start_us":21000,"period_us":20000,"freq_hz":50,"high_us":1250,"low_us":18750,"duty":0.0625},{"index":3,"start_us":41000,"period_us":20000,"freq_hz":50,"high_us":2000,"low_us":18000,"duty":0.1}],"truncated":false},{"channel":3,"count":0,"level":0,"freq_hz":{"min":0,"max":0,"mean":0},"period_us":{"min":0,"max":0,"mean":0},"duty":{"min":0,"max":0,"mean":0},"high_us":{"min":0,"max":0,"mean":0},"low_us":{"min":0,"max":0,"mean":0},"jitter_us":0,"glitches":0,"periods":[],"truncated":false}]}}]}