]> sigrok.org Git - libsigrok.git/commitdiff
radioshack-dmm: Fix opening of serial port.
authorAlexandru Gagniuc <redacted>
Sun, 2 Dec 2012 18:43:37 +0000 (12:43 -0600)
committerUwe Hermann <redacted>
Sun, 2 Dec 2012 20:48:17 +0000 (21:48 +0100)
During scan the serial port is opened with SERIAL_RDONLY | SERIAL_NONBLOCK,
which works fine, but when acquisition starts, it is opened only with
SERIAL_RDONLY. On Linux, if cdc_acm can make a claim to the USB to serial
converter, opening the port will fail.

Open port with SERIAL_RDONLY | SERIAL_NONBLOCK.

Signed-off-by: Alexandru Gagniuc <redacted>
hardware/radioshack-dmm/api.c

index 47620e3c05fc7b1588a73c8d59c77dc38dfda037..789685dd11f29b32fdb6d024c88397bdd5153c74 100644 (file)
@@ -217,7 +217,7 @@ static int hw_dev_open(struct sr_dev_inst *sdi)
                return SR_ERR_BUG;
        }
 
-       if (serial_open(devc->serial, SERIAL_RDONLY) != SR_OK)
+       if (serial_open(devc->serial, SERIAL_RDONLY | SERIAL_NONBLOCK) != SR_OK)
                return SR_ERR;
 
        sdi->status = SR_ST_ACTIVE;