gint64 start, remaining;
const int timeout_ms = 100;
- if (!serial || (lines <= 0) || !buf || (buflen <= 0))
+ if (!serial || !buf || (buflen <= 0))
return SR_ERR_ARG;
start = g_get_monotonic_time();
serial = sdi->conn;
if (revents == G_IO_IN) {
- sr_dbg("%s(G_IO_IN)", __func__);
if (!devc->reply_pending) {
sr_err("No reply pending.");
gpd_receive_reply(serial, reply, sizeof(reply));
g_free(reply_esc);
} else {
for (i = 0; i < devc->model->num_channels; i++) {
+ packet.type = SR_DF_ANALOG;
+ packet.payload = &analog;
+
reply[0] = '\0';
gpd_receive_reply(serial, reply, sizeof(reply));
if (sscanf(reply, "%f", &devc->config[i].output_voltage_max) != 1) {
return TRUE;
}
- sr_analog_init(&analog, &encoding, &meaning, &spec, 0);
-
/* Send the value forward. */
- packet.type = SR_DF_ANALOG;
- packet.payload = &analog;
-
+ sr_analog_init(&analog, &encoding, &meaning, &spec, 0);
analog.num_samples = 1;
ch = g_slist_nth_data(sdi->channels, i);
analog.meaning->channels =
return TRUE;
}
- sr_analog_init(&analog, &encoding, &meaning, &spec, 0);
-
/* Send the value forward. */
- packet.type = SR_DF_ANALOG;
- packet.payload = &analog;
-
+ sr_analog_init(&analog, &encoding, &meaning, &spec, 0);
analog.num_samples = 1;
ch = g_slist_nth_data(sdi->channels, i);
analog.meaning->channels =
devc->reply_pending = FALSE;
}
} else {
- sr_dbg("%s(TIMEOUT)", __func__);
if (!devc->reply_pending) {
for (i = 0; i < devc->model->num_channels; i++)
gpd_send_cmd(serial, "IOUT%d?\nVOUT%d?\n",