gchar *channel_name, **version;
if (sr_scpi_get_hw_id(scpi, &hw_info) != SR_OK) {
- sr_info("Couldn't get IDN response.");
- return NULL;
+ sr_info("Couldn't get IDN response, retrying.");
+ sr_scpi_close(scpi);
+ sr_scpi_open(scpi);
+ if (sr_scpi_get_hw_id(scpi, &hw_info) != SR_OK) {
+ sr_info("Couldn't get IDN response.");
+ return NULL;
+ }
}
for (i = 0; i < ARRAY_SIZE(supported_models); i++) {
if (rigol_ds_config_set(sdi, ":RUN") != SR_OK)
return SR_ERR;
- sr_scpi_source_add(scpi, G_IO_IN, 50, rigol_ds_receive, (void *)sdi);
+ sr_scpi_source_add(sdi->session, scpi, G_IO_IN, 50,
+ rigol_ds_receive, (void *)sdi);
/* Send header packet to the session bus. */
std_session_send_df_header(cb_data, LOG_PREFIX);
devc->enabled_analog_channels = NULL;
devc->enabled_digital_channels = NULL;
scpi = sdi->conn;
- sr_scpi_source_remove(scpi);
+ sr_scpi_source_remove(sdi->session, scpi);
return SR_OK;
}