scpi = sdi->conn;
- if (revents == G_IO_IN) {
+ if (revents == G_IO_IN || revents == 0) {
if (devc->model->protocol == PROTOCOL_IEEE488_2) {
switch(devc->wait_event) {
case WAIT_NONE:
probe = devc->channel_entry->data;
+ if (devc->num_block_bytes == 0 &&
+ devc->model->protocol == PROTOCOL_IEEE488_2) {
+ if (sr_scpi_send(sdi->conn, ":WAV:DATA?") != SR_OK)
+ return TRUE;
+ }
+
if (devc->num_block_bytes == 0) {
if (sr_scpi_read_begin(scpi) != SR_OK)
return TRUE;
if (devc->model->protocol == PROTOCOL_IEEE488_2) {
sr_dbg("New block header expected");
- if (sr_scpi_send(sdi->conn, ":WAV:DATA?") != SR_OK)
- return TRUE;
len = rigol_ds_read_header(scpi);
if (len == -1)
return TRUE;
devc->channel_entry = devc->enabled_digital_probes;
rigol_ds_channel_start(sdi);
} else if (++devc->num_frames == devc->limit_frames) {
- /* End of last frame. */
- packet.type = SR_DF_END;
- sr_session_send(sdi, &packet);
sdi->driver->dev_acquisition_stop(sdi, cb_data);
} else {
/* Get the next frame, starting with the first analog channel. */
/* Digital channel state. */
if (devc->model->has_digital) {
- sr_dbg("Current digital channel state:");
+ if (get_cfg_string(sdi, ":LA:DISP?", &t_s) != SR_OK)
+ return SR_ERR;
+ devc->la_enabled = !strcmp(t_s, "ON") ? TRUE : FALSE;
+ sr_dbg("Logic analyzer %s, current digital channel state:",
+ devc->la_enabled ? "enabled" : "disabled");
for (i = 0; i < 16; i++) {
- cmd = g_strdup_printf(":DIG%d:TURN?", i + 1);
+ cmd = g_strdup_printf(":DIG%d:TURN?", i);
res = get_cfg_string(sdi, cmd, &t_s);
g_free(cmd);
if (res != SR_OK)
return SR_ERR;
devc->digital_channels[i] = !strcmp(t_s, "ON") ? TRUE : FALSE;
g_free(t_s);
- sr_dbg("D%d: %s", i + 1, devc->digital_channels[i] ? "on" : "off");
+ sr_dbg("D%d: %s", i, devc->digital_channels[i] ? "on" : "off");
}
}