sdi = NULL;
devc = NULL;
- conn = serialcomm = NULL;
/* Process and check options. */
+ conn = NULL;
+ serialcomm = SERIALCOMM;
if (sr_serial_extract_options(options, &conn, &serialcomm) != SR_OK)
return NULL;
- if (!serialcomm)
- serialcomm = SERIALCOMM;
/* Init serial port. */
serial = sr_serial_dev_inst_new(conn, serialcomm);
goto exit_err;
/* Query and verify model string. */
- serial_flush(serial);
if (lps_cmd_reply(buf, serial, "MODEL") != SR_OK)
return NULL;
devc->channel_status[cnt].info = g_slist_append(NULL, ch);
- cg = g_malloc(sizeof(struct sr_channel_group));
- snprintf(channel, sizeof(channel), "CG%d", cnt+1);
- cg->name = g_strdup(channel);
- cg->priv = NULL;
+ snprintf(channel, sizeof(channel), "CG%d", cnt + 1);
+ cg = sr_channel_group_new(sdi, channel, NULL);
cg->channels = g_slist_append(NULL, ch);
-
- sdi->channel_groups = g_slist_append(sdi->channel_groups, cg);
}
/* Query status */