*devices = NULL;
if (strncmp(resource, usbtmc_prefix, strlen(usbtmc_prefix)) == 0) {
- sr_dbg("Opening USBTMC device %s", resource);
+ sr_dbg("Opening USBTMC device %s.", resource);
if (!(scpi = scpi_usbtmc_dev_inst_new(resource)))
return SR_ERR_MALLOC;
} else if (strncmp(resource, tcp_prefix, strlen(tcp_prefix)) == 0) {
- sr_dbg("Opening TCP connection %s", resource);
+ sr_dbg("Opening TCP connection %s.", resource);
tokens = g_strsplit(resource + strlen(tcp_prefix), "/", 0);
address = tokens[0];
port = tokens[1];
if (!address || !port || tokens[2]) {
- sr_dbg("Invalid parameters");
+ sr_err("Invalid parameters.");
g_strfreev(tokens);
return SR_ERR_ARG;
}
if (!scpi)
return SR_ERR_MALLOC;
} else {
- sr_dbg("Opening serial device %s", resource);
+ sr_dbg("Opening serial device %s.", resource);
if (!(scpi = scpi_serial_dev_inst_new(resource, serialcomm)))
return SR_ERR_MALLOC;
}
if (strcasecmp(hw_info->manufacturer, "Rigol Technologies")) {
sr_scpi_hw_info_free(hw_info);
+ sr_scpi_close(scpi);
sr_scpi_free(scpi);
return SR_ERR_NA;
}
hw_info->manufacturer, hw_info->model,
hw_info->firmware_version))) {
sr_scpi_hw_info_free(hw_info);
+ sr_scpi_close(scpi);
sr_scpi_free(scpi);
return SR_ERR_NA;
}
sr_scpi_hw_info_free(hw_info);
+ sr_scpi_close(scpi);
sdi->conn = scpi;
std_session_send_df_header(cb_data, LOG_PREFIX);
if (devc->model->protocol == PROTOCOL_LEGACY) {
+ devc->analog_frame_size = DS1000_ANALOG_LIVE_WAVEFORM_SIZE;
/* Fetch the first frame. */
- if (devc->enabled_analog_probes) {
- devc->analog_frame_size = DS1000_ANALOG_LIVE_WAVEFORM_SIZE;
- devc->channel_frame = devc->enabled_analog_probes->data;
- if (sr_scpi_send(sdi->conn, ":WAV:DATA? CHAN%d",
- devc->channel_frame->index + 1) != SR_OK)
- return SR_ERR;
- } else {
- devc->channel_frame = devc->enabled_digital_probes->data;
- if (sr_scpi_send(sdi->conn, ":WAV:DATA? DIG") != SR_OK)
- return SR_ERR;
- }
-
- devc->num_frame_bytes = 0;
+ if (devc->enabled_analog_probes)
+ devc->channel = devc->enabled_analog_probes->data;
+ else
+ devc->channel = devc->enabled_digital_probes->data;
+ if (rigol_ds_channel_start(sdi) != SR_OK)
+ return SR_ERR;
} else {
if (devc->enabled_analog_probes) {
if (devc->data_source == DATA_SOURCE_MEMORY)
return SR_ERR;
} else
devc->analog_frame_size = DS2000_ANALOG_LIVE_WAVEFORM_SIZE;
- devc->channel_frame = devc->enabled_analog_probes->data;
+ devc->channel = devc->enabled_analog_probes->data;
if (rigol_ds_capture_start(sdi) != SR_OK)
return SR_ERR;
}