forked from M-Labs/artiq
moninj: fix read of incomplete data (#1729)
This commit is contained in:
parent
b29d17747f
commit
0a29b75f8e
@ -74,11 +74,11 @@ class CommMonInj:
|
||||
if not ty:
|
||||
return
|
||||
if ty == b"\x00":
|
||||
payload = await self._reader.read(9)
|
||||
payload = await self._reader.readexactly(9)
|
||||
channel, probe, value = struct.unpack(">lbl", payload)
|
||||
self.monitor_cb(channel, probe, value)
|
||||
elif ty == b"\x01":
|
||||
payload = await self._reader.read(6)
|
||||
payload = await self._reader.readexactly(6)
|
||||
channel, override, value = struct.unpack(">lbb", payload)
|
||||
self.injection_status_cb(channel, override, value)
|
||||
else:
|
||||
|
Loading…
Reference in New Issue
Block a user