From: Uwe Hermann Date: Fri, 14 Mar 2014 20:09:37 +0000 (+0100) Subject: Replace 'probe group' with 'channel group' everywhere. X-Git-Tag: libsigrok-0.3.0~113 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=660e398fe9f5fc608787f8fd75a9df8aac61026f;p=libsigrok.git Replace 'probe group' with 'channel group' everywhere. The name 'probe' (and thus 'probe group') is a relic from the times when sigrok was mostly about logic analyzers. Nowadays we support a lot more device types where 'probe' is not really a good term and 'channel' is much better suited. This fixes parts of bug #259. --- diff --git a/bindings/python/sigrok/core/classes.py b/bindings/python/sigrok/core/classes.py index b5a64cfc..2dcd1d95 100644 --- a/bindings/python/sigrok/core/classes.py +++ b/bindings/python/sigrok/core/classes.py @@ -26,7 +26,7 @@ import itertools __all__ = ['Error', 'Context', 'Driver', 'Device', 'Session', 'Packet', 'Log', 'LogLevel', 'PacketType', 'Quantity', 'Unit', 'QuantityFlag', 'ConfigKey', - 'ProbeType', 'Probe', 'ProbeGroup', 'InputFormat', 'OutputFormat', + 'ProbeType', 'Probe', 'ChannelGroup', 'InputFormat', 'OutputFormat', 'InputFile', 'Output'] class Error(Exception): @@ -174,7 +174,7 @@ class Device(object): device.struct = struct device.context = context device._probes = None - device._probe_groups = None + device._channel_groups = None context._devices[address] = device return context._devices[address] @@ -202,17 +202,17 @@ class Device(object): return self._probes @property - def probe_groups(self): - if self._probe_groups is None: - self._probe_groups = {} - probe_group_list = self.struct.probe_groups - while (probe_group_list): - probe_group_ptr = void_ptr_to_sr_probe_group_ptr( - probe_group_list.data) - self._probe_groups[probe_group_ptr.name] = ProbeGroup(self, - probe_group_ptr) - probe_group_list = probe_group_list.next - return self._probe_groups + def channel_groups(self): + if self._channel_groups is None: + self._channel_groups = {} + channel_group_list = self.struct.channel_groups + while (channel_group_list): + channel_group_ptr = void_ptr_to_sr_channel_group_ptr( + channel_group_list.data) + self._channel_groups[channel_group_ptr.name] = ChannelGroup(self, + channel_group_ptr) + channel_group_list = channel_group_list.next + return self._channel_groups class HardwareDevice(Device): @@ -262,15 +262,15 @@ class Probe(object): def name(self): return self.struct.name -class ProbeGroup(object): +class ChannelGroup(object): def __init__(self, device, struct): self.device = device self.struct = struct - self._probes = None + self._channels = None def __iter__(self): - return iter(self.probes) + return iter(self.channels) def __getattr__(self, name): key = config_key(name) @@ -281,7 +281,7 @@ class ProbeGroup(object): except Error as error: if error.errno == SR_ERR_NA: raise NotImplementedError( - "Probe group does not implement %s" % name) + "Channel group does not implement %s" % name) else: raise AttributeError value = gvariant_ptr_ptr_value(data) @@ -291,7 +291,7 @@ class ProbeGroup(object): try: key = config_key(name) except AttributeError: - super(ProbeGroup, self).__setattr__(name, value) + super(ChannelGroup, self).__setattr__(name, value) return check(sr_config_set(self.device.struct, self.struct, key.id, python_to_gvariant(value))) @@ -301,15 +301,15 @@ class ProbeGroup(object): return self.struct.name @property - def probes(self): - if self._probes is None: - self._probes = [] - probe_list = self.struct.probes - while (probe_list): - probe_ptr = void_ptr_to_sr_probe_ptr(probe_list.data) - self._probes.append(Probe(self, probe_ptr)) - probe_list = probe_list.next - return self._probes + def channels(self): + if self._channels is None: + self._channels = [] + channel_list = self.struct.channels + while (channel_list): + channel_ptr = void_ptr_to_sr_probe_ptr(channel_list.data) + self._channels.append(Probe(self, probe_ptr)) + channel_list = channel_list.next + return self._channels class Session(object): diff --git a/bindings/swig/libsigrok.i b/bindings/swig/libsigrok.i index d670efc8..5b591489 100644 --- a/bindings/swig/libsigrok.i +++ b/bindings/swig/libsigrok.i @@ -99,7 +99,7 @@ gchar *g_string_free(GString *string, gboolean free_segment); %pointer_cast(void *, struct sr_datafeed_logic *, void_ptr_to_sr_datafeed_logic_ptr) %pointer_cast(void *, struct sr_datafeed_analog *, void_ptr_to_sr_datafeed_analog_ptr) %pointer_cast(void *, struct sr_probe *, void_ptr_to_sr_probe_ptr) -%pointer_cast(void *, struct sr_probe_group *, void_ptr_to_sr_probe_group_ptr) +%pointer_cast(void *, struct sr_channel_group *, void_ptr_to_sr_channel_group_ptr) %extend sr_input_format { int call_format_match(const char *filename) { diff --git a/device.c b/device.c index 212ddb7d..c01bc92f 100644 --- a/device.c +++ b/device.c @@ -285,7 +285,7 @@ SR_PRIV struct sr_dev_inst *sr_dev_inst_new(int index, int status, sdi->model = model ? g_strdup(model) : NULL; sdi->version = version ? g_strdup(version) : NULL; sdi->probes = NULL; - sdi->probe_groups = NULL; + sdi->channel_groups = NULL; sdi->conn = NULL; sdi->priv = NULL; @@ -309,8 +309,8 @@ SR_PRIV void sr_dev_inst_free(struct sr_dev_inst *sdi) } g_slist_free(sdi->probes); - if (sdi->probe_groups) - g_slist_free(sdi->probe_groups); + if (sdi->channel_groups) + g_slist_free(sdi->channel_groups); g_free(sdi->vendor); g_free(sdi->model); diff --git a/error.c b/error.c index a04a983f..f8779752 100644 --- a/error.c +++ b/error.c @@ -76,8 +76,8 @@ SR_API const char *sr_strerror(int error_code) return "device closed but should be open"; case SR_ERR_TIMEOUT: return "timeout occurred"; - case SR_ERR_PROBE_GROUP: - return "no probe group specified"; + case SR_ERR_CHANNEL_GROUP: + return "no channel group specified"; default: return "unknown error"; } @@ -127,8 +127,8 @@ SR_API const char *sr_strerror_name(int error_code) return "SR_ERR_DEV_CLOSED"; case SR_ERR_TIMEOUT: return "SR_ERR_TIMEOUT"; - case SR_ERR_PROBE_GROUP: - return "SR_PROBE_GROUP"; + case SR_ERR_CHANNEL_GROUP: + return "SR_ERR_CHANNEL_GROUP"; default: return "unknown error code"; } diff --git a/hardware/agilent-dmm/api.c b/hardware/agilent-dmm/api.c index 0c743b32..2c2a88bf 100644 --- a/hardware/agilent-dmm/api.c +++ b/hardware/agilent-dmm/api.c @@ -170,11 +170,11 @@ static int cleanup(void) } static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi, - const struct sr_probe_group *probe_group) + const struct sr_channel_group *channel_group) { struct dev_context *devc; - (void)probe_group; + (void)channel_group; if (sdi->status != SR_ST_ACTIVE) return SR_ERR_DEV_CLOSED; @@ -208,10 +208,10 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi, } static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi, - const struct sr_probe_group *probe_group) + const struct sr_channel_group *channel_group) { (void)sdi; - (void)probe_group; + (void)channel_group; switch (key) { case SR_CONF_SCAN_OPTIONS: diff --git a/hardware/alsa/api.c b/hardware/alsa/api.c index 0f54eb48..5538e4f0 100644 --- a/hardware/alsa/api.c +++ b/hardware/alsa/api.c @@ -129,11 +129,11 @@ static int cleanup(void) } static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi, - const struct sr_probe_group *probe_group) + const struct sr_channel_group *channel_group) { struct dev_context *devc; - (void)probe_group; + (void)channel_group; switch (id) { case SR_CONF_SAMPLERATE: @@ -148,11 +148,11 @@ static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi, } static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi, - const struct sr_probe_group *probe_group) + const struct sr_channel_group *channel_group) { struct dev_context *devc; - (void)probe_group; + (void)channel_group; if (sdi->status != SR_ST_ACTIVE) return SR_ERR_DEV_CLOSED; @@ -174,14 +174,14 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi, } static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi, - const struct sr_probe_group *probe_group) + const struct sr_channel_group *channel_group) { struct dev_context *devc; GVariant *gvar; GVariantBuilder gvb; int i; - (void)probe_group; + (void)channel_group; switch (key) { case SR_CONF_DEVICE_OPTIONS: diff --git a/hardware/appa-55ii/api.c b/hardware/appa-55ii/api.c index 73c71af3..af22cb5c 100644 --- a/hardware/appa-55ii/api.c +++ b/hardware/appa-55ii/api.c @@ -138,11 +138,11 @@ static int cleanup(void) } static int config_get(int key, GVariant **data, const struct sr_dev_inst *sdi, - const struct sr_probe_group *probe_group) + const struct sr_channel_group *channel_group) { struct dev_context *devc = sdi->priv; - (void)probe_group; + (void)channel_group; switch (key) { case SR_CONF_LIMIT_SAMPLES: @@ -162,13 +162,13 @@ static int config_get(int key, GVariant **data, const struct sr_dev_inst *sdi, } static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi, - const struct sr_probe_group *probe_group) + const struct sr_channel_group *channel_group) { struct dev_context *devc; const char *tmp_str; unsigned int i; - (void)probe_group; + (void)channel_group; if (sdi->status != SR_ST_ACTIVE) return SR_ERR_DEV_CLOSED; @@ -206,10 +206,10 @@ static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi, } static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi, - const struct sr_probe_group *probe_group) + const struct sr_channel_group *channel_group) { (void)sdi; - (void)probe_group; + (void)channel_group; switch (key) { case SR_CONF_SCAN_OPTIONS: diff --git a/hardware/asix-sigma/asix-sigma.c b/hardware/asix-sigma/asix-sigma.c index a7a1d46a..3909638f 100644 --- a/hardware/asix-sigma/asix-sigma.c +++ b/hardware/asix-sigma/asix-sigma.c @@ -745,11 +745,11 @@ static int cleanup(void) } static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi, - const struct sr_probe_group *probe_group) + const struct sr_channel_group *channel_group) { struct dev_context *devc; - (void)probe_group; + (void)channel_group; switch (id) { case SR_CONF_SAMPLERATE: @@ -767,12 +767,12 @@ static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi, } static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi, - const struct sr_probe_group *probe_group) + const struct sr_channel_group *channel_group) { struct dev_context *devc; int ret; - (void)probe_group; + (void)channel_group; if (sdi->status != SR_ST_ACTIVE) return SR_ERR_DEV_CLOSED; @@ -801,13 +801,13 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi, } static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi, - const struct sr_probe_group *probe_group) + const struct sr_channel_group *channel_group) { GVariant *gvar; GVariantBuilder gvb; (void)sdi; - (void)probe_group; + (void)channel_group; switch (key) { case SR_CONF_DEVICE_OPTIONS: diff --git a/hardware/atten-pps3xxx/api.c b/hardware/atten-pps3xxx/api.c index c7e97601..ec344f3b 100644 --- a/hardware/atten-pps3xxx/api.c +++ b/hardware/atten-pps3xxx/api.c @@ -88,7 +88,7 @@ static GSList *scan(GSList *options, int modelid) struct dev_context *devc; struct sr_config *src; struct sr_probe *probe; - struct sr_probe_group *pg; + struct sr_channel_group *pg; struct sr_serial_dev_inst *serial; GSList *l, *devices; struct pps_model *model; @@ -169,11 +169,11 @@ static GSList *scan(GSList *options, int modelid) 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); - pg = g_malloc(sizeof(struct sr_probe_group)); + pg = g_malloc(sizeof(struct sr_channel_group)); pg->name = g_strdup(channel); pg->probes = g_slist_append(NULL, probe); pg->priv = NULL; - sdi->probe_groups = g_slist_append(sdi->probe_groups, pg); + sdi->channel_groups = g_slist_append(sdi->channel_groups, pg); } devc = g_malloc0(sizeof(struct dev_context)); @@ -206,7 +206,7 @@ static int cleanup(void) } static int config_get(int key, GVariant **data, const struct sr_dev_inst *sdi, - const struct sr_probe_group *probe_group) + const struct sr_channel_group *channel_group) { struct dev_context *devc; struct sr_probe *probe; @@ -218,8 +218,8 @@ static int config_get(int key, GVariant **data, const struct sr_dev_inst *sdi, devc = sdi->priv; ret = SR_OK; - if (!probe_group) { - /* No probe group: global options. */ + if (!channel_group) { + /* No channel group: global options. */ switch (key) { case SR_CONF_OUTPUT_CHANNEL: *data = g_variant_new_string(channel_modes[devc->channel_mode]); @@ -231,8 +231,8 @@ static int config_get(int key, GVariant **data, const struct sr_dev_inst *sdi, return SR_ERR_NA; } } else { - /* We only ever have one channel per probe group in this driver. */ - probe = probe_group->probes->data; + /* We only ever have one channel per channel group in this driver. */ + probe = channel_group->probes->data; channel = probe->index; switch (key) { @@ -275,7 +275,7 @@ static int find_str(const char *str, const char **strings, int array_size) } static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi, - const struct sr_probe_group *probe_group) + const struct sr_channel_group *channel_group) { struct dev_context *devc; struct sr_probe *probe; @@ -289,8 +289,8 @@ static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi, ret = SR_OK; devc = sdi->priv; - if (!probe_group) { - /* No probe group: global options. */ + if (!channel_group) { + /* No channel group: global options. */ switch (key) { case SR_CONF_OUTPUT_CHANNEL: sval = g_variant_get_string(data, NULL); @@ -321,9 +321,9 @@ static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi, return SR_ERR_NA; } } else { - /* Probe group specified: per-channel options. */ - /* We only ever have one channel per probe group in this driver. */ - probe = probe_group->probes->data; + /* Channel group specified: per-channel options. */ + /* We only ever have one channel per channel group in this driver. */ + probe = channel_group->probes->data; channel = probe->index; switch (key) { @@ -359,7 +359,7 @@ static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi, } static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi, - const struct sr_probe_group *probe_group) + const struct sr_channel_group *channel_group) { struct dev_context *devc; struct sr_probe *probe; @@ -379,8 +379,8 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi, devc = sdi->priv; ret = SR_OK; - if (!probe_group) { - /* No probe group: global options. */ + if (!channel_group) { + /* No channel group: global options. */ switch (key) { case SR_CONF_DEVICE_OPTIONS: *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32, @@ -399,11 +399,11 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi, return SR_ERR_NA; } } else { - /* Probe group specified: per-channel options. */ + /* Channel group specified: per-channel options. */ if (!sdi) return SR_ERR_ARG; - /* We only ever have one channel per probe group in this driver. */ - probe = probe_group->probes->data; + /* We only ever have one channel per channel group in this driver. */ + probe = channel_group->probes->data; channel = probe->index; switch (key) { diff --git a/hardware/brymen-bm86x/api.c b/hardware/brymen-bm86x/api.c index 802d443a..2a5d5feb 100644 --- a/hardware/brymen-bm86x/api.c +++ b/hardware/brymen-bm86x/api.c @@ -183,11 +183,11 @@ static int cleanup(void) } static int config_get(int key, GVariant **data, const struct sr_dev_inst *sdi, - const struct sr_probe_group *probe_group) + const struct sr_channel_group *channel_group) { struct dev_context *devc = sdi->priv; - (void)probe_group; + (void)channel_group; switch (key) { case SR_CONF_LIMIT_SAMPLES: @@ -204,11 +204,11 @@ static int config_get(int key, GVariant **data, const struct sr_dev_inst *sdi, } static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi, - const struct sr_probe_group *probe_group) + const struct sr_channel_group *channel_group) { struct dev_context *devc; - (void)probe_group; + (void)channel_group; if (sdi->status != SR_ST_ACTIVE) return SR_ERR_DEV_CLOSED; @@ -235,10 +235,10 @@ static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi, } static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi, - const struct sr_probe_group *probe_group) + const struct sr_channel_group *channel_group) { (void)sdi; - (void)probe_group; + (void)channel_group; switch (key) { case SR_CONF_SCAN_OPTIONS: diff --git a/hardware/brymen-dmm/api.c b/hardware/brymen-dmm/api.c index cd11cc5e..0b5a272d 100644 --- a/hardware/brymen-dmm/api.c +++ b/hardware/brymen-dmm/api.c @@ -150,12 +150,12 @@ static int cleanup(void) } static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi, - const struct sr_probe_group *probe_group) + const struct sr_channel_group *channel_group) { struct dev_context *devc; int ret; - (void)probe_group; + (void)channel_group; if (sdi->status != SR_ST_ACTIVE) return SR_ERR_DEV_CLOSED; @@ -181,10 +181,10 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi, } static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi, - const struct sr_probe_group *probe_group) + const struct sr_channel_group *channel_group) { (void)sdi; - (void)probe_group; + (void)channel_group; switch (key) { case SR_CONF_SCAN_OPTIONS: diff --git a/hardware/cem-dt-885x/api.c b/hardware/cem-dt-885x/api.c index 1e036355..3dbb9a39 100644 --- a/hardware/cem-dt-885x/api.c +++ b/hardware/cem-dt-885x/api.c @@ -166,14 +166,14 @@ static int cleanup(void) } static int config_get(int key, GVariant **data, const struct sr_dev_inst *sdi, - const struct sr_probe_group *probe_group) + const struct sr_channel_group *channel_group) { struct dev_context *devc; GVariant *range[2]; uint64_t low, high; int tmp, ret; - (void)probe_group; + (void)channel_group; if (!sdi) return SR_ERR_ARG; @@ -238,7 +238,7 @@ static int config_get(int key, GVariant **data, const struct sr_dev_inst *sdi, } static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi, - const struct sr_probe_group *probe_group) + const struct sr_channel_group *channel_group) { struct dev_context *devc; uint64_t tmp_u64, low, high; @@ -246,7 +246,7 @@ static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi, int tmp, ret; const char *tmp_str; - (void)probe_group; + (void)channel_group; if (sdi->status != SR_ST_ACTIVE) return SR_ERR_DEV_CLOSED; @@ -328,7 +328,7 @@ static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi, } static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi, - const struct sr_probe_group *probe_group) + const struct sr_channel_group *channel_group) { GVariant *tuple, *range[2]; GVariantBuilder gvb; @@ -336,7 +336,7 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi, int ret; (void)sdi; - (void)probe_group; + (void)channel_group; ret = SR_OK; switch (key) { diff --git a/hardware/center-3xx/api.c b/hardware/center-3xx/api.c index b85273e5..c7539da8 100644 --- a/hardware/center-3xx/api.c +++ b/hardware/center-3xx/api.c @@ -161,11 +161,11 @@ static int cleanup(int idx) } static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi, - const struct sr_probe_group *probe_group) + const struct sr_channel_group *channel_group) { struct dev_context *devc; - (void)probe_group; + (void)channel_group; if (sdi->status != SR_ST_ACTIVE) return SR_ERR_DEV_CLOSED; @@ -191,10 +191,10 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi, } static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi, - const struct sr_probe_group *probe_group) + const struct sr_channel_group *channel_group) { (void)sdi; - (void)probe_group; + (void)channel_group; switch (key) { case SR_CONF_SCAN_OPTIONS: diff --git a/hardware/chronovu-la8/api.c b/hardware/chronovu-la8/api.c index 0fc90353..c14d63ad 100644 --- a/hardware/chronovu-la8/api.c +++ b/hardware/chronovu-la8/api.c @@ -263,11 +263,11 @@ static int cleanup(void) } static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi, - const struct sr_probe_group *probe_group) + const struct sr_channel_group *channel_group) { struct dev_context *devc; - (void)probe_group; + (void)channel_group; switch (id) { case SR_CONF_SAMPLERATE: @@ -287,11 +287,11 @@ static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi, } static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi, - const struct sr_probe_group *probe_group) + const struct sr_channel_group *channel_group) { struct dev_context *devc; - (void)probe_group; + (void)channel_group; if (sdi->status != SR_ST_ACTIVE) return SR_ERR_DEV_CLOSED; @@ -333,13 +333,13 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi, } static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi, - const struct sr_probe_group *probe_group) + const struct sr_channel_group *channel_group) { GVariant *gvar, *grange[2]; GVariantBuilder gvb; (void)sdi; - (void)probe_group; + (void)channel_group; switch (key) { case SR_CONF_DEVICE_OPTIONS: diff --git a/hardware/colead-slm/api.c b/hardware/colead-slm/api.c index b24198cc..c3046d4b 100644 --- a/hardware/colead-slm/api.c +++ b/hardware/colead-slm/api.c @@ -130,11 +130,11 @@ static int cleanup(void) } static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi, - const struct sr_probe_group *probe_group) + const struct sr_channel_group *channel_group) { struct dev_context *devc; - (void)probe_group; + (void)channel_group; if (sdi->status != SR_ST_ACTIVE) return SR_ERR_DEV_CLOSED; @@ -168,10 +168,10 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi, } static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi, - const struct sr_probe_group *probe_group) + const struct sr_channel_group *channel_group) { (void)sdi; - (void)probe_group; + (void)channel_group; switch (key) { case SR_CONF_SCAN_OPTIONS: diff --git a/hardware/conrad-digi-35-cpu/api.c b/hardware/conrad-digi-35-cpu/api.c index bab100dc..29a0f375 100644 --- a/hardware/conrad-digi-35-cpu/api.c +++ b/hardware/conrad-digi-35-cpu/api.c @@ -122,12 +122,12 @@ static int cleanup(void) } static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi, - const struct sr_probe_group *probe_group) + const struct sr_channel_group *channel_group) { int ret; double dblval; - (void)probe_group; + (void)channel_group; if (sdi->status != SR_ST_ACTIVE) return SR_ERR_DEV_CLOSED; @@ -165,12 +165,12 @@ static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi, } static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi, - const struct sr_probe_group *probe_group) + const struct sr_channel_group *channel_group) { int ret; (void)sdi; - (void)probe_group; + (void)channel_group; ret = SR_OK; switch (key) { diff --git a/hardware/demo/demo.c b/hardware/demo/demo.c index 329fd170..39c42302 100644 --- a/hardware/demo/demo.c +++ b/hardware/demo/demo.c @@ -118,12 +118,12 @@ struct dev_context { /* Logic */ int32_t num_logic_probes; unsigned int logic_unitsize; - /* There is only ever one logic probe group, so its pattern goes here. */ + /* There is only ever one logic channel group, so its pattern goes here. */ uint8_t logic_pattern; unsigned char logic_data[LOGIC_BUFSIZE]; /* Analog */ int32_t num_analog_probes; - GSList *analog_probe_groups; + GSList *analog_channel_groups; }; static const int32_t scanopts[] = { @@ -171,7 +171,7 @@ static int init(struct sr_context *sr_ctx) return std_init(sr_ctx, di, LOG_PREFIX); } -static void generate_analog_pattern(const struct sr_probe_group *probe_group, uint64_t sample_rate) +static void generate_analog_pattern(const struct sr_channel_group *channel_group, uint64_t sample_rate) { struct analog_gen *ag; double t, frequency; @@ -179,12 +179,12 @@ static void generate_analog_pattern(const struct sr_probe_group *probe_group, ui unsigned int num_samples, i; int last_end; - ag = probe_group->priv; + ag = channel_group->priv; num_samples = ANALOG_BUFSIZE / sizeof(float); - sr_dbg("Generating %s pattern for probe group %s", + sr_dbg("Generating %s pattern for channel group %s", analog_pattern_str[ag->pattern], - probe_group->name); + channel_group->name); switch (ag->pattern) { case PATTERN_SQUARE: @@ -257,7 +257,7 @@ static GSList *scan(GSList *options) struct dev_context *devc; struct sr_dev_inst *sdi; struct sr_probe *probe; - struct sr_probe_group *pg; + struct sr_channel_group *pg; struct sr_config *src; struct analog_gen *ag; GSList *devices, *l; @@ -300,10 +300,10 @@ static GSList *scan(GSList *options) devc->logic_unitsize = (devc->num_logic_probes + 7) / 8; devc->logic_pattern = PATTERN_SIGROK; devc->num_analog_probes = num_analog_probes; - devc->analog_probe_groups = NULL; + devc->analog_channel_groups = NULL; - /* Logic probes, all in one probe group. */ - if (!(pg = g_try_malloc(sizeof(struct sr_probe_group)))) + /* Logic probes, all in one channel group. */ + if (!(pg = g_try_malloc(sizeof(struct sr_channel_group)))) return NULL; pg->name = g_strdup("Logic"); pg->probes = NULL; @@ -315,9 +315,9 @@ static GSList *scan(GSList *options) sdi->probes = g_slist_append(sdi->probes, probe); pg->probes = g_slist_append(pg->probes, probe); } - sdi->probe_groups = g_slist_append(NULL, pg); + sdi->channel_groups = g_slist_append(NULL, pg); - /* Analog probes, probe groups and pattern generators. */ + /* Analog probes, channel groups and pattern generators. */ pattern = 0; for (i = 0; i < num_analog_probes; i++) { @@ -327,13 +327,13 @@ static GSList *scan(GSList *options) return NULL; sdi->probes = g_slist_append(sdi->probes, probe); - /* Every analog probe gets its own probe group. */ - if (!(pg = g_try_malloc(sizeof(struct sr_probe_group)))) + /* Every analog probe gets its own channel group. */ + if (!(pg = g_try_malloc(sizeof(struct sr_channel_group)))) return NULL; pg->name = g_strdup(probe_name); pg->probes = g_slist_append(NULL, probe); - /* Every probe group gets a generator struct. */ + /* Every channel group gets a generator struct. */ if (!(ag = g_try_malloc(sizeof(struct analog_gen)))) return NULL; ag->packet.probes = pg->probes; @@ -344,8 +344,8 @@ static GSList *scan(GSList *options) ag->pattern = pattern; pg->priv = ag; - sdi->probe_groups = g_slist_append(sdi->probe_groups, pg); - devc->analog_probe_groups = g_slist_append(devc->analog_probe_groups, pg); + sdi->channel_groups = g_slist_append(sdi->channel_groups, pg); + devc->analog_channel_groups = g_slist_append(devc->analog_channel_groups, pg); if (++pattern == ARRAY_SIZE(analog_pattern_str)) pattern = 0; @@ -383,7 +383,7 @@ static int cleanup(void) } static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi, - const struct sr_probe_group *probe_group) + const struct sr_channel_group *channel_group) { struct dev_context *devc; struct sr_probe *probe; @@ -405,14 +405,14 @@ static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi, *data = g_variant_new_uint64(devc->limit_msec); break; case SR_CONF_PATTERN_MODE: - if (!probe_group) - return SR_ERR_PROBE_GROUP; - probe = probe_group->probes->data; + if (!channel_group) + return SR_ERR_CHANNEL_GROUP; + probe = channel_group->probes->data; if (probe->type == SR_PROBE_LOGIC) { pattern = devc->logic_pattern; *data = g_variant_new_string(logic_pattern_str[pattern]); } else if (probe->type == SR_PROBE_ANALOG) { - ag = probe_group->priv; + ag = channel_group->priv; pattern = ag->pattern; *data = g_variant_new_string(analog_pattern_str[pattern]); } else @@ -432,7 +432,7 @@ static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi, } static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi, - const struct sr_probe_group *probe_group) + const struct sr_channel_group *channel_group) { struct dev_context *devc; struct analog_gen *ag; @@ -463,10 +463,10 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi, sr_dbg("Setting time limit to %" PRIu64"ms", devc->limit_msec); break; case SR_CONF_PATTERN_MODE: - if (!probe_group) - return SR_ERR_PROBE_GROUP; + if (!channel_group) + return SR_ERR_CHANNEL_GROUP; stropt = g_variant_get_string(data, NULL); - probe = probe_group->probes->data; + probe = channel_group->probes->data; pattern = -1; if (probe->type == SR_PROBE_LOGIC) { for (i = 0; i < ARRAY_SIZE(logic_pattern_str); i++) { @@ -495,10 +495,10 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi, } if (pattern == -1) return SR_ERR_ARG; - sr_dbg("Setting analog pattern for probe group %s to %s", - probe_group->name, + sr_dbg("Setting analog pattern for channel group %s to %s", + channel_group->name, analog_pattern_str[pattern]); - ag = probe_group->priv; + ag = channel_group->priv; ag->pattern = pattern; } else return SR_ERR_BUG; @@ -511,7 +511,7 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi, } static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi, - const struct sr_probe_group *probe_group) + const struct sr_channel_group *channel_group) { struct sr_probe *probe; GVariant *gvar; @@ -528,7 +528,7 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi, if (!sdi) return SR_ERR_ARG; - if (!probe_group) { + if (!channel_group) { switch (key) { case SR_CONF_DEVICE_OPTIONS: *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32, @@ -545,7 +545,7 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi, return SR_ERR_NA; } } else { - probe = probe_group->probes->data; + probe = channel_group->probes->data; switch (key) { case SR_CONF_DEVICE_OPTIONS: *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32, @@ -617,7 +617,7 @@ static int prepare_data(int fd, int revents, void *cb_data) struct dev_context *devc; struct sr_datafeed_packet packet; struct sr_datafeed_logic logic; - struct sr_probe_group *pg; + struct sr_channel_group *pg; struct analog_gen *ag; GSList *l; uint64_t logic_todo, analog_todo, expected_samplenum, analog_samples, sending_now; @@ -657,7 +657,7 @@ static int prepare_data(int fd, int revents, void *cb_data) /* Analog, one probe at a time */ if (devc->num_analog_probes > 0 && analog_todo > 0) { sending_now = 0; - for (l = devc->analog_probe_groups; l; l = l->next) { + for (l = devc->analog_channel_groups; l; l = l->next) { pg = l->data; ag = pg->priv; packet.type = SR_DF_ANALOG; @@ -669,7 +669,7 @@ static int prepare_data(int fd, int revents, void *cb_data) * help here as well */ analog_samples = MIN(analog_todo, ag->num_samples); - /* Whichever probe group gets there first. */ + /* Whichever channel group gets there first. */ sending_now = MAX(sending_now, analog_samples); ag->packet.num_samples = analog_samples; sr_session_send(sdi, &packet); @@ -714,7 +714,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi, void *cb_data) return SR_ERR; } - for (l = devc->analog_probe_groups; l; l = l->next) { + for (l = devc->analog_channel_groups; l; l = l->next) { generate_analog_pattern(l->data, devc->cur_samplerate); } diff --git a/hardware/fluke-dmm/api.c b/hardware/fluke-dmm/api.c index d9d3d9b8..26d12669 100644 --- a/hardware/fluke-dmm/api.c +++ b/hardware/fluke-dmm/api.c @@ -204,11 +204,11 @@ static int cleanup(void) } static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi, - const struct sr_probe_group *probe_group) + const struct sr_channel_group *channel_group) { struct dev_context *devc; - (void)probe_group; + (void)channel_group; if (sdi->status != SR_ST_ACTIVE) return SR_ERR_DEV_CLOSED; @@ -242,10 +242,10 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi, } static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi, - const struct sr_probe_group *probe_group) + const struct sr_channel_group *channel_group) { (void)sdi; - (void)probe_group; + (void)channel_group; switch (key) { case SR_CONF_SCAN_OPTIONS: diff --git a/hardware/fx2lafw/api.c b/hardware/fx2lafw/api.c index 4ba888c4..7b9c2226 100644 --- a/hardware/fx2lafw/api.c +++ b/hardware/fx2lafw/api.c @@ -347,13 +347,13 @@ static int cleanup(void) } static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi, - const struct sr_probe_group *probe_group) + const struct sr_channel_group *channel_group) { struct dev_context *devc; struct sr_usb_dev_inst *usb; char str[128]; - (void)probe_group; + (void)channel_group; switch (id) { case SR_CONF_CONN: @@ -381,12 +381,12 @@ static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi, } static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi, - const struct sr_probe_group *probe_group) + const struct sr_channel_group *channel_group) { struct dev_context *devc; int ret; - (void)probe_group; + (void)channel_group; if (sdi->status != SR_ST_ACTIVE) return SR_ERR; @@ -407,13 +407,13 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi, } static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi, - const struct sr_probe_group *probe_group) + const struct sr_channel_group *channel_group) { GVariant *gvar; GVariantBuilder gvb; (void)sdi; - (void)probe_group; + (void)channel_group; switch (key) { case SR_CONF_SCAN_OPTIONS: diff --git a/hardware/gmc-mh-1x-2x/api.c b/hardware/gmc-mh-1x-2x/api.c index f2f6018d..e79bdbcf 100644 --- a/hardware/gmc-mh-1x-2x/api.c +++ b/hardware/gmc-mh-1x-2x/api.c @@ -423,18 +423,18 @@ static int cleanup_2x_bd232(void) /** Get value of configuration item */ static int config_get(int key, GVariant **data, const struct sr_dev_inst *sdi, - const struct sr_probe_group *probe_group) + const struct sr_channel_group *channel_group) { int ret; struct dev_context *devc; (void)sdi; (void)data; - (void)probe_group; + (void)channel_group; ret = SR_OK; - (void)probe_group; + (void)channel_group; if (!sdi || !(devc = sdi->priv)) return SR_ERR_ARG; @@ -460,10 +460,10 @@ static int config_get(int key, GVariant **data, const struct sr_dev_inst *sdi, /** Implementation of config_list, auxiliary function for common parts, */ static int config_list_common(int key, GVariant **data, const struct sr_dev_inst *sdi, - const struct sr_probe_group *probe_group) + const struct sr_channel_group *channel_group) { (void)sdi; - (void)probe_group; + (void)channel_group; switch (key) { case SR_CONF_SCAN_OPTIONS: @@ -479,10 +479,10 @@ static int config_list_common(int key, GVariant **data, const struct sr_dev_inst /** Implementation of config_list for Metrahit 1x/2x send mode */ static int config_list_sm(int key, GVariant **data, const struct sr_dev_inst *sdi, - const struct sr_probe_group *probe_group) + const struct sr_channel_group *channel_group) { (void)sdi; - (void)probe_group; + (void)channel_group; switch (key) { case SR_CONF_DEVICE_OPTIONS: @@ -490,7 +490,7 @@ static int config_list_sm(int key, GVariant **data, const struct sr_dev_inst *sd hwcaps_sm, ARRAY_SIZE(hwcaps_sm), sizeof(int32_t)); break; default: - return config_list_common(key, data, sdi, probe_group); + return config_list_common(key, data, sdi, channel_group); } return SR_OK; @@ -498,10 +498,10 @@ static int config_list_sm(int key, GVariant **data, const struct sr_dev_inst *sd /** Implementation of config_list for Metrahit 2x bidirectional mode */ static int config_list_bd(int key, GVariant **data, const struct sr_dev_inst *sdi, - const struct sr_probe_group *probe_group) + const struct sr_channel_group *channel_group) { (void)sdi; - (void)probe_group; + (void)channel_group; switch (key) { case SR_CONF_DEVICE_OPTIONS: @@ -509,7 +509,7 @@ static int config_list_bd(int key, GVariant **data, const struct sr_dev_inst *sd hwcaps_bd, ARRAY_SIZE(hwcaps_bd), sizeof(int32_t)); break; default: - return config_list_common(key, data, sdi, probe_group); + return config_list_common(key, data, sdi, channel_group); } return SR_OK; diff --git a/hardware/gmc-mh-1x-2x/protocol.c b/hardware/gmc-mh-1x-2x/protocol.c index d20c910b..551a92b0 100644 --- a/hardware/gmc-mh-1x-2x/protocol.c +++ b/hardware/gmc-mh-1x-2x/protocol.c @@ -1492,13 +1492,13 @@ SR_PRIV const char *gmc_model_str(enum model mcode) /** @copydoc sr_dev_driver.config_set */ SR_PRIV int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi, - const struct sr_probe_group *probe_group) + const struct sr_channel_group *channel_group) { struct dev_context *devc; uint8_t params[9]; uint8_t msg[42]; - (void)probe_group; + (void)channel_group; if (sdi->status != SR_ST_ACTIVE) return SR_ERR_DEV_CLOSED; diff --git a/hardware/gmc-mh-1x-2x/protocol.h b/hardware/gmc-mh-1x-2x/protocol.h index 49fd7353..335b9372 100644 --- a/hardware/gmc-mh-1x-2x/protocol.h +++ b/hardware/gmc-mh-1x-2x/protocol.h @@ -120,7 +120,7 @@ struct dev_context { /* Forward declarations */ SR_PRIV int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi, - const struct sr_probe_group *probe_group); + const struct sr_channel_group *channel_group); SR_PRIV void create_cmd_14(guchar addr, guchar func, guchar* params, guchar* buf); SR_PRIV void dump_msg14(guchar* buf, gboolean raw); SR_PRIV int gmc_decode_model_bd(uint8_t mcode); diff --git a/hardware/hameg-hmo/api.c b/hardware/hameg-hmo/api.c index fb2548af..243b8d6d 100644 --- a/hardware/hameg-hmo/api.c +++ b/hardware/hameg-hmo/api.c @@ -183,32 +183,32 @@ static int cleanup(void) return SR_OK; } -static int check_probe_group(struct dev_context *devc, - const struct sr_probe_group *probe_group) +static int check_channel_group(struct dev_context *devc, + const struct sr_channel_group *channel_group) { unsigned int i; struct scope_config *model; model = devc->model_config; - if (!probe_group) + if (!channel_group) return PG_NONE; for (i = 0; i < model->analog_channels; ++i) - if (probe_group == &devc->analog_groups[i]) + if (channel_group == &devc->analog_groups[i]) return PG_ANALOG; for (i = 0; i < model->digital_pods; ++i) - if (probe_group == &devc->digital_groups[i]) + if (channel_group == &devc->digital_groups[i]) return PG_DIGITAL; - sr_err("Invalid probe group specified."); + sr_err("Invalid channel group specified."); return PG_INVALID; } static int config_get(int key, GVariant **data, const struct sr_dev_inst *sdi, - const struct sr_probe_group *probe_group) + const struct sr_channel_group *channel_group) { int ret, pg_type; unsigned int i; @@ -219,7 +219,7 @@ static int config_get(int key, GVariant **data, const struct sr_dev_inst *sdi, if (!sdi || !(devc = sdi->priv)) return SR_ERR_ARG; - if ((pg_type = check_probe_group(devc, probe_group)) == PG_INVALID) + if ((pg_type = check_channel_group(devc, channel_group)) == PG_INVALID) return SR_ERR; ret = SR_ERR_NA; @@ -238,11 +238,11 @@ static int config_get(int key, GVariant **data, const struct sr_dev_inst *sdi, break; case SR_CONF_NUM_VDIV: if (pg_type == PG_NONE) { - sr_err("No probe group specified."); - return SR_ERR_PROBE_GROUP; + sr_err("No channel group specified."); + return SR_ERR_CHANNEL_GROUP; } else if (pg_type == PG_ANALOG) { for (i = 0; i < model->analog_channels; ++i) { - if (probe_group != &devc->analog_groups[i]) + if (channel_group != &devc->analog_groups[i]) continue; *data = g_variant_new_int32(model->num_ydivs); ret = SR_OK; @@ -286,11 +286,11 @@ static int config_get(int key, GVariant **data, const struct sr_dev_inst *sdi, break; case SR_CONF_COUPLING: if (pg_type == PG_NONE) { - sr_err("No probe group specified."); - return SR_ERR_PROBE_GROUP; + sr_err("No channel group specified."); + return SR_ERR_CHANNEL_GROUP; } else if (pg_type == PG_ANALOG) { for (i = 0; i < model->analog_channels; ++i) { - if (probe_group != &devc->analog_groups[i]) + if (channel_group != &devc->analog_groups[i]) continue; *data = g_variant_new_string((*model->coupling_options)[state->analog_channels[i].coupling]); ret = SR_OK; @@ -332,7 +332,7 @@ static GVariant *build_tuples(const uint64_t (*array)[][2], unsigned int n) } static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi, - const struct sr_probe_group *probe_group) + const struct sr_channel_group *channel_group) { int ret, pg_type; unsigned int i, j; @@ -348,7 +348,7 @@ static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi, if (!sdi || !(devc = sdi->priv)) return SR_ERR_ARG; - if ((pg_type = check_probe_group(devc, probe_group)) == PG_INVALID) + if ((pg_type = check_channel_group(devc, channel_group)) == PG_INVALID) return SR_ERR; model = devc->model_config; @@ -378,8 +378,8 @@ static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi, break; case SR_CONF_VDIV: if (pg_type == PG_NONE) { - sr_err("No probe group specified."); - return SR_ERR_PROBE_GROUP; + sr_err("No channel group specified."); + return SR_ERR_CHANNEL_GROUP; } g_variant_get(data, "(tt)", &p, &q); @@ -389,7 +389,7 @@ static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi, q != (*model->vdivs)[i][1]) continue; for (j = 1; j <= model->analog_channels; ++j) { - if (probe_group != &devc->analog_groups[j - 1]) + if (channel_group != &devc->analog_groups[j - 1]) continue; state->analog_channels[j - 1].vdiv = i; g_ascii_formatd(float_str, sizeof(float_str), "%E", (float) p / q); @@ -461,8 +461,8 @@ static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi, break; case SR_CONF_COUPLING: if (pg_type == PG_NONE) { - sr_err("No probe group specified."); - return SR_ERR_PROBE_GROUP; + sr_err("No channel group specified."); + return SR_ERR_CHANNEL_GROUP; } tmp = g_variant_get_string(data, NULL); @@ -471,7 +471,7 @@ static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi, if (strcmp(tmp, (*model->coupling_options)[i]) != 0) continue; for (j = 1; j <= model->analog_channels; ++j) { - if (probe_group != &devc->analog_groups[j - 1]) + if (channel_group != &devc->analog_groups[j - 1]) continue; state->analog_channels[j-1].coupling = i; @@ -504,7 +504,7 @@ static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi, } static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi, - const struct sr_probe_group *probe_group) + const struct sr_channel_group *channel_group) { int pg_type; struct dev_context *devc; @@ -513,7 +513,7 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi, if (!sdi || !(devc = sdi->priv)) return SR_ERR_ARG; - if ((pg_type = check_probe_group(devc, probe_group)) == PG_INVALID) + if ((pg_type = check_channel_group(devc, channel_group)) == PG_INVALID) return SR_ERR; model = devc->model_config; @@ -535,7 +535,7 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi, break; case SR_CONF_COUPLING: if (pg_type == PG_NONE) - return SR_ERR_PROBE_GROUP; + return SR_ERR_CHANNEL_GROUP; *data = g_variant_new_strv(*model->coupling_options, g_strv_length((char **)*model->coupling_options)); break; @@ -552,7 +552,7 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi, break; case SR_CONF_VDIV: if (pg_type == PG_NONE) - return SR_ERR_PROBE_GROUP; + return SR_ERR_CHANNEL_GROUP; *data = build_tuples(model->vdivs, model->num_vdivs); break; default: diff --git a/hardware/hameg-hmo/protocol.c b/hardware/hameg-hmo/protocol.c index 60443b86..263e4f9c 100644 --- a/hardware/hameg-hmo/protocol.c +++ b/hardware/hameg-hmo/protocol.c @@ -604,11 +604,11 @@ SR_PRIV int hmo_init_device(struct sr_dev_inst *sdi) return SR_ERR_NA; } - if (!(devc->analog_groups = g_try_malloc0(sizeof(struct sr_probe_group) * + if (!(devc->analog_groups = g_try_malloc0(sizeof(struct sr_channel_group) * scope_models[model_index].analog_channels))) return SR_ERR_MALLOC; - if (!(devc->digital_groups = g_try_malloc0(sizeof(struct sr_probe_group) * + if (!(devc->digital_groups = g_try_malloc0(sizeof(struct sr_channel_group) * scope_models[model_index].digital_pods))) return SR_ERR_MALLOC; @@ -623,15 +623,15 @@ SR_PRIV int hmo_init_device(struct sr_dev_inst *sdi) (char *)(*scope_models[model_index].analog_names)[i]; devc->analog_groups[i].probes = g_slist_append(NULL, probe); - sdi->probe_groups = g_slist_append(sdi->probe_groups, + sdi->channel_groups = g_slist_append(sdi->channel_groups, &devc->analog_groups[i]); } - /* Add digital probe groups. */ + /* Add digital channel groups. */ for (i = 0; i < scope_models[model_index].digital_pods; ++i) { g_snprintf(tmp, 25, "POD%d", i); devc->digital_groups[i].name = g_strdup(tmp); - sdi->probe_groups = g_slist_append(sdi->probe_groups, + sdi->channel_groups = g_slist_append(sdi->channel_groups, &devc->digital_groups[i < 8 ? 0 : 1]); } diff --git a/hardware/hameg-hmo/protocol.h b/hardware/hameg-hmo/protocol.h index e37a4d23..932eaa4a 100644 --- a/hardware/hameg-hmo/protocol.h +++ b/hardware/hameg-hmo/protocol.h @@ -93,8 +93,8 @@ struct dev_context { void *model_config; void *model_state; - struct sr_probe_group *analog_groups; - struct sr_probe_group *digital_groups; + struct sr_channel_group *analog_groups; + struct sr_channel_group *digital_groups; GSList *enabled_probes; GSList *current_probe; diff --git a/hardware/hantek-dso/api.c b/hardware/hantek-dso/api.c index 41c78290..3553b574 100644 --- a/hardware/hantek-dso/api.c +++ b/hardware/hantek-dso/api.c @@ -423,12 +423,12 @@ static int cleanup(void) } static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi, - const struct sr_probe_group *probe_group) + const struct sr_channel_group *channel_group) { struct sr_usb_dev_inst *usb; char str[128]; - (void)probe_group; + (void)channel_group; switch (id) { case SR_CONF_CONN: @@ -456,7 +456,7 @@ static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi, } static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi, - const struct sr_probe_group *probe_group) + const struct sr_channel_group *channel_group) { struct dev_context *devc; double tmp_double; @@ -466,7 +466,7 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi, const char *tmp_str; char **targets; - (void)probe_group; + (void)channel_group; if (sdi->status != SR_ST_ACTIVE) return SR_ERR_DEV_CLOSED; @@ -587,14 +587,14 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi, } static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi, - const struct sr_probe_group *probe_group) + const struct sr_channel_group *channel_group) { struct dev_context *devc; GVariant *tuple, *rational[2]; GVariantBuilder gvb; unsigned int i; - (void)probe_group; + (void)channel_group; switch (key) { case SR_CONF_SCAN_OPTIONS: diff --git a/hardware/ikalogic-scanalogic2/api.c b/hardware/ikalogic-scanalogic2/api.c index b48edf25..052369a7 100644 --- a/hardware/ikalogic-scanalogic2/api.c +++ b/hardware/ikalogic-scanalogic2/api.c @@ -308,12 +308,12 @@ static int cleanup(void) } static int config_get(int key, GVariant **data, const struct sr_dev_inst *sdi, - const struct sr_probe_group *probe_group) + const struct sr_channel_group *channel_group) { struct dev_context *devc; int ret; - (void)probe_group; + (void)channel_group; ret = SR_OK; devc = sdi->priv; @@ -333,12 +333,12 @@ static int config_get(int key, GVariant **data, const struct sr_dev_inst *sdi, } static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi, - const struct sr_probe_group *probe_group) + const struct sr_channel_group *channel_group) { uint64_t samplerate, limit_samples, capture_ratio; int ret; - (void)probe_group; + (void)channel_group; if (sdi->status != SR_ST_ACTIVE) return SR_ERR_DEV_CLOSED; @@ -366,14 +366,14 @@ static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi, } static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi, - const struct sr_probe_group *probe_group) + const struct sr_channel_group *channel_group) { GVariant *gvar, *grange[2]; GVariantBuilder gvb; int ret; (void)sdi; - (void)probe_group; + (void)channel_group; ret = SR_OK; diff --git a/hardware/ikalogic-scanaplus/api.c b/hardware/ikalogic-scanaplus/api.c index ba5b1b11..a0efca8d 100644 --- a/hardware/ikalogic-scanaplus/api.c +++ b/hardware/ikalogic-scanaplus/api.c @@ -280,10 +280,10 @@ static int cleanup(void) } static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi, - const struct sr_probe_group *probe_group) + const struct sr_channel_group *channel_group) { (void)sdi; - (void)probe_group; + (void)channel_group; switch (id) { case SR_CONF_SAMPLERATE: @@ -298,11 +298,11 @@ static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi, } static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi, - const struct sr_probe_group *probe_group) + const struct sr_channel_group *channel_group) { struct dev_context *devc; - (void)probe_group; + (void)channel_group; if (sdi->status != SR_ST_ACTIVE) return SR_ERR_DEV_CLOSED; @@ -335,13 +335,13 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi, } static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi, - const struct sr_probe_group *probe_group) + const struct sr_channel_group *channel_group) { GVariant *gvar; GVariantBuilder gvb; (void)sdi; - (void)probe_group; + (void)channel_group; switch (key) { case SR_CONF_DEVICE_OPTIONS: diff --git a/hardware/kecheng-kc-330b/api.c b/hardware/kecheng-kc-330b/api.c index 75f32345..177884e5 100644 --- a/hardware/kecheng-kc-330b/api.c +++ b/hardware/kecheng-kc-330b/api.c @@ -249,13 +249,13 @@ static int cleanup(void) } static int config_get(int key, GVariant **data, const struct sr_dev_inst *sdi, - const struct sr_probe_group *probe_group) + const struct sr_channel_group *channel_group) { struct dev_context *devc; GVariant *rational[2]; const uint64_t *si; - (void)probe_group; + (void)channel_group; devc = sdi->priv; switch (key) { @@ -298,7 +298,7 @@ static int config_get(int key, GVariant **data, const struct sr_dev_inst *sdi, } static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi, - const struct sr_probe_group *probe_group) + const struct sr_channel_group *channel_group) { struct dev_context *devc; uint64_t p, q; @@ -306,7 +306,7 @@ static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi, int tmp, ret; const char *tmp_str; - (void)probe_group; + (void)channel_group; if (sdi->status != SR_ST_ACTIVE) return SR_ERR_DEV_CLOSED; @@ -378,14 +378,14 @@ static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi, } static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi, - const struct sr_probe_group *probe_group) + const struct sr_channel_group *channel_group) { GVariant *tuple, *rational[2]; GVariantBuilder gvb; unsigned int i; (void)sdi; - (void)probe_group; + (void)channel_group; switch (key) { case SR_CONF_DEVICE_OPTIONS: diff --git a/hardware/lascar-el-usb/api.c b/hardware/lascar-el-usb/api.c index 96695c27..6014a8f6 100644 --- a/hardware/lascar-el-usb/api.c +++ b/hardware/lascar-el-usb/api.c @@ -159,14 +159,14 @@ static int cleanup(void) } static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi, - const struct sr_probe_group *probe_group) + const struct sr_channel_group *channel_group) { struct dev_context *devc; struct sr_usb_dev_inst *usb; int ret; char str[128]; - (void)probe_group; + (void)channel_group; devc = sdi->priv; switch (id) { @@ -195,12 +195,12 @@ static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi, } static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi, - const struct sr_probe_group *probe_group) + const struct sr_channel_group *channel_group) { struct dev_context *devc; int ret; - (void)probe_group; + (void)channel_group; if (sdi->status != SR_ST_ACTIVE) return SR_ERR_DEV_CLOSED; @@ -235,10 +235,10 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi, } static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi, - const struct sr_probe_group *probe_group) + const struct sr_channel_group *channel_group) { (void)sdi; - (void)probe_group; + (void)channel_group; switch (key) { case SR_CONF_SCAN_OPTIONS: diff --git a/hardware/link-mso19/api.c b/hardware/link-mso19/api.c index 654f876e..a657e270 100644 --- a/hardware/link-mso19/api.c +++ b/hardware/link-mso19/api.c @@ -276,11 +276,11 @@ static int cleanup(void) } static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi, - const struct sr_probe_group *probe_group) + const struct sr_channel_group *channel_group) { struct dev_context *devc; - (void)probe_group; + (void)channel_group; switch (id) { case SR_CONF_SAMPLERATE: @@ -298,7 +298,7 @@ static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi, } static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi, - const struct sr_probe_group *probe_group) + const struct sr_channel_group *channel_group) { int ret; struct dev_context *devc; @@ -307,7 +307,7 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi, int trigger_pos; double pos; - (void)probe_group; + (void)channel_group; devc = sdi->priv; if (sdi->status != SR_ST_ACTIVE) @@ -369,12 +369,12 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi, } static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi, - const struct sr_probe_group *probe_group) + const struct sr_channel_group *channel_group) { GVariant *gvar; GVariantBuilder gvb; - (void)probe_group; + (void)channel_group; (void)sdi; switch (key) { diff --git a/hardware/mic-985xx/api.c b/hardware/mic-985xx/api.c index 641ca330..5a75be7a 100644 --- a/hardware/mic-985xx/api.c +++ b/hardware/mic-985xx/api.c @@ -163,11 +163,11 @@ static int cleanup(int idx) } static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi, - const struct sr_probe_group *probe_group) + const struct sr_channel_group *channel_group) { struct dev_context *devc; - (void)probe_group; + (void)channel_group; if (sdi->status != SR_ST_ACTIVE) return SR_ERR_DEV_CLOSED; @@ -193,10 +193,10 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi, } static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi, - const struct sr_probe_group *probe_group) + const struct sr_channel_group *channel_group) { (void)sdi; - (void)probe_group; + (void)channel_group; switch (key) { case SR_CONF_SCAN_OPTIONS: diff --git a/hardware/norma-dmm/api.c b/hardware/norma-dmm/api.c index 9736eb27..92b60cbf 100644 --- a/hardware/norma-dmm/api.c +++ b/hardware/norma-dmm/api.c @@ -185,11 +185,11 @@ static int cleanup(void) } static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi, - const struct sr_probe_group *probe_group) + const struct sr_channel_group *channel_group) { struct dev_context *devc; - (void)probe_group; + (void)channel_group; if (sdi->status != SR_ST_ACTIVE) return SR_ERR_DEV_CLOSED; @@ -223,10 +223,10 @@ static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi, } static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi, - const struct sr_probe_group *probe_group) + const struct sr_channel_group *channel_group) { (void)sdi; - (void)probe_group; + (void)channel_group; switch (key) { case SR_CONF_SCAN_OPTIONS: diff --git a/hardware/openbench-logic-sniffer/api.c b/hardware/openbench-logic-sniffer/api.c index af38e4ff..468b55d6 100644 --- a/hardware/openbench-logic-sniffer/api.c +++ b/hardware/openbench-logic-sniffer/api.c @@ -213,11 +213,11 @@ static int cleanup(void) } static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi, - const struct sr_probe_group *probe_group) + const struct sr_channel_group *channel_group) { struct dev_context *devc; - (void)probe_group; + (void)channel_group; if (!sdi) return SR_ERR_ARG; @@ -252,7 +252,7 @@ static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi, } static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi, - const struct sr_probe_group *probe_group) + const struct sr_channel_group *channel_group) { struct dev_context *devc; uint16_t flag; @@ -260,7 +260,7 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi, int ret; const char *stropt; - (void)probe_group; + (void)channel_group; if (sdi->status != SR_ST_ACTIVE) return SR_ERR_DEV_CLOSED; @@ -349,14 +349,14 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi, } static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi, - const struct sr_probe_group *probe_group) + const struct sr_channel_group *channel_group) { struct dev_context *devc; GVariant *gvar, *grange[2]; GVariantBuilder gvb; int num_channels, i; - (void)probe_group; + (void)channel_group; switch (key) { case SR_CONF_SCAN_OPTIONS: diff --git a/hardware/rigol-ds/api.c b/hardware/rigol-ds/api.c index 1c0d9c46..1ce9c6cd 100644 --- a/hardware/rigol-ds/api.c +++ b/hardware/rigol-ds/api.c @@ -339,7 +339,7 @@ static struct sr_dev_inst *probe_device(struct sr_scpi_dev_inst *scpi) sdi->probes = g_slist_append(sdi->probes, probe); devc->analog_groups[i].name = channel_name; devc->analog_groups[i].probes = g_slist_append(NULL, probe); - sdi->probe_groups = g_slist_append(sdi->probe_groups, + sdi->channel_groups = g_slist_append(sdi->channel_groups, &devc->analog_groups[i]); } @@ -356,7 +356,7 @@ static struct sr_dev_inst *probe_device(struct sr_scpi_dev_inst *scpi) devc->digital_group.probes, probe); } devc->digital_group.name = "LA"; - sdi->probe_groups = g_slist_append(sdi->probe_groups, + sdi->channel_groups = g_slist_append(sdi->channel_groups, &devc->digital_group); } @@ -477,7 +477,7 @@ static int digital_frame_size(const struct sr_dev_inst *sdi) } static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi, - const struct sr_probe_group *probe_group) + const struct sr_channel_group *channel_group) { struct dev_context *devc; struct sr_probe *probe; @@ -491,14 +491,14 @@ static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi, if (!sdi || !(devc = sdi->priv)) return SR_ERR_ARG; - /* If a probe group is specified, it must be a valid one. */ - if (probe_group && !g_slist_find(sdi->probe_groups, probe_group)) { - sr_err("Invalid probe group specified."); + /* If a channel group is specified, it must be a valid one. */ + if (channel_group && !g_slist_find(sdi->channel_groups, channel_group)) { + sr_err("Invalid channel group specified."); return SR_ERR; } - if (probe_group) { - probe = g_slist_nth_data(probe_group->probes, 0); + if (channel_group) { + probe = g_slist_nth_data(channel_group->probes, 0); if (!probe) return SR_ERR; if (probe->type == SR_PROBE_ANALOG) { @@ -588,7 +588,7 @@ static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi, } static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi, - const struct sr_probe_group *probe_group) + const struct sr_channel_group *channel_group) { struct dev_context *devc; uint64_t p, q; @@ -604,9 +604,9 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi, if (sdi->status != SR_ST_ACTIVE) return SR_ERR_DEV_CLOSED; - /* If a probe group is specified, it must be a valid one. */ - if (probe_group && !g_slist_find(sdi->probe_groups, probe_group)) { - sr_err("Invalid probe group specified."); + /* If a channel group is specified, it must be a valid one. */ + if (channel_group && !g_slist_find(sdi->channel_groups, channel_group)) { + sr_err("Invalid channel group specified."); return SR_ERR; } @@ -676,13 +676,13 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi, ret = SR_ERR_ARG; break; case SR_CONF_VDIV: - if (!probe_group) { - sr_err("No probe group specified."); - return SR_ERR_PROBE_GROUP; + if (!channel_group) { + sr_err("No channel group specified."); + return SR_ERR_CHANNEL_GROUP; } g_variant_get(data, "(tt)", &p, &q); for (i = 0; i < 2; i++) { - if (probe_group == &devc->analog_groups[i]) { + if (channel_group == &devc->analog_groups[i]) { for (j = 0; j < ARRAY_SIZE(vdivs); j++) { if (vdivs[j][0] != p || vdivs[j][1] != q) continue; @@ -697,13 +697,13 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi, } return SR_ERR_NA; case SR_CONF_COUPLING: - if (!probe_group) { - sr_err("No probe group specified."); - return SR_ERR_PROBE_GROUP; + if (!channel_group) { + sr_err("No channel group specified."); + return SR_ERR_CHANNEL_GROUP; } tmp_str = g_variant_get_string(data, NULL); for (i = 0; i < 2; i++) { - if (probe_group == &devc->analog_groups[i]) { + if (channel_group == &devc->analog_groups[i]) { for (j = 0; j < ARRAY_SIZE(coupling); j++) { if (!strcmp(tmp_str, coupling[j])) { g_free(devc->coupling[i]); @@ -738,7 +738,7 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi, } static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi, - const struct sr_probe_group *probe_group) + const struct sr_channel_group *channel_group) { GVariant *tuple, *rational[2]; GVariantBuilder gvb; @@ -752,7 +752,7 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi, *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32, hwopts, ARRAY_SIZE(hwopts), sizeof(int32_t)); return SR_OK; - } else if (key == SR_CONF_DEVICE_OPTIONS && probe_group == NULL) { + } else if (key == SR_CONF_DEVICE_OPTIONS && channel_group == NULL) { *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32, hwcaps, ARRAY_SIZE(hwcaps), sizeof(int32_t)); return SR_OK; @@ -762,28 +762,28 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi, if (!sdi || !(devc = sdi->priv)) return SR_ERR_ARG; - /* If a probe group is specified, it must be a valid one. */ - if (probe_group) { - if (probe_group != &devc->analog_groups[0] - && probe_group != &devc->analog_groups[1]) { - sr_err("Invalid probe group specified."); + /* If a channel group is specified, it must be a valid one. */ + if (channel_group) { + if (channel_group != &devc->analog_groups[0] + && channel_group != &devc->analog_groups[1]) { + sr_err("Invalid channel group specified."); return SR_ERR; } } switch (key) { case SR_CONF_DEVICE_OPTIONS: - if (!probe_group) { - sr_err("No probe group specified."); - return SR_ERR_PROBE_GROUP; + if (!channel_group) { + sr_err("No channel group specified."); + return SR_ERR_CHANNEL_GROUP; } - if (probe_group == &devc->digital_group) { + if (channel_group == &devc->digital_group) { *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32, NULL, 0, sizeof(int32_t)); return SR_OK; } else { for (i = 0; i < 2; i++) { - if (probe_group == &devc->analog_groups[i]) { + if (channel_group == &devc->analog_groups[i]) { *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32, analog_hwcaps, ARRAY_SIZE(analog_hwcaps), sizeof(int32_t)); return SR_OK; @@ -793,9 +793,9 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi, } break; case SR_CONF_COUPLING: - if (!probe_group) { - sr_err("No probe group specified."); - return SR_ERR_PROBE_GROUP; + if (!channel_group) { + sr_err("No channel group specified."); + return SR_ERR_CHANNEL_GROUP; } *data = g_variant_new_strv(coupling, ARRAY_SIZE(coupling)); break; @@ -803,9 +803,9 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi, if (!devc) /* Can't know this until we have the exact model. */ return SR_ERR_ARG; - if (!probe_group) { - sr_err("No probe group specified."); - return SR_ERR_PROBE_GROUP; + if (!channel_group) { + sr_err("No channel group specified."); + return SR_ERR_CHANNEL_GROUP; } g_variant_builder_init(&gvb, G_VARIANT_TYPE_ARRAY); for (i = 0; i < NUM_VDIV; i++) { diff --git a/hardware/rigol-ds/protocol.h b/hardware/rigol-ds/protocol.h index 2fe8d865..a53903e0 100644 --- a/hardware/rigol-ds/protocol.h +++ b/hardware/rigol-ds/protocol.h @@ -97,9 +97,9 @@ struct dev_context { const uint64_t (*vdivs)[2]; uint64_t num_vdivs; - /* Probe groups */ - struct sr_probe_group analog_groups[MAX_ANALOG_PROBES]; - struct sr_probe_group digital_group; + /* Channel groups */ + struct sr_channel_group analog_groups[MAX_ANALOG_PROBES]; + struct sr_channel_group digital_group; /* Acquisition settings */ GSList *enabled_analog_probes; diff --git a/hardware/saleae-logic16/api.c b/hardware/saleae-logic16/api.c index 96de1bdf..d0a63dc9 100644 --- a/hardware/saleae-logic16/api.c +++ b/hardware/saleae-logic16/api.c @@ -428,7 +428,7 @@ static int cleanup(void) } static int config_get(int key, GVariant **data, const struct sr_dev_inst *sdi, - const struct sr_probe_group *probe_group) + const struct sr_channel_group *channel_group) { struct dev_context *devc; struct sr_usb_dev_inst *usb; @@ -437,7 +437,7 @@ static int config_get(int key, GVariant **data, const struct sr_dev_inst *sdi, int ret; unsigned int i; - (void)probe_group; + (void)channel_group; ret = SR_OK; switch (key) { @@ -482,14 +482,14 @@ static int config_get(int key, GVariant **data, const struct sr_dev_inst *sdi, } static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi, - const struct sr_probe_group *probe_group) + const struct sr_channel_group *channel_group) { struct dev_context *devc; gdouble low, high; int ret; unsigned int i; - (void)probe_group; + (void)channel_group; if (sdi->status != SR_ST_ACTIVE) return SR_ERR_DEV_CLOSED; @@ -525,7 +525,7 @@ static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi, } static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi, - const struct sr_probe_group *probe_group) + const struct sr_channel_group *channel_group) { GVariant *gvar, *range[2]; GVariantBuilder gvb; @@ -533,7 +533,7 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi, unsigned int i; (void)sdi; - (void)probe_group; + (void)channel_group; ret = SR_OK; switch (key) { diff --git a/hardware/serial-dmm/api.c b/hardware/serial-dmm/api.c index 93487920..cddc11b8 100644 --- a/hardware/serial-dmm/api.c +++ b/hardware/serial-dmm/api.c @@ -460,11 +460,11 @@ static int cleanup(int dmm) } static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi, - const struct sr_probe_group *probe_group) + const struct sr_channel_group *channel_group) { struct dev_context *devc; - (void)probe_group; + (void)channel_group; if (sdi->status != SR_ST_ACTIVE) return SR_ERR_DEV_CLOSED; @@ -493,10 +493,10 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi, } static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi, - const struct sr_probe_group *probe_group) + const struct sr_channel_group *channel_group) { (void)sdi; - (void)probe_group; + (void)channel_group; switch (key) { case SR_CONF_SCAN_OPTIONS: diff --git a/hardware/sysclk-lwla/api.c b/hardware/sysclk-lwla/api.c index 8e0a9634..1ff49bf4 100644 --- a/hardware/sysclk-lwla/api.c +++ b/hardware/sysclk-lwla/api.c @@ -265,12 +265,12 @@ static int cleanup(void) } static int config_get(int key, GVariant **data, const struct sr_dev_inst *sdi, - const struct sr_probe_group *probe_group) + const struct sr_channel_group *channel_group) { struct dev_context *devc; size_t idx; - (void)probe_group; + (void)channel_group; if (!sdi) return SR_ERR_ARG; @@ -337,13 +337,13 @@ static int lookup_index(GVariant *value, const char *const *table, int len) } static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi, - const struct sr_probe_group *probe_group) + const struct sr_channel_group *channel_group) { uint64_t value; struct dev_context *devc; int idx; - (void)probe_group; + (void)channel_group; devc = sdi->priv; if (!devc) @@ -477,13 +477,13 @@ static int config_commit(const struct sr_dev_inst *sdi) } static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi, - const struct sr_probe_group *probe_group) + const struct sr_channel_group *channel_group) { GVariant *gvar; GVariantBuilder gvb; (void)sdi; - (void)probe_group; + (void)channel_group; switch (key) { case SR_CONF_SCAN_OPTIONS: diff --git a/hardware/teleinfo/api.c b/hardware/teleinfo/api.c index c29b561e..024f611a 100644 --- a/hardware/teleinfo/api.c +++ b/hardware/teleinfo/api.c @@ -178,11 +178,11 @@ static int cleanup(void) } static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi, - const struct sr_probe_group *probe_group) + const struct sr_channel_group *channel_group) { struct dev_context *devc; - (void)probe_group; + (void)channel_group; if (sdi->status != SR_ST_ACTIVE) return SR_ERR_DEV_CLOSED; @@ -209,10 +209,10 @@ static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi, } static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi, - const struct sr_probe_group *probe_group) + const struct sr_channel_group *channel_group) { (void)sdi; - (void)probe_group; + (void)channel_group; switch (key) { case SR_CONF_SCAN_OPTIONS: diff --git a/hardware/tondaj-sl-814/api.c b/hardware/tondaj-sl-814/api.c index 2d89e89b..0eb14b06 100644 --- a/hardware/tondaj-sl-814/api.c +++ b/hardware/tondaj-sl-814/api.c @@ -129,11 +129,11 @@ static int cleanup(void) } static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi, - const struct sr_probe_group *probe_group) + const struct sr_channel_group *channel_group) { struct dev_context *devc; - (void)probe_group; + (void)channel_group; if (sdi->status != SR_ST_ACTIVE) return SR_ERR_DEV_CLOSED; @@ -154,10 +154,10 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi, } static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi, - const struct sr_probe_group *probe_group) + const struct sr_channel_group *channel_group) { (void)sdi; - (void)probe_group; + (void)channel_group; switch (key) { case SR_CONF_SCAN_OPTIONS: diff --git a/hardware/uni-t-dmm/api.c b/hardware/uni-t-dmm/api.c index 1eccfdc5..a91af6cc 100644 --- a/hardware/uni-t-dmm/api.c +++ b/hardware/uni-t-dmm/api.c @@ -272,11 +272,11 @@ static int cleanup(int dmm) } static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi, - const struct sr_probe_group *probe_group) + const struct sr_channel_group *channel_group) { struct dev_context *devc; - (void)probe_group; + (void)channel_group; devc = sdi->priv; @@ -307,10 +307,10 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi, } static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi, - const struct sr_probe_group *probe_group) + const struct sr_channel_group *channel_group) { (void)sdi; - (void)probe_group; + (void)channel_group; switch (key) { case SR_CONF_SCAN_OPTIONS: diff --git a/hardware/uni-t-ut32x/api.c b/hardware/uni-t-ut32x/api.c index 4fd89f44..caea61f7 100644 --- a/hardware/uni-t-ut32x/api.c +++ b/hardware/uni-t-ut32x/api.c @@ -200,11 +200,11 @@ static int cleanup(void) } static int config_get(int key, GVariant **data, const struct sr_dev_inst *sdi, - const struct sr_probe_group *probe_group) + const struct sr_channel_group *channel_group) { struct dev_context *devc; - (void)probe_group; + (void)channel_group; devc = sdi->priv; switch (key) { @@ -225,13 +225,13 @@ static int config_get(int key, GVariant **data, const struct sr_dev_inst *sdi, } static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi, - const struct sr_probe_group *probe_group) + const struct sr_channel_group *channel_group) { struct dev_context *devc; int ret; const char *tmp_str; - (void)probe_group; + (void)channel_group; if (sdi->status != SR_ST_ACTIVE) return SR_ERR_DEV_CLOSED; @@ -266,11 +266,11 @@ static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi, } static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi, - const struct sr_probe_group *probe_group) + const struct sr_channel_group *channel_group) { (void)sdi; - (void)probe_group; + (void)channel_group; switch (key) { case SR_CONF_DEVICE_OPTIONS: diff --git a/hardware/victor-dmm/api.c b/hardware/victor-dmm/api.c index e32bb699..4c7cdc20 100644 --- a/hardware/victor-dmm/api.c +++ b/hardware/victor-dmm/api.c @@ -202,12 +202,12 @@ static int cleanup(void) } static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi, - const struct sr_probe_group *probe_group) + const struct sr_channel_group *channel_group) { struct sr_usb_dev_inst *usb; char str[128]; - (void)probe_group; + (void)channel_group; switch (id) { case SR_CONF_CONN: @@ -225,13 +225,13 @@ static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi, } static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi, - const struct sr_probe_group *probe_group) + const struct sr_channel_group *channel_group) { struct dev_context *devc; gint64 now; int ret; - (void)probe_group; + (void)channel_group; if (sdi->status != SR_ST_ACTIVE) return SR_ERR_DEV_CLOSED; @@ -264,10 +264,10 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi, } static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi, - const struct sr_probe_group *probe_group) + const struct sr_channel_group *channel_group) { (void)sdi; - (void)probe_group; + (void)channel_group; switch (key) { case SR_CONF_SCAN_OPTIONS: diff --git a/hardware/zeroplus-logic-cube/api.c b/hardware/zeroplus-logic-cube/api.c index f2e6724d..177c1841 100644 --- a/hardware/zeroplus-logic-cube/api.c +++ b/hardware/zeroplus-logic-cube/api.c @@ -467,11 +467,11 @@ static int cleanup(void) } static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi, - const struct sr_probe_group *probe_group) + const struct sr_channel_group *channel_group) { struct dev_context *devc; - (void)probe_group; + (void)channel_group; switch (id) { case SR_CONF_SAMPLERATE: @@ -508,12 +508,12 @@ static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi, } static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi, - const struct sr_probe_group *probe_group) + const struct sr_channel_group *channel_group) { struct dev_context *devc; gdouble low, high; - (void)probe_group; + (void)channel_group; if (sdi->status != SR_ST_ACTIVE) return SR_ERR_DEV_CLOSED; @@ -541,7 +541,7 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi, } static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi, - const struct sr_probe_group *probe_group) + const struct sr_channel_group *channel_group) { struct dev_context *devc; GVariant *gvar, *grange[2]; @@ -549,7 +549,7 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi, double v; GVariant *range[2]; - (void)probe_group; + (void)channel_group; switch (key) { case SR_CONF_DEVICE_OPTIONS: diff --git a/hwdriver.c b/hwdriver.c index 5deef6bb..f508a469 100644 --- a/hwdriver.c +++ b/hwdriver.c @@ -587,7 +587,7 @@ SR_PRIV void sr_config_free(struct sr_config *src) * @param[in] sdi (optional) If the key is specific to a device, this must * contain a pointer to the struct sr_dev_inst to be checked. * Otherwise it must be NULL. - * @param[in] probe_group The probe group on the device for which to list the + * @param[in] channel_group The channel group on the device for which to list the * values, or NULL. * @param[in] key The configuration key (SR_CONF_*). * @param[in,out] data Pointer to a GVariant where the value will be stored. @@ -604,7 +604,7 @@ SR_PRIV void sr_config_free(struct sr_config *src) */ SR_API int sr_config_get(const struct sr_dev_driver *driver, const struct sr_dev_inst *sdi, - const struct sr_probe_group *probe_group, + const struct sr_channel_group *channel_group, int key, GVariant **data) { int ret; @@ -615,7 +615,7 @@ SR_API int sr_config_get(const struct sr_dev_driver *driver, if (!driver->config_get) return SR_ERR_ARG; - if ((ret = driver->config_get(key, data, sdi, probe_group)) == SR_OK) { + if ((ret = driver->config_get(key, data, sdi, channel_group)) == SR_OK) { /* Got a floating reference from the driver. Sink it here, * caller will need to unref when done with it. */ g_variant_ref_sink(*data); @@ -628,7 +628,7 @@ SR_API int sr_config_get(const struct sr_dev_driver *driver, * Set value of a configuration key in a device instance. * * @param[in] sdi The device instance. - * @param[in] probe_group The probe group on the device for which to list the + * @param[in] channel_group The channel group on the device for which to list the * values, or NULL. * @param[in] key The configuration key (SR_CONF_*). * @param data The new value for the key, as a GVariant with GVariantType @@ -642,7 +642,7 @@ SR_API int sr_config_get(const struct sr_dev_driver *driver, * that it's not applicable. */ SR_API int sr_config_set(const struct sr_dev_inst *sdi, - const struct sr_probe_group *probe_group, + const struct sr_channel_group *channel_group, int key, GVariant *data) { int ret; @@ -654,7 +654,7 @@ SR_API int sr_config_set(const struct sr_dev_inst *sdi, else if (!sdi->driver->config_set) ret = SR_ERR_ARG; else - ret = sdi->driver->config_set(key, data, sdi, probe_group); + ret = sdi->driver->config_set(key, data, sdi, channel_group); g_variant_unref(data); @@ -688,7 +688,7 @@ SR_API int sr_config_commit(const struct sr_dev_inst *sdi) * @param[in] driver The sr_dev_driver struct to query. * @param[in] sdi (optional) If the key is specific to a device, this must * contain a pointer to the struct sr_dev_inst to be checked. - * @param[in] probe_group The probe group on the device for which to list the + * @param[in] channel_group The channel group on the device for which to list the * values, or NULL. * @param[in] key The configuration key (SR_CONF_*). * @param[in,out] data A pointer to a GVariant where the list will be stored. @@ -705,7 +705,7 @@ SR_API int sr_config_commit(const struct sr_dev_inst *sdi) */ SR_API int sr_config_list(const struct sr_dev_driver *driver, const struct sr_dev_inst *sdi, - const struct sr_probe_group *probe_group, + const struct sr_channel_group *channel_group, int key, GVariant **data) { int ret; @@ -714,7 +714,7 @@ SR_API int sr_config_list(const struct sr_dev_driver *driver, ret = SR_ERR; else if (!driver->config_list) ret = SR_ERR_ARG; - else if ((ret = driver->config_list(key, data, sdi, probe_group)) == SR_OK) + else if ((ret = driver->config_list(key, data, sdi, channel_group)) == SR_OK) g_variant_ref_sink(*data); return ret; diff --git a/libsigrok.h b/libsigrok.h index 21468c87..d389b97f 100644 --- a/libsigrok.h +++ b/libsigrok.h @@ -73,7 +73,7 @@ enum { SR_ERR_NA = -6, /**< Not applicable. */ SR_ERR_DEV_CLOSED = -7, /**< Device is closed, but needs to be open. */ SR_ERR_TIMEOUT = -8, /**< A timeout occurred. */ - SR_ERR_PROBE_GROUP= -9, /**< A probe group must be specified. */ + SR_ERR_PROBE_GROUP= -9, /**< A channel group must be specified. */ /* * Note: When adding entries here, don't forget to also update the @@ -620,8 +620,8 @@ struct sr_probe { }; /** Structure for groups of probes that have common properties. */ -struct sr_probe_group { - /** Name of the probe group. */ +struct sr_channel_group { + /** Name of the channel group. */ char *name; /** List of sr_probe structs of the probes belonging to this group. */ GSList *probes; @@ -921,8 +921,8 @@ struct sr_dev_inst { char *version; /** List of probes. */ GSList *probes; - /** List of sr_probe_group structs */ - GSList *probe_groups; + /** List of sr_channel_group structs */ + GSList *channel_groups; /** Device instance connection data (used?) */ void *conn; /** Device instance private data (used?) */ @@ -986,12 +986,12 @@ struct sr_dev_driver { */ int (*config_get) (int id, GVariant **data, const struct sr_dev_inst *sdi, - const struct sr_probe_group *probe_group); + const struct sr_channel_group *channel_group); /** Set value of a configuration key in driver or a given device instance. * @see sr_config_set(). */ int (*config_set) (int id, GVariant *data, const struct sr_dev_inst *sdi, - const struct sr_probe_group *probe_group); + const struct sr_channel_group *channel_group); /** Probe status change. * @see sr_dev_probe_enable(), sr_dev_trigger_set(). */ int (*config_probe_set) (const struct sr_dev_inst *sdi, @@ -1004,7 +1004,7 @@ struct sr_dev_driver { */ int (*config_list) (int info_id, GVariant **data, const struct sr_dev_inst *sdi, - const struct sr_probe_group *probe_group); + const struct sr_channel_group *channel_group); /* Device-specific */ /** Open device */ diff --git a/proto.h b/proto.h index 2b36264e..75ece6c8 100644 --- a/proto.h +++ b/proto.h @@ -72,15 +72,15 @@ SR_API int sr_driver_init(struct sr_context *ctx, SR_API GSList *sr_driver_scan(struct sr_dev_driver *driver, GSList *options); SR_API int sr_config_get(const struct sr_dev_driver *driver, const struct sr_dev_inst *sdi, - const struct sr_probe_group *probe_group, + const struct sr_channel_group *channel_group, int key, GVariant **data); SR_API int sr_config_set(const struct sr_dev_inst *sdi, - const struct sr_probe_group *probe_group, + const struct sr_channel_group *channel_group, int key, GVariant *data); SR_API int sr_config_commit(const struct sr_dev_inst *sdi); SR_API int sr_config_list(const struct sr_dev_driver *driver, const struct sr_dev_inst *sdi, - const struct sr_probe_group *probe_group, + const struct sr_channel_group *channel_group, int key, GVariant **data); SR_API const struct sr_config_info *sr_config_info_get(int key); SR_API const struct sr_config_info *sr_config_info_name_get(const char *optname); diff --git a/session_driver.c b/session_driver.c index f333db1d..f64d203d 100644 --- a/session_driver.c +++ b/session_driver.c @@ -211,11 +211,11 @@ static int dev_close(struct sr_dev_inst *sdi) } static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi, - const struct sr_probe_group *probe_group) + const struct sr_channel_group *channel_group) { struct session_vdev *vdev; - (void)probe_group; + (void)channel_group; switch (id) { case SR_CONF_SAMPLERATE: @@ -233,11 +233,11 @@ static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi, } static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi, - const struct sr_probe_group *probe_group) + const struct sr_channel_group *channel_group) { struct session_vdev *vdev; - (void)probe_group; + (void)channel_group; vdev = sdi->priv; @@ -270,10 +270,10 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi, } static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi, - const struct sr_probe_group *probe_group) + const struct sr_channel_group *channel_group) { (void)sdi; - (void)probe_group; + (void)channel_group; switch (key) { case SR_CONF_DEVICE_OPTIONS: