Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,18 @@ share/python-wheels/
*.egg
MANIFEST

# artifacts from installing package in editable mode
CMakeFiles/
CMakeCache.txt
install_manifest.txt
Release/*
*/Release/*
pyxcp/*.exe
*.vcxproj
*.filters
*.cmake
*.sln

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
Expand Down
7 changes: 6 additions & 1 deletion pyxcp/transport/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,12 @@ def _prepare_request(self, cmd, *data):
else:
packet = bytes(flatten(cmd_bytes, data))

header = self.HEADER.pack(len(packet), self.counter_send)
nr_args_expected = len(self.HEADER.unpack(b"\x00" * self.HEADER.size))
if nr_args_expected == 2:
header = self.HEADER.pack(len(packet), self.counter_send)
else: # if nr_args_expected == 1
header = self.HEADER.pack(len(packet))

self.counter_send = (self.counter_send + 1) & 0xFFFF

frame = header + packet
Expand Down