From: Martin Ling Date: Tue, 16 Sep 2014 01:47:28 +0000 (+0100) Subject: brymen-dmm: Make serial write call block. X-Git-Tag: libsigrok-0.4.0~971 X-Git-Url: https://sigrok.org/gitweb/?p=libsigrok.git;a=commitdiff_plain;h=776313d997f1748ff89cb073f45e3560ad661136 brymen-dmm: Make serial write call block. This call is executed from an event handler and was previously nonblocking, but has no partial write handling. It sends a short packet so should be OK to block, most likely the output buffer will be empty anyway. --- diff --git a/src/hardware/brymen-dmm/parser.c b/src/hardware/brymen-dmm/parser.c index e4b12274..cfde37bf 100644 --- a/src/hardware/brymen-dmm/parser.c +++ b/src/hardware/brymen-dmm/parser.c @@ -78,7 +78,7 @@ static int bm_send_command(uint8_t command, uint8_t arg1, uint8_t arg2, /* TODO: How to compute the checksum? Hardware seems to ignore it. */ /* Request reading. */ - written = serial_write(serial, &cmdout, sizeof(cmdout)); + written = serial_write_blocking(serial, &cmdout, sizeof(cmdout)); if (written != sizeof(cmdout)) return SR_ERR;