#define AGDMM_BUFSIZE 256
+/* Always USB-serial, 1ms is plenty. */
+#define SERIAL_WRITE_TIMEOUT_MS 1
+
/* Supported models */
enum {
AGILENT_U1231 = 1,
return NULL;
serial_flush(serial);
- if (serial_write_blocking(serial, "*IDN?\r\n", 7, 0) < 7) {
+ if (serial_write_blocking(serial, "*IDN?\r\n", 7, SERIAL_WRITE_TIMEOUT_MS) < 7) {
sr_err("Unable to send identification string.");
return NULL;
}
strcat(buf, "\r\n");
else
strcat(buf, "\n\r\n");
- if (serial_write_blocking(serial, buf, strlen(buf), 0) < (int)strlen(buf)) {
+ if (serial_write_blocking(serial, buf, strlen(buf), SERIAL_WRITE_TIMEOUT_MS) < (int)strlen(buf)) {
sr_err("Failed to send.");
return SR_ERR;
}