while (!devices && retry < 3) {
retry++;
serial_flush(serial);
- if (serial_write_blocking(serial, "ID\r", 3, 0) < 0) {
+ if (serial_write_blocking(serial, "ID\r", 3, SERIAL_WRITE_TIMEOUT_MS) < 0) {
sr_err("Unable to send ID string");
continue;
}
serial_source_add(sdi->session, serial, G_IO_IN, 50,
fluke_receive_data, (void *)sdi);
- if (serial_write_blocking(serial, "QM\r", 3, 0) < 0) {
+ if (serial_write_blocking(serial, "QM\r", 3, SERIAL_WRITE_TIMEOUT_MS) < 0) {
sr_err("Unable to send QM.");
return SR_ERR;
}
/* Slip the request in now, before the main
* timer loop asks for metadata again. */
n = sprintf(cmd, "QM %d\r", devc->meas_type);
- if (serial_write_blocking(serial, cmd, n, 0) < 0)
+ if (serial_write_blocking(serial, cmd, n, SERIAL_WRITE_TIMEOUT_MS) < 0)
sr_err("Unable to send QM (measurement).");
}
} else {
* out-of-sync or temporary disconnect issues. */
if ((devc->expect_response == FALSE && elapsed > devc->profile->poll_period)
|| elapsed > devc->profile->timeout) {
- if (serial_write_blocking(serial, "QM\r", 3, 0) < 0)
+ if (serial_write_blocking(serial, "QM\r", 3, SERIAL_WRITE_TIMEOUT_MS) < 0)
sr_err("Unable to send QM.");
devc->cmd_sent_at = now;
devc->expect_response = TRUE;