if (serial_open(serial, SERIAL_RDWR) != SR_OK)
return NULL;
- serial_flush(serial);
-
/* This is how the vendor software scans for hardware. */
memset(packet, 0, PACKET_SIZE);
packet[0] = 0xaa;
for (i = 0; i < MAX_CHANNELS; i++) {
snprintf(channel, 10, "CH%d", i + 1);
ch = sr_channel_new(sdi, i, SR_CHANNEL_ANALOG, TRUE, channel);
- cg = g_malloc(sizeof(struct sr_channel_group));
- cg->name = g_strdup(channel);
+ cg = sr_channel_group_new(sdi, channel, NULL);
cg->channels = g_slist_append(NULL, ch);
- cg->priv = NULL;
- sdi->channel_groups = g_slist_append(sdi->channel_groups, cg);
}
devc = g_malloc0(sizeof(struct dev_context));