-
-
Notifications
You must be signed in to change notification settings - Fork 74
Description
Python 3.13.7
pyxcp==0.23.9
With mwe_bug_config.py
c = get_config() # noqa
c.Transport.layer = 'SXI'
c.Transport.SxI.bitrate = 115200
c.Transport.SxI.bytesize = 8
c.Transport.SxI.port = 'COM13'
c.Transport.SxI.header_format = 'HEADER_LEN_BYTE
and mwe_bug.py
from pyxcp.cmdline import ArgumentParser
ap = ArgumentParser(description="pyXCP SXI test" )
with ap.run() as xcp:
xcp.connect()
print("Connected to XCP slave.")
print("Slave ID:", xcp.identifier(0x01))
print("Properties:", xcp.slaveProperties)
xcp.disconnect()
and
python mwe_bug.py --config mwe_bug_config.py
I get
error: pack expected 1 items for packing (got 2)
resp.
..\pyxcp2\venv\Lib\site-packages\pyxcp\transport\base.py:330 in _prepare_request │
│ │
│ 327 │ │ else: │
│ 328 │ │ │ packet = bytes(flatten(cmd_bytes, data)) │
│ 329 │ │ │
│ ❱ 330 │ │ header = self.HEADER.pack(len(packet), self.counter_send) │
│ 331 │ │ self.counter_send = (self.counter_send + 1) & 0xFFFF │
│ 332 │ │ │
│ 333 │ │ frame = header + packet
where
len(packet) == 2
and self.HEADER == struct.Struct(f"<B")
and self.counter_send = 0
with full requirements.txt:
bandit==1.8.6
chardet==5.2.0
colorama==0.4.6
construct==2.10.70
line-profiler-pycharm==1.2.0
line_profiler==5.0.0
Mako==1.3.10
markdown-it-py==4.0.0
MarkupSafe==3.0.2
mdurl==0.1.2
packaging==25.0
Pygments==2.19.2
pyserial==3.5
python-can==4.6.1
pytz==2025.2
pyusb==1.3.1
pyxcp==0.23.9
PyYAML==6.0.2
rich==14.1.0
stevedore==5.5.0
toml==0.10.2
tomlkit==0.13.3
traitlets==5.11.2
typing_extensions==4.15.0
uptime==3.0.1
wrapt==1.17.3