]> sigrok.org Git - libsigrok.git/commitdiff
gmc-mh-1x-2x: Remove SERIAL_NONBLOCK flag.
authorMartin Ling <redacted>
Sun, 21 Sep 2014 17:45:36 +0000 (18:45 +0100)
committerUwe Hermann <redacted>
Wed, 24 Sep 2014 21:30:31 +0000 (23:30 +0200)
All calls in the driver are now explicitly (non)blocking.

src/hardware/gmc-mh-1x-2x/api.c
src/hardware/gmc-mh-1x-2x/protocol.c

index 1a969d113500a0acea76955a4bf3a9bd641735ee..a67fb0a8f9d2fb57493b20ec0743cc527eb9ebba 100644 (file)
@@ -198,7 +198,7 @@ static GSList *scan_1x_2x_rs232(GSList *options)
        if (!(serial = sr_serial_dev_inst_new(conn, serialcomm)))
                return NULL;
 
-       if (serial_open(serial, SERIAL_RDWR | SERIAL_NONBLOCK) != SR_OK) {
+       if (serial_open(serial, SERIAL_RDWR) != SR_OK) {
                sr_serial_dev_inst_free(serial);
                return NULL;
        }
@@ -295,7 +295,7 @@ static GSList *scan_2x_bd232(GSList *options)
        if (!(serial = sr_serial_dev_inst_new(conn, serialcomm)))
                return NULL;
 
-       if (serial_open(serial, SERIAL_RDWR | SERIAL_NONBLOCK) != SR_OK)
+       if (serial_open(serial, SERIAL_RDWR) != SR_OK)
                goto exit_err;
 
        if (!(devc = g_try_malloc0(sizeof(struct dev_context)))) {
index d0cd194089286b447833c698cb0460ce696dc273..cfcbc4dc6b4aee1b01a1ee338a0cb045b0a09af9 100644 (file)
@@ -1307,7 +1307,7 @@ int req_meas14(const struct sr_dev_inst *sdi)
        devc->cmd_idx = 0;
        create_cmd_14(devc->addr, 8, params, msg);
        devc->req_sent_at = g_get_monotonic_time();
-       if (serial_write_blocking(serial, msg, sizeof(msg)) < 0) {
+       if (serial_write_blocking(serial, msg, sizeof(msg)) == -1) {
                return SR_ERR;
        }
 
@@ -1350,7 +1350,7 @@ int req_stat14(const struct sr_dev_inst *sdi, gboolean power_on)
 
        /* Write message and wait for reply */
        devc->req_sent_at = g_get_monotonic_time();
-       if (serial_write_blocking(serial, msg, sizeof(msg)) < 0) {
+       if (serial_write_blocking(serial, msg, sizeof(msg)) == -1) {
                return SR_ERR;
        }