]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/openbench-logic-sniffer/api.c
openbench-logic-sniffer: add a function to handle reset command
[libsigrok.git] / src / hardware / openbench-logic-sniffer / api.c
index 1e22c5b82f97970c9a83e00c36419d47071ad583..c04595350c6bcc562e978a65940c6eadb63c9176 100644 (file)
@@ -126,14 +126,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options)
        if (serial_open(serial, SERIAL_RDWR) != SR_OK)
                return NULL;
 
-       ret = SR_OK;
-       for (i = 0; i < 5; i++) {
-               if ((ret = send_shortcommand(serial, CMD_RESET)) != SR_OK) {
-                       sr_err("Port %s is not writable.", conn);
-                       break;
-               }
-       }
-       if (ret != SR_OK) {
+       if (ols_send_reset(serial) != SR_OK) {
                serial_close(serial);
                sr_err("Could not use port %s. Quitting.", conn);
                return NULL;