msgproto: Support multi-byte command and response ids

Update the msgproto.py code so that it can support message ids that
are larger than a single byte.  (The host C code in
klippy/chelper/msgblock.c already supports multi-byte ids.)

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2024-06-05 20:01:50 -04:00
parent d4bae4dffe
commit 17c645f000
2 changed files with 31 additions and 32 deletions

View file

@ -87,7 +87,7 @@ class CommandWrapper:
if cmd_queue is None:
cmd_queue = serial.get_default_command_queue()
self._cmd_queue = cmd_queue
self._msgtag = msgparser.lookup_msgtag(msgformat) & 0xffffffff
self._msgtag = msgparser.lookup_msgid(msgformat) & 0xffffffff
def send(self, data=(), minclock=0, reqclock=0):
cmd = self._cmd.encode(data)
self._serial.raw_send(cmd, minclock, reqclock, self._cmd_queue)