X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=hardware%2Fatten-pps3xxx%2Fapi.c;h=5ca3dbe99dc9fece512c1c8afbf96a1f7f5930e2;hb=102f12396660e0784134bccce5cc0679db325751;hp=102940b792809faf437888de0dc6a4c3a7363eb0;hpb=53b4680fceab9351fc87b8c5b34854733f5fdac0;p=libsigrok.git diff --git a/hardware/atten-pps3xxx/api.c b/hardware/atten-pps3xxx/api.c index 102940b7..5ca3dbe9 100644 --- a/hardware/atten-pps3xxx/api.c +++ b/hardware/atten-pps3xxx/api.c @@ -87,7 +87,7 @@ static GSList *scan(GSList *options, int modelid) struct drv_context *drvc; struct dev_context *devc; struct sr_config *src; - struct sr_probe *probe; + struct sr_channel *ch; struct sr_channel_group *cg; struct sr_serial_dev_inst *serial; GSList *l, *devices; @@ -126,7 +126,7 @@ static GSList *scan(GSList *options, int modelid) return NULL; serial_flush(serial); - /* This is how the vendor software probes for hardware. */ + /* This is how the vendor software channels for hardware. */ memset(packet, 0, PACKET_SIZE); packet[0] = 0xaa; packet[1] = 0xaa; @@ -167,11 +167,11 @@ static GSList *scan(GSList *options, int modelid) sdi->conn = serial; for (i = 0; i < MAX_CHANNELS; i++) { snprintf(channel, 10, "CH%d", i + 1); - probe = sr_probe_new(i, SR_PROBE_ANALOG, TRUE, channel); - sdi->probes = g_slist_append(sdi->probes, probe); + ch = sr_channel_new(i, SR_CHANNEL_ANALOG, TRUE, channel); + sdi->channels = g_slist_append(sdi->channels, ch); cg = g_malloc(sizeof(struct sr_channel_group)); cg->name = g_strdup(channel); - cg->channels = g_slist_append(NULL, probe); + cg->channels = g_slist_append(NULL, ch); cg->priv = NULL; sdi->channel_groups = g_slist_append(sdi->channel_groups, cg); } @@ -209,7 +209,7 @@ static int config_get(int key, GVariant **data, const struct sr_dev_inst *sdi, const struct sr_channel_group *cg) { struct dev_context *devc; - struct sr_probe *probe; + struct sr_channel *ch; int channel, ret; if (!sdi) @@ -232,8 +232,8 @@ static int config_get(int key, GVariant **data, const struct sr_dev_inst *sdi, } } else { /* We only ever have one channel per channel group in this driver. */ - probe = cg->channels->data; - channel = probe->index; + ch = cg->channels->data; + channel = ch->index; switch (key) { case SR_CONF_OUTPUT_VOLTAGE: @@ -278,7 +278,7 @@ static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi, const struct sr_channel_group *cg) { struct dev_context *devc; - struct sr_probe *probe; + struct sr_channel *ch; gdouble dval; int channel, ret, ival; const char *sval; @@ -323,8 +323,8 @@ static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi, } else { /* Channel group specified: per-channel options. */ /* We only ever have one channel per channel group in this driver. */ - probe = cg->channels->data; - channel = probe->index; + ch = cg->channels->data; + channel = ch->index; switch (key) { case SR_CONF_OUTPUT_VOLTAGE_MAX: @@ -362,7 +362,7 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi, const struct sr_channel_group *cg) { struct dev_context *devc; - struct sr_probe *probe; + struct sr_channel *ch; GVariant *gvar; GVariantBuilder gvb; int channel, ret, i; @@ -403,8 +403,8 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi, if (!sdi) return SR_ERR_ARG; /* We only ever have one channel per channel group in this driver. */ - probe = cg->channels->data; - channel = probe->index; + ch = cg->channels->data; + channel = ch->index; switch (key) { case SR_CONF_DEVICE_OPTIONS: @@ -470,10 +470,11 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi, devc->acquisition_running = TRUE; serial = sdi->conn; - serial_source_add(serial, G_IO_IN, 50, atten_pps3xxx_receive_data, (void *)sdi); + serial_source_add(sdi->session, serial, G_IO_IN, 50, + atten_pps3xxx_receive_data, (void *)sdi); std_session_send_df_header(cb_data, LOG_PREFIX); - /* Send a "probe" configuration packet now. */ + /* Send a "channel" configuration packet now. */ memset(packet, 0, PACKET_SIZE); packet[0] = 0xaa; packet[1] = 0xaa;