]> sigrok.org Git - libsigrok.git/commitdiff
norma-dmm: Make write call block.
authorMartin Ling <redacted>
Sun, 21 Sep 2014 18:12:16 +0000 (19:12 +0100)
committerUwe Hermann <redacted>
Wed, 24 Sep 2014 21:30:31 +0000 (23:30 +0200)
This call was previously nonblocking, but has no partial write handling.
It is called in the scan where it is free to block.

src/hardware/norma-dmm/api.c

index c5f95d28e020526f62d5d5e5e00b9272a068267f..deefceaebac6f9623281733ad0d388314a1911a2 100644 (file)
@@ -129,9 +129,8 @@ static GSList *do_scan(struct sr_dev_driver* drv, GSList *options)
                 nmadmm_requests[NMADMM_REQ_IDN].req_str);
        g_usleep(150 * 1000); /* Wait a little to allow serial port to settle. */
        for (cnt = 0; cnt < 7; cnt++) {
-               if (serial_write(serial, req, strlen(req)) == -1) {
-                       sr_err("Unable to send identification request: %d %s.",
-                              errno, strerror(errno));
+               if (serial_write_blocking(serial, req, strlen(req)) < 0) {
+                       sr_err("Unable to send identification request.");
                        return NULL;
                }
                len = BUF_MAX;