]> sigrok.org Git - libsigrok.git/commitdiff
agilent-dmm: Make serial write call block in scan.
authorMartin Ling <redacted>
Tue, 16 Sep 2014 01:11:05 +0000 (02:11 +0100)
committerUwe Hermann <redacted>
Wed, 24 Sep 2014 21:18:21 +0000 (23:18 +0200)
This call is executed at scan time so is free to block. There is no
handling for a partial write and a response is expected immediately
afterwards. It should therefore be a blocking call.

src/hardware/agilent-dmm/api.c

index 1c18c99c6c47135fd8103277a224cd13849ddb68..c89d18ed5fde5e4f15fa7a8ef166b3d5fd198cb2 100644 (file)
@@ -116,7 +116,7 @@ static GSList *scan(GSList *options)
                return NULL;
 
        serial_flush(serial);
-       if (serial_write(serial, "*IDN?\r\n", 7) == -1) {
+       if (serial_write_blocking(serial, "*IDN?\r\n", 7) == -1) {
                sr_err("Unable to send identification string: %s.",
                       strerror(errno));
                return NULL;