sdi->conn = scpi;
sdi->driver = di;
sdi->inst_type = SR_INST_SCPI;
+ sdi->serial_num = g_strdup(hw_info->serial_number);
+
+ sr_scpi_hw_info_free(hw_info);
+ hw_info = NULL;
+
devc = g_malloc0(sizeof(struct dev_context));
devc->device = device;
sdi->priv = devc;
std_session_send_df_header(sdi, LOG_PREFIX);
/* Prime the pipe with the first channel's fetch. */
- ch = sdi->channels->data;
+ ch = next_enabled_channel(sdi, NULL);
pch = ch->priv;
- select_channel(sdi, ch);
+ if ((ret = select_channel(sdi, ch)) != SR_OK)
+ return ret;
if (pch->mq == SR_MQ_VOLTAGE)
cmd = SCPI_CMD_GET_MEAS_VOLTAGE;
else if (pch->mq == SR_MQ_CURRENT)