]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/cem-dt-885x/api.c
Removal of sdi->index, step 4: fix trivial sr_dev_inst_new() calls
[libsigrok.git] / src / hardware / cem-dt-885x / api.c
index b77f471f17af35b9db7c090d9ad58e77dcbe85c2..70a28e58153de63ed5f4833edb5299ae065f2ebe 100644 (file)
@@ -97,16 +97,16 @@ static GSList *scan(GSList *options)
        if (!(serial = sr_serial_dev_inst_new(conn, SERIALCOMM)))
                return NULL;
 
-       if (serial_open(serial, SERIAL_RDONLY | SERIAL_NONBLOCK) != SR_OK)
+       if (serial_open(serial, SERIAL_RDONLY) != SR_OK)
                return NULL;
 
        devices = NULL;
        drvc = di->priv;
        start = g_get_monotonic_time();
        while (g_get_monotonic_time() - start < MAX_SCAN_TIME) {
-               if (serial_read(serial, &c, 1) == 1 && c == 0xa5) {
+               if (serial_read_nonblocking(serial, &c, 1) == 1 && c == 0xa5) {
                        /* Found one. */
-                       if (!(sdi = sr_dev_inst_new(0, SR_ST_INACTIVE, "CEM",
+                       if (!(sdi = sr_dev_inst_new(SR_ST_INACTIVE, "CEM",
                                        "DT-885x", NULL)))
                                return NULL;