From 30e5e06a33b3c5d78bd797aaf5b4e33a85def287 Mon Sep 17 00:00:00 2001 From: Star Chen Date: Thu, 22 Jul 2021 17:56:38 +0800 Subject: [PATCH] moninj: fix read of incomplete data (#1729) --- artiq/coredevice/comm_moninj.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/artiq/coredevice/comm_moninj.py b/artiq/coredevice/comm_moninj.py index 0c3a577dc..392ad701a 100644 --- a/artiq/coredevice/comm_moninj.py +++ b/artiq/coredevice/comm_moninj.py @@ -82,12 +82,12 @@ 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( self.endian + "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( self.endian + "lbb", payload) self.injection_status_cb(channel, override, value)