ols: use serial layer's "has receive data" query
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.
This commit is contained in:
parent
8c3df6e5cd
commit
f992151332
|
@ -135,7 +135,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options)
|
||||||
|
|
||||||
g_usleep(RESPONSE_DELAY_US);
|
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.");
|
sr_dbg("Didn't get any reply.");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
@ -159,7 +159,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options)
|
||||||
|
|
||||||
g_usleep(RESPONSE_DELAY_US);
|
g_usleep(RESPONSE_DELAY_US);
|
||||||
|
|
||||||
if (sp_input_waiting(serial->sp_data) != 0) {
|
if (serial_has_receive_data(serial) != 0) {
|
||||||
/* Got metadata. */
|
/* Got metadata. */
|
||||||
sdi = get_metadata(serial);
|
sdi = get_metadata(serial);
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue