]> sigrok.org Git - libsigrok.git/commitdiff
ols: use serial layer's "has receive data" query
authorGerhard Sittig <redacted>
Sun, 3 Jun 2018 14:49:45 +0000 (16:49 +0200)
committerUwe Hermann <redacted>
Sun, 2 Jun 2019 18:39:02 +0000 (20:39 +0200)
Eliminate a direct libserialport dependency in the OLS device driver.
Use libsigrok's internal serial layer's API instead to check for the
availability of receive data.

src/hardware/openbench-logic-sniffer/api.c

index 792549cb9f6c6cd5f4930c7c3da26317b94d7436..4f9ee04f2dcf7d9b0d1d127af604be412083155c 100644 (file)
@@ -135,7 +135,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options)
 
        g_usleep(RESPONSE_DELAY_US);
 
-       if (sp_input_waiting(serial->sp_data) == 0) {
+       if (serial_has_receive_data(serial) == 0) {
                sr_dbg("Didn't get any reply.");
                return NULL;
        }
@@ -159,7 +159,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options)
 
        g_usleep(RESPONSE_DELAY_US);
 
-       if (sp_input_waiting(serial->sp_data) != 0) {
+       if (serial_has_receive_data(serial) != 0) {
                /* Got metadata. */
                sdi = get_metadata(serial);
        } else {