]> sigrok.org Git - libsigrok.git/commitdiff
Replace 'probe' with 'channel' in most places.
authorUwe Hermann <redacted>
Mon, 24 Mar 2014 20:34:20 +0000 (21:34 +0100)
committerUwe Hermann <redacted>
Tue, 25 Mar 2014 19:58:54 +0000 (20:58 +0100)
Also, consistently use 'ch' for channel variables. This matches how we
consistently use sdi, devc, and so on all over the code-base.

This fixes parts of bug #259.

96 files changed:
device.c
hardware/agilent-dmm/api.c
hardware/agilent-dmm/sched.c
hardware/alsa/api.c
hardware/alsa/protocol.c
hardware/alsa/protocol.h
hardware/appa-55ii/api.c
hardware/appa-55ii/protocol.c
hardware/asix-sigma/asix-sigma.c
hardware/asix-sigma/asix-sigma.h
hardware/atten-pps3xxx/api.c
hardware/atten-pps3xxx/protocol.c
hardware/brymen-bm86x/api.c
hardware/brymen-bm86x/protocol.c
hardware/brymen-dmm/api.c
hardware/brymen-dmm/protocol.c
hardware/cem-dt-885x/api.c
hardware/cem-dt-885x/protocol.c
hardware/center-3xx/api.c
hardware/center-3xx/protocol.c
hardware/chronovu-la8/api.c
hardware/chronovu-la8/protocol.c
hardware/chronovu-la8/protocol.h
hardware/colead-slm/api.c
hardware/colead-slm/protocol.c
hardware/conrad-digi-35-cpu/api.c
hardware/demo/demo.c
hardware/fluke-dmm/api.c
hardware/fluke-dmm/fluke.c
hardware/fx2lafw/api.c
hardware/fx2lafw/protocol.c
hardware/fx2lafw/protocol.h
hardware/gmc-mh-1x-2x/api.c
hardware/gmc-mh-1x-2x/protocol.c
hardware/hameg-hmo/api.c
hardware/hameg-hmo/protocol.c
hardware/hameg-hmo/protocol.h
hardware/hantek-dso/api.c
hardware/hantek-dso/dso.h
hardware/ikalogic-scanalogic2/api.c
hardware/ikalogic-scanalogic2/protocol.c
hardware/ikalogic-scanalogic2/protocol.h
hardware/ikalogic-scanaplus/api.c
hardware/ikalogic-scanaplus/protocol.c
hardware/kecheng-kc-330b/api.c
hardware/kecheng-kc-330b/protocol.c
hardware/lascar-el-usb/protocol.c
hardware/link-mso19/api.c
hardware/link-mso19/protocol.c
hardware/link-mso19/protocol.h
hardware/mic-985xx/api.c
hardware/mic-985xx/protocol.c
hardware/norma-dmm/api.c
hardware/norma-dmm/protocol.c
hardware/openbench-logic-sniffer/api.c
hardware/openbench-logic-sniffer/protocol.c
hardware/openbench-logic-sniffer/protocol.h
hardware/rigol-ds/api.c
hardware/rigol-ds/protocol.c
hardware/rigol-ds/protocol.h
hardware/saleae-logic16/api.c
hardware/serial-dmm/api.c
hardware/serial-dmm/protocol.c
hardware/sysclk-lwla/api.c
hardware/teleinfo/api.c
hardware/teleinfo/protocol.c
hardware/tondaj-sl-814/api.c
hardware/tondaj-sl-814/protocol.c
hardware/uni-t-dmm/api.c
hardware/uni-t-dmm/protocol.c
hardware/uni-t-ut32x/api.c
hardware/uni-t-ut32x/protocol.c
hardware/victor-dmm/api.c
hardware/victor-dmm/protocol.c
hardware/zeroplus-logic-cube/api.c
hardware/zeroplus-logic-cube/protocol.h
input/binary.c
input/chronovu_la8.c
input/csv.c
input/vcd.c
input/wav.c
libsigrok.h
output/analog.c
output/chronovu_la8.c
output/csv.c
output/gnuplot.c
output/ols.c
output/text/ascii.c
output/text/bits.c
output/text/hex.c
output/text/text.c
output/text/text.h
output/vcd.c
session_file.c
strutil.c
tests/lib.c

index 4c8e9d1a742512ef91afd2be20371d8d1d04b1ef..b539eceea65f1013ba32d0f02e59eaf2170ec2a9 100644 (file)
--- a/device.c
+++ b/device.c
 SR_PRIV struct sr_channel *sr_probe_new(int index, int type,
                gboolean enabled, const char *name)
 {
 SR_PRIV struct sr_channel *sr_probe_new(int index, int type,
                gboolean enabled, const char *name)
 {
-       struct sr_channel *probe;
+       struct sr_channel *ch;
 
 
-       if (!(probe = g_try_malloc0(sizeof(struct sr_channel)))) {
-               sr_err("Probe malloc failed.");
+       if (!(ch = g_try_malloc0(sizeof(struct sr_channel)))) {
+               sr_err("Channel malloc failed.");
                return NULL;
        }
 
                return NULL;
        }
 
-       probe->index = index;
-       probe->type = type;
-       probe->enabled = enabled;
+       ch->index = index;
+       ch->type = type;
+       ch->enabled = enabled;
        if (name)
        if (name)
-               probe->name = g_strdup(name);
+               ch->name = g_strdup(name);
 
 
-       return probe;
+       return ch;
 }
 
 /**
 }
 
 /**
- * Set the name of the specified probe in the specified device.
+ * Set the name of the specified channel in the specified device.
  *
  *
- * If the probe already has a different name assigned to it, it will be
+ * If the channel already has a different name assigned to it, it will be
  * removed, and the new name will be saved instead.
  *
  * removed, and the new name will be saved instead.
  *
- * @param sdi The device instance the probe is connected to.
- * @param[in] probenum The number of the probe whose name to set.
- *                 Note that the probe numbers start at 0.
- * @param[in] name The new name that the specified probe should get. A copy
+ * @param sdi The device instance the channel is connected to.
+ * @param[in] channelnum The number of the channel whose name to set.
+ *                 Note that the channel numbers start at 0.
+ * @param[in] name The new name that the specified channel should get. A copy
  *             of the string is made.
  *
  * @return SR_OK on success, or SR_ERR_ARG on invalid arguments.
  *             of the string is made.
  *
  * @return SR_OK on success, or SR_ERR_ARG on invalid arguments.
@@ -84,10 +84,10 @@ SR_PRIV struct sr_channel *sr_probe_new(int index, int type,
  * @since 0.2.0
  */
 SR_API int sr_dev_probe_name_set(const struct sr_dev_inst *sdi,
  * @since 0.2.0
  */
 SR_API int sr_dev_probe_name_set(const struct sr_dev_inst *sdi,
-               int probenum, const char *name)
+               int channelnum, const char *name)
 {
        GSList *l;
 {
        GSList *l;
-       struct sr_channel *probe;
+       struct sr_channel *ch;
        int ret;
 
        if (!sdi) {
        int ret;
 
        if (!sdi) {
@@ -96,11 +96,11 @@ SR_API int sr_dev_probe_name_set(const struct sr_dev_inst *sdi,
        }
 
        ret = SR_ERR_ARG;
        }
 
        ret = SR_ERR_ARG;
-       for (l = sdi->probes; l; l = l->next) {
-               probe = l->data;
-               if (probe->index == probenum) {
-                       g_free(probe->name);
-                       probe->name = g_strdup(name);
+       for (l = sdi->channels; l; l = l->next) {
+               ch = l->data;
+               if (ch->index == channelnum) {
+                       g_free(ch->name);
+                       ch->name = g_strdup(name);
                        ret = SR_OK;
                        break;
                }
                        ret = SR_OK;
                        break;
                }
@@ -110,23 +110,23 @@ SR_API int sr_dev_probe_name_set(const struct sr_dev_inst *sdi,
 }
 
 /**
 }
 
 /**
- * Enable or disable a probe on the specified device.
+ * Enable or disable a channel on the specified device.
  *
  *
- * @param sdi The device instance the probe is connected to.
- * @param probenum The probe number, starting from 0.
- * @param state TRUE to enable the probe, FALSE to disable.
+ * @param sdi The device instance the channel is connected to.
+ * @param channelnum The channel number, starting from 0.
+ * @param state TRUE to enable the channel, FALSE to disable.
  *
  * @return SR_OK on success or SR_ERR on failure.  In case of invalid
  *
  * @return SR_OK on success or SR_ERR on failure.  In case of invalid
- *         arguments, SR_ERR_ARG is returned and the probe enabled state
+ *         arguments, SR_ERR_ARG is returned and the channel enabled state
  *         remains unchanged.
  *
  * @since 0.2.0
  */
  *         remains unchanged.
  *
  * @since 0.2.0
  */
-SR_API int sr_dev_probe_enable(const struct sr_dev_inst *sdi, int probenum,
+SR_API int sr_dev_probe_enable(const struct sr_dev_inst *sdi, int channelnum,
                gboolean state)
 {
        GSList *l;
                gboolean state)
 {
        GSList *l;
-       struct sr_channel *probe;
+       struct sr_channel *ch;
        int ret;
        gboolean was_enabled;
 
        int ret;
        gboolean was_enabled;
 
@@ -134,19 +134,19 @@ SR_API int sr_dev_probe_enable(const struct sr_dev_inst *sdi, int probenum,
                return SR_ERR_ARG;
 
        ret = SR_ERR_ARG;
                return SR_ERR_ARG;
 
        ret = SR_ERR_ARG;
-       for (l = sdi->probes; l; l = l->next) {
-               probe = l->data;
-               if (probe->index == probenum) {
-                       was_enabled = probe->enabled;
-                       probe->enabled = state;
+       for (l = sdi->channels; l; l = l->next) {
+               ch = l->data;
+               if (ch->index == channelnum) {
+                       was_enabled = ch->enabled;
+                       ch->enabled = state;
                        ret = SR_OK;
                        if (!state != !was_enabled && sdi->driver
                                        && sdi->driver->config_probe_set) {
                                ret = sdi->driver->config_probe_set(
                        ret = SR_OK;
                        if (!state != !was_enabled && sdi->driver
                                        && sdi->driver->config_probe_set) {
                                ret = sdi->driver->config_probe_set(
-                                       sdi, probe, SR_PROBE_SET_ENABLED);
+                                       sdi, ch, SR_PROBE_SET_ENABLED);
                                /* Roll back change if it wasn't applicable. */
                                if (ret == SR_ERR_ARG)
                                /* Roll back change if it wasn't applicable. */
                                if (ret == SR_ERR_ARG)
-                                       probe->enabled = was_enabled;
+                                       ch->enabled = was_enabled;
                        }
                        break;
                }
                        }
                        break;
                }
@@ -156,13 +156,13 @@ SR_API int sr_dev_probe_enable(const struct sr_dev_inst *sdi, int probenum,
 }
 
 /**
 }
 
 /**
- * Add a trigger to the specified device (and the specified probe).
+ * Add a trigger to the specified device (and the specified channel).
  *
  *
- * If the specified probe of this device already has a trigger, it will
+ * If the specified channel of this device already has a trigger, it will
  * be silently replaced.
  *
  * @param[in,out] sdi Pointer to the device instance; must not be NULL.
  * be silently replaced.
  *
  * @param[in,out] sdi Pointer to the device instance; must not be NULL.
- * @param[in] probenum Number of probe, starting at 0.
+ * @param[in] channelnum Number of channel, starting at 0.
  * @param[in] trigger Trigger string, in the format used by sigrok-cli
  *
  * @return SR_OK on success or SR_ERR on failure.  In case of invalid
  * @param[in] trigger Trigger string, in the format used by sigrok-cli
  *
  * @return SR_OK on success or SR_ERR on failure.  In case of invalid
@@ -171,11 +171,11 @@ SR_API int sr_dev_probe_enable(const struct sr_dev_inst *sdi, int probenum,
  *
  * @since 0.2.0
  */
  *
  * @since 0.2.0
  */
-SR_API int sr_dev_trigger_set(const struct sr_dev_inst *sdi, int probenum,
+SR_API int sr_dev_trigger_set(const struct sr_dev_inst *sdi, int channelnum,
                const char *trigger)
 {
        GSList *l;
                const char *trigger)
 {
        GSList *l;
-       struct sr_channel *probe;
+       struct sr_channel *ch;
        char *old_trigger;
        int ret;
 
        char *old_trigger;
        int ret;
 
@@ -183,23 +183,23 @@ SR_API int sr_dev_trigger_set(const struct sr_dev_inst *sdi, int probenum,
                return SR_ERR_ARG;
 
        ret = SR_ERR_ARG;
                return SR_ERR_ARG;
 
        ret = SR_ERR_ARG;
-       for (l = sdi->probes; l; l = l->next) {
-               probe = l->data;
-               if (probe->index == probenum) {
-                       old_trigger = probe->trigger;
+       for (l = sdi->channels; l; l = l->next) {
+               ch = l->data;
+               if (ch->index == channelnum) {
+                       old_trigger = ch->trigger;
                        ret = SR_OK;
                        if (g_strcmp0(trigger, old_trigger) == 0)
                                break;
                        /* Set new trigger if it has changed. */
                        ret = SR_OK;
                        if (g_strcmp0(trigger, old_trigger) == 0)
                                break;
                        /* Set new trigger if it has changed. */
-                       probe->trigger = g_strdup(trigger);
+                       ch->trigger = g_strdup(trigger);
 
                        if (sdi->driver && sdi->driver->config_probe_set) {
                                ret = sdi->driver->config_probe_set(
 
                        if (sdi->driver && sdi->driver->config_probe_set) {
                                ret = sdi->driver->config_probe_set(
-                                       sdi, probe, SR_PROBE_SET_TRIGGER);
+                                       sdi, ch, SR_PROBE_SET_TRIGGER);
                                /* Roll back change if it wasn't applicable. */
                                if (ret == SR_ERR_ARG) {
                                /* Roll back change if it wasn't applicable. */
                                if (ret == SR_ERR_ARG) {
-                                       g_free(probe->trigger);
-                                       probe->trigger = old_trigger;
+                                       g_free(ch->trigger);
+                                       ch->trigger = old_trigger;
                                        break;
                                }
                        }
                                        break;
                                }
                        }
@@ -284,7 +284,7 @@ SR_PRIV struct sr_dev_inst *sr_dev_inst_new(int index, int status,
        sdi->vendor = vendor ? g_strdup(vendor) : NULL;
        sdi->model = model ? g_strdup(model) : NULL;
        sdi->version = version ? g_strdup(version) : NULL;
        sdi->vendor = vendor ? g_strdup(vendor) : NULL;
        sdi->model = model ? g_strdup(model) : NULL;
        sdi->version = version ? g_strdup(version) : NULL;
-       sdi->probes = NULL;
+       sdi->channels = NULL;
        sdi->channel_groups = NULL;
        sdi->conn = NULL;
        sdi->priv = NULL;
        sdi->channel_groups = NULL;
        sdi->conn = NULL;
        sdi->priv = NULL;
@@ -298,16 +298,16 @@ SR_PRIV struct sr_dev_inst *sr_dev_inst_new(int index, int status,
  */
 SR_PRIV void sr_dev_inst_free(struct sr_dev_inst *sdi)
 {
  */
 SR_PRIV void sr_dev_inst_free(struct sr_dev_inst *sdi)
 {
-       struct sr_channel *probe;
+       struct sr_channel *ch;
        GSList *l;
 
        GSList *l;
 
-       for (l = sdi->probes; l; l = l->next) {
-               probe = l->data;
-               g_free(probe->name);
-               g_free(probe->trigger);
-               g_free(probe);
+       for (l = sdi->channels; l; l = l->next) {
+               ch = l->data;
+               g_free(ch->name);
+               g_free(ch->trigger);
+               g_free(ch);
        }
        }
-       g_slist_free(sdi->probes);
+       g_slist_free(sdi->channels);
 
        if (sdi->channel_groups)
                g_slist_free(sdi->channel_groups);
 
        if (sdi->channel_groups)
                g_slist_free(sdi->channel_groups);
index 395b711e4d9c6927a912f27944c9d43a17c11b3e..c358640da3687eee9f9cc75baae1522946659928 100644 (file)
@@ -72,7 +72,7 @@ static GSList *scan(GSList *options)
        struct drv_context *drvc;
        struct dev_context *devc;
        struct sr_config *src;
        struct drv_context *drvc;
        struct dev_context *devc;
        struct sr_config *src;
-       struct sr_channel *probe;
+       struct sr_channel *ch;
        struct sr_serial_dev_inst *serial;
        GSList *l, *devices;
        int len, i;
        struct sr_serial_dev_inst *serial;
        GSList *l, *devices;
        int len, i;
@@ -141,9 +141,9 @@ static GSList *scan(GSList *options)
                        sdi->conn = serial;
                        sdi->priv = devc;
                        sdi->driver = di;
                        sdi->conn = serial;
                        sdi->priv = devc;
                        sdi->driver = di;
-                       if (!(probe = sr_probe_new(0, SR_PROBE_ANALOG, TRUE, "P1")))
+                       if (!(ch = sr_probe_new(0, SR_PROBE_ANALOG, TRUE, "P1")))
                                return NULL;
                                return NULL;
-                       sdi->probes = g_slist_append(sdi->probes, probe);
+                       sdi->channels = g_slist_append(sdi->channels, ch);
                        drvc->instances = g_slist_append(drvc->instances, sdi);
                        devices = g_slist_append(devices, sdi);
                        break;
                        drvc->instances = g_slist_append(drvc->instances, sdi);
                        devices = g_slist_append(devices, sdi);
                        break;
index 81fd333aabff735a0d295d663719cd0194711edb..bd9cb3885ba2ef78d528f2a3af394b691168af18 100644 (file)
@@ -266,7 +266,7 @@ static int recv_fetc(const struct sr_dev_inst *sdi, GMatchInfo *match)
        analog.mq = devc->cur_mq;
        analog.unit = devc->cur_unit;
        analog.mqflags = devc->cur_mqflags;
        analog.mq = devc->cur_mq;
        analog.unit = devc->cur_unit;
        analog.mqflags = devc->cur_mqflags;
-       analog.probes = sdi->probes;
+       analog.channels = sdi->channels;
        analog.num_samples = 1;
        analog.data = &fvalue;
        packet.type = SR_DF_ANALOG;
        analog.num_samples = 1;
        analog.data = &fvalue;
        packet.type = SR_DF_ANALOG;
index 5590d79acdf1fa5a4f4f0fcc8d2c3df2a027b040..82af3d0ed70111127312780c26f21e1c7ad1f1ff 100644 (file)
@@ -255,9 +255,9 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi, void *cb_data)
                return SR_ERR;
        }
 
                return SR_ERR;
        }
 
-       sr_dbg("Setting audio channel count to %d.", devc->num_probes);
+       sr_dbg("Setting audio channel count to %d.", devc->num_channels);
        ret = snd_pcm_hw_params_set_channels(devc->capture_handle,
        ret = snd_pcm_hw_params_set_channels(devc->capture_handle,
-                                            devc->hw_params, devc->num_probes);
+                                            devc->hw_params, devc->num_channels);
        if (ret < 0) {
                sr_err("Can't set channel count: %s.", snd_strerror(ret));
                return SR_ERR;
        if (ret < 0) {
                sr_err("Can't set channel count: %s.", snd_strerror(ret));
                return SR_ERR;
index ff785277a5dec770ca07f3e76fc33e0453e97c38..d06a10efad7926e243a9eded08dae805e49035fd 100644 (file)
@@ -63,7 +63,7 @@ static void alsa_scan_handle_dev(GSList **devices,
        struct drv_context *drvc = NULL;
        struct sr_dev_inst *sdi = NULL;
        struct dev_context *devc = NULL;
        struct drv_context *drvc = NULL;
        struct sr_dev_inst *sdi = NULL;
        struct dev_context *devc = NULL;
-       struct sr_channel *probe;
+       struct sr_channel *ch;
        int ret;
        unsigned int i, offset, channels, minrate, maxrate, rate;
        uint64_t hwrates[ARRAY_SIZE(rates)];
        int ret;
        unsigned int i, offset, channels, minrate, maxrate, rate;
        uint64_t hwrates[ARRAY_SIZE(rates)];
@@ -76,7 +76,7 @@ static void alsa_scan_handle_dev(GSList **devices,
 
        /*
         * Get hardware parameters:
 
        /*
         * Get hardware parameters:
-        * The number of channels, for example, are our sigrok probes. Getting
+        * The number of channels, for example, are our sigrok channels. Getting
         * this information needs a detour. We need to open the device, then
         * query it and/or test different parameters. A side-effect of is that
         * we create a snd_pcm_hw_params_t object. We take advantage of the
         * this information needs a detour. We need to open the device, then
         * query it and/or test different parameters. A side-effect of is that
         * we create a snd_pcm_hw_params_t object. We take advantage of the
@@ -149,7 +149,7 @@ static void alsa_scan_handle_dev(GSList **devices,
        }
 
        devc->hwdev = g_strdup(alsaname);
        }
 
        devc->hwdev = g_strdup(alsaname);
-       devc->num_probes = channels;
+       devc->num_channels = channels;
        devc->hw_params = hw_params;
        memcpy(devrates, hwrates, offset * sizeof(uint64_t));
        devc->samplerates = devrates;
        devc->hw_params = hw_params;
        memcpy(devrates, hwrates, offset * sizeof(uint64_t));
        devc->samplerates = devrates;
@@ -157,11 +157,11 @@ static void alsa_scan_handle_dev(GSList **devices,
        sdi->priv = devc;
        sdi->driver = di;
 
        sdi->priv = devc;
        sdi->driver = di;
 
-       for (i = 0; i < devc->num_probes; i++) {
+       for (i = 0; i < devc->num_channels; i++) {
                snprintf(p_name, sizeof(p_name), "Ch_%d", i);
                snprintf(p_name, sizeof(p_name), "Ch_%d", i);
-               if (!(probe = sr_probe_new(i, SR_PROBE_ANALOG, TRUE, p_name)))
+               if (!(ch = sr_probe_new(i, SR_PROBE_ANALOG, TRUE, p_name)))
                        goto scan_error_cleanup;
                        goto scan_error_cleanup;
-               sdi->probes = g_slist_append(sdi->probes, probe);
+               sdi->channels = g_slist_append(sdi->channels, ch);
        }
 
        drvc->instances = g_slist_append(drvc->instances, sdi);
        }
 
        drvc->instances = g_slist_append(drvc->instances, sdi);
@@ -202,8 +202,8 @@ scan_error_cleanup:
  *
  * We don't currently look at alsa subdevices. We only use subdevice 0.
  * Every input device will have its own channels (left, right, etc). Each of
  *
  * We don't currently look at alsa subdevices. We only use subdevice 0.
  * Every input device will have its own channels (left, right, etc). Each of
- * those channels gets mapped to a different sigrok probe. A device with 4
- * channels will have 4 probes from sigrok's perspective.
+ * those channels gets mapped to a different sigrok channel. A device with 4
+ * channels will have 4 channels from sigrok's perspective.
  */
 SR_PRIV GSList *alsa_scan(GSList *options, struct sr_dev_driver *di)
 {
  */
 SR_PRIV GSList *alsa_scan(GSList *options, struct sr_dev_driver *di)
 {
@@ -357,7 +357,7 @@ SR_PRIV int alsa_receive_data(int fd, int revents, void *cb_data)
                sr_spew("Only got %d/%d samples.", count, samples_to_get);
        }
 
                sr_spew("Only got %d/%d samples.", count, samples_to_get);
        }
 
-       analog.data = g_try_malloc0(count * sizeof(float) * devc->num_probes);
+       analog.data = g_try_malloc0(count * sizeof(float) * devc->num_channels);
        if (!analog.data) {
                sr_err("Failed to malloc sample buffer.");
                return FALSE;
        if (!analog.data) {
                sr_err("Failed to malloc sample buffer.");
                return FALSE;
@@ -372,15 +372,15 @@ SR_PRIV int alsa_receive_data(int fd, int revents, void *cb_data)
         * audio data as a normalized float, and let the frontend or user worry
         * about the calibration.
         */
         * audio data as a normalized float, and let the frontend or user worry
         * about the calibration.
         */
-       for (i = 0; i < count; i += devc->num_probes) {
-               for (x = 0; x < devc->num_probes; x++) {
+       for (i = 0; i < count; i += devc->num_channels) {
+               for (x = 0; x < devc->num_channels; x++) {
                        tmp16 = inbuf[i + x];
                        analog.data[offset++] = tmp16 * s16norm;
                }
        }
 
        /* Send a sample packet with the analog values. */
                        tmp16 = inbuf[i + x];
                        analog.data[offset++] = tmp16 * s16norm;
                }
        }
 
        /* Send a sample packet with the analog values. */
-       analog.probes = sdi->probes;
+       analog.channels = sdi->channels;
        analog.num_samples = count;
        analog.mq = SR_MQ_VOLTAGE; /* FIXME */
        analog.unit = SR_UNIT_VOLT; /* FIXME */
        analog.num_samples = count;
        analog.mq = SR_MQ_VOLTAGE; /* FIXME */
        analog.unit = SR_UNIT_VOLT; /* FIXME */
index d8688929015b2825cc8d8828ac8024455d9e4aca..465ebbaa8da7a1ec01dab337158e0959f1dcfb0d 100644 (file)
@@ -35,7 +35,7 @@ struct dev_context {
        uint64_t cur_samplerate;
        uint64_t limit_samples;
        uint64_t num_samples;
        uint64_t cur_samplerate;
        uint64_t limit_samples;
        uint64_t num_samples;
-       uint8_t num_probes;
+       uint8_t num_channels;
        uint64_t *samplerates;
        char *hwdev;
        snd_pcm_t *capture_handle;
        uint64_t *samplerates;
        char *hwdev;
        snd_pcm_t *capture_handle;
index 997da7f758bb63ad9ef39dfd8ad47cacc8ccb3b3..667b1c97cb36747a93b3b0fe2b179145ef38ffdc 100644 (file)
@@ -52,7 +52,7 @@ static GSList *scan(GSList *options)
        struct dev_context *devc;
        struct sr_serial_dev_inst *serial;
        struct sr_dev_inst *sdi;
        struct dev_context *devc;
        struct sr_serial_dev_inst *serial;
        struct sr_dev_inst *sdi;
-       struct sr_channel *probe;
+       struct sr_channel *ch;
        struct sr_config *src;
        GSList *devices, *l;
        const char *conn, *serialcomm;
        struct sr_config *src;
        GSList *devices, *l;
        const char *conn, *serialcomm;
@@ -111,12 +111,12 @@ static GSList *scan(GSList *options)
        sdi->priv = devc;
        sdi->driver = di;
 
        sdi->priv = devc;
        sdi->driver = di;
 
-       if (!(probe = sr_probe_new(0, SR_PROBE_ANALOG, TRUE, "T1")))
+       if (!(ch = sr_probe_new(0, SR_PROBE_ANALOG, TRUE, "T1")))
                goto scan_cleanup;
                goto scan_cleanup;
-       sdi->probes = g_slist_append(sdi->probes, probe);
-       if (!(probe = sr_probe_new(0, SR_PROBE_ANALOG, TRUE, "T2")))
+       sdi->channels = g_slist_append(sdi->channels, ch);
+       if (!(ch = sr_probe_new(0, SR_PROBE_ANALOG, TRUE, "T2")))
                goto scan_cleanup;
                goto scan_cleanup;
-       sdi->probes = g_slist_append(sdi->probes, probe);
+       sdi->channels = g_slist_append(sdi->channels, ch);
 
        drvc->instances = g_slist_append(drvc->instances, sdi);
        devices = g_slist_append(devices, sdi);
 
        drvc->instances = g_slist_append(drvc->instances, sdi);
        devices = g_slist_append(devices, sdi);
index e78b33ff27c2c48448ad3021bd9652c28b8bcf4e..aa77a9610d01617ca28e56b0bd0a80ebea0f1f1e 100644 (file)
@@ -69,13 +69,13 @@ static uint64_t appa_55ii_flags(const uint8_t *buf)
        return flags;
 }
 
        return flags;
 }
 
-static float appa_55ii_temp(const uint8_t *buf, int probe)
+static float appa_55ii_temp(const uint8_t *buf, int ch)
 {
        const uint8_t *ptr;
        int16_t temp;
        uint8_t flags;
 
 {
        const uint8_t *ptr;
        int16_t temp;
        uint8_t flags;
 
-       ptr = buf + 4 + 14 + 3 * probe;
+       ptr = buf + 4 + 14 + 3 * ch;
        temp = RL16(ptr);
        flags = ptr[2];
 
        temp = RL16(ptr);
        flags = ptr[2];
 
@@ -92,7 +92,7 @@ static void appa_55ii_live_data(struct sr_dev_inst *sdi, const uint8_t *buf)
        struct dev_context *devc;
        struct sr_datafeed_packet packet;
        struct sr_datafeed_analog analog;
        struct dev_context *devc;
        struct sr_datafeed_packet packet;
        struct sr_datafeed_analog analog;
-       struct sr_channel *probe;
+       struct sr_channel *ch;
        float values[APPA_55II_NUM_PROBES], *val_ptr;
        int i;
 
        float values[APPA_55II_NUM_PROBES], *val_ptr;
        int i;
 
@@ -110,17 +110,17 @@ static void appa_55ii_live_data(struct sr_dev_inst *sdi, const uint8_t *buf)
        analog.data = values;
 
        for (i = 0; i < APPA_55II_NUM_PROBES; i++) {
        analog.data = values;
 
        for (i = 0; i < APPA_55II_NUM_PROBES; i++) {
-               probe = g_slist_nth_data(sdi->probes, i);
-               if (!probe->enabled)
+               ch = g_slist_nth_data(sdi->channels, i);
+               if (!ch->enabled)
                        continue;
                        continue;
-               analog.probes = g_slist_append(analog.probes, probe);
+               analog.channels = g_slist_append(analog.channels, ch);
                *val_ptr++ = appa_55ii_temp(buf, i);
        }
 
        packet.type = SR_DF_ANALOG;
        packet.payload = &analog;
        sr_session_send(devc->session_cb_data, &packet);
                *val_ptr++ = appa_55ii_temp(buf, i);
        }
 
        packet.type = SR_DF_ANALOG;
        packet.payload = &analog;
        sr_session_send(devc->session_cb_data, &packet);
-       g_slist_free(analog.probes);
+       g_slist_free(analog.channels);
 
        devc->num_samples++;
 }
 
        devc->num_samples++;
 }
@@ -138,7 +138,7 @@ static void appa_55ii_log_data_parse(struct sr_dev_inst *sdi)
        struct dev_context *devc;
        struct sr_datafeed_packet packet;
        struct sr_datafeed_analog analog;
        struct dev_context *devc;
        struct sr_datafeed_packet packet;
        struct sr_datafeed_analog analog;
-       struct sr_channel *probe;
+       struct sr_channel *ch;
        float values[APPA_55II_NUM_PROBES], *val_ptr;
        const uint8_t *buf;
        int16_t temp;
        float values[APPA_55II_NUM_PROBES], *val_ptr;
        const uint8_t *buf;
        int16_t temp;
@@ -162,17 +162,17 @@ static void appa_55ii_log_data_parse(struct sr_dev_inst *sdi)
 
                for (i = 0; i < APPA_55II_NUM_PROBES; i++) {
                        temp = RL16(buf + 12 + 2 * i);
 
                for (i = 0; i < APPA_55II_NUM_PROBES; i++) {
                        temp = RL16(buf + 12 + 2 * i);
-                       probe = g_slist_nth_data(sdi->probes, i);
-                       if (!probe->enabled)
+                       ch = g_slist_nth_data(sdi->channels, i);
+                       if (!ch->enabled)
                                continue;
                                continue;
-                       analog.probes = g_slist_append(analog.probes, probe);
+                       analog.channels = g_slist_append(analog.channels, ch);
                        *val_ptr++ = temp == 0x7FFF ? INFINITY : (float)temp / 10;
                }
 
                packet.type = SR_DF_ANALOG;
                packet.payload = &analog;
                sr_session_send(devc->session_cb_data, &packet);
                        *val_ptr++ = temp == 0x7FFF ? INFINITY : (float)temp / 10;
                }
 
                packet.type = SR_DF_ANALOG;
                packet.payload = &analog;
                sr_session_send(devc->session_cb_data, &packet);
-               g_slist_free(analog.probes);
+               g_slist_free(analog.channels);
 
                devc->num_samples++;
                devc->log_buf_len -= 20;
 
                devc->num_samples++;
                devc->log_buf_len -= 20;
index 1a56cf3999830168657df9c86202bac679e702b1..932de635683fcf52468334f1bea9e291ab981ee4 100644 (file)
@@ -58,11 +58,11 @@ static const uint64_t samplerates[] = {
 };
 
 /*
 };
 
 /*
- * Probe numbers seem to go from 1-16, according to this image:
+ * Channel numbers seem to go from 1-16, according to this image:
  * http://tools.asix.net/img/sigma_sigmacab_pins_720.jpg
  * (the cable has two additional GND pins, and a TI and TO pin)
  */
  * http://tools.asix.net/img/sigma_sigmacab_pins_720.jpg
  * (the cable has two additional GND pins, and a TI and TO pin)
  */
-static const char *probe_names[NUM_PROBES + 1] = {
+static const char *channel_names[NUM_PROBES + 1] = {
        "1", "2", "3", "4", "5", "6", "7", "8",
        "9", "10", "11", "12", "13", "14", "15", "16",
        NULL,
        "1", "2", "3", "4", "5", "6", "7", "8",
        "9", "10", "11", "12", "13", "14", "15", "16",
        NULL,
@@ -402,7 +402,7 @@ static int init(struct sr_context *sr_ctx)
 static GSList *scan(GSList *options)
 {
        struct sr_dev_inst *sdi;
 static GSList *scan(GSList *options)
 {
        struct sr_dev_inst *sdi;
-       struct sr_channel *probe;
+       struct sr_channel *ch;
        struct drv_context *drvc;
        struct dev_context *devc;
        GSList *devices;
        struct drv_context *drvc;
        struct dev_context *devc;
        GSList *devices;
@@ -450,7 +450,7 @@ static GSList *scan(GSList *options)
        devc->period_ps = 0;
        devc->limit_msec = 0;
        devc->cur_firmware = -1;
        devc->period_ps = 0;
        devc->limit_msec = 0;
        devc->cur_firmware = -1;
-       devc->num_probes = 0;
+       devc->num_channels = 0;
        devc->samples_per_event = 0;
        devc->capture_ratio = 50;
        devc->use_triggers = 0;
        devc->samples_per_event = 0;
        devc->capture_ratio = 50;
        devc->use_triggers = 0;
@@ -463,11 +463,11 @@ static GSList *scan(GSList *options)
        }
        sdi->driver = di;
 
        }
        sdi->driver = di;
 
-       for (i = 0; probe_names[i]; i++) {
-               if (!(probe = sr_probe_new(i, SR_PROBE_LOGIC, TRUE,
-                               probe_names[i])))
+       for (i = 0; channel_names[i]; i++) {
+               if (!(ch = sr_probe_new(i, SR_PROBE_LOGIC, TRUE,
+                               channel_names[i])))
                        return NULL;
                        return NULL;
-               sdi->probes = g_slist_append(sdi->probes, probe);
+               sdi->channels = g_slist_append(sdi->channels, ch);
        }
 
        devices = g_slist_append(devices, sdi);
        }
 
        devices = g_slist_append(devices, sdi);
@@ -624,20 +624,20 @@ static int set_samplerate(const struct sr_dev_inst *sdi, uint64_t samplerate)
 
        if (samplerate <= SR_MHZ(50)) {
                ret = upload_firmware(0, devc);
 
        if (samplerate <= SR_MHZ(50)) {
                ret = upload_firmware(0, devc);
-               devc->num_probes = 16;
+               devc->num_channels = 16;
        }
        if (samplerate == SR_MHZ(100)) {
                ret = upload_firmware(1, devc);
        }
        if (samplerate == SR_MHZ(100)) {
                ret = upload_firmware(1, devc);
-               devc->num_probes = 8;
+               devc->num_channels = 8;
        }
        else if (samplerate == SR_MHZ(200)) {
                ret = upload_firmware(2, devc);
        }
        else if (samplerate == SR_MHZ(200)) {
                ret = upload_firmware(2, devc);
-               devc->num_probes = 4;
+               devc->num_channels = 4;
        }
 
        devc->cur_samplerate = samplerate;
        devc->period_ps = 1000000000000ULL / samplerate;
        }
 
        devc->cur_samplerate = samplerate;
        devc->period_ps = 1000000000000ULL / samplerate;
-       devc->samples_per_event = 16 / devc->num_probes;
+       devc->samples_per_event = 16 / devc->num_channels;
        devc->state.state = SIGMA_IDLE;
 
        return ret;
        devc->state.state = SIGMA_IDLE;
 
        return ret;
@@ -646,26 +646,26 @@ static int set_samplerate(const struct sr_dev_inst *sdi, uint64_t samplerate)
 /*
  * In 100 and 200 MHz mode, only a single pin rising/falling can be
  * set as trigger. In other modes, two rising/falling triggers can be set,
 /*
  * In 100 and 200 MHz mode, only a single pin rising/falling can be
  * set as trigger. In other modes, two rising/falling triggers can be set,
- * in addition to value/mask trigger for any number of probes.
+ * in addition to value/mask trigger for any number of channels.
  *
  * The Sigma supports complex triggers using boolean expressions, but this
  * has not been implemented yet.
  */
  *
  * The Sigma supports complex triggers using boolean expressions, but this
  * has not been implemented yet.
  */
-static int configure_probes(const struct sr_dev_inst *sdi)
+static int configure_channels(const struct sr_dev_inst *sdi)
 {
        struct dev_context *devc = sdi->priv;
 {
        struct dev_context *devc = sdi->priv;
-       const struct sr_channel *probe;
+       const struct sr_channel *ch;
        const GSList *l;
        int trigger_set = 0;
        const GSList *l;
        int trigger_set = 0;
-       int probebit;
+       int channelbit;
 
        memset(&devc->trigger, 0, sizeof(struct sigma_trigger));
 
 
        memset(&devc->trigger, 0, sizeof(struct sigma_trigger));
 
-       for (l = sdi->probes; l; l = l->next) {
-               probe = (struct sr_channel *)l->data;
-               probebit = 1 << (probe->index);
+       for (l = sdi->channels; l; l = l->next) {
+               ch = (struct sr_channel *)l->data;
+               channelbit = 1 << (ch->index);
 
 
-               if (!probe->enabled || !probe->trigger)
+               if (!ch->enabled || !ch->trigger)
                        continue;
 
                if (devc->cur_samplerate >= SR_MHZ(100)) {
                        continue;
 
                if (devc->cur_samplerate >= SR_MHZ(100)) {
@@ -675,10 +675,10 @@ static int configure_probes(const struct sr_dev_inst *sdi)
                                       "200MHz mode is supported.");
                                return SR_ERR;
                        }
                                       "200MHz mode is supported.");
                                return SR_ERR;
                        }
-                       if (probe->trigger[0] == 'f')
-                               devc->trigger.fallingmask |= probebit;
-                       else if (probe->trigger[0] == 'r')
-                               devc->trigger.risingmask |= probebit;
+                       if (ch->trigger[0] == 'f')
+                               devc->trigger.fallingmask |= channelbit;
+                       else if (ch->trigger[0] == 'r')
+                               devc->trigger.risingmask |= channelbit;
                        else {
                                sr_err("Only rising/falling trigger in 100 "
                                       "and 200MHz mode is supported.");
                        else {
                                sr_err("Only rising/falling trigger in 100 "
                                       "and 200MHz mode is supported.");
@@ -688,20 +688,20 @@ static int configure_probes(const struct sr_dev_inst *sdi)
                        ++trigger_set;
                } else {
                        /* Simple trigger support (event). */
                        ++trigger_set;
                } else {
                        /* Simple trigger support (event). */
-                       if (probe->trigger[0] == '1') {
-                               devc->trigger.simplevalue |= probebit;
-                               devc->trigger.simplemask |= probebit;
+                       if (ch->trigger[0] == '1') {
+                               devc->trigger.simplevalue |= channelbit;
+                               devc->trigger.simplemask |= channelbit;
                        }
                        }
-                       else if (probe->trigger[0] == '0') {
-                               devc->trigger.simplevalue &= ~probebit;
-                               devc->trigger.simplemask |= probebit;
+                       else if (ch->trigger[0] == '0') {
+                               devc->trigger.simplevalue &= ~channelbit;
+                               devc->trigger.simplemask |= channelbit;
                        }
                        }
-                       else if (probe->trigger[0] == 'f') {
-                               devc->trigger.fallingmask |= probebit;
+                       else if (ch->trigger[0] == 'f') {
+                               devc->trigger.fallingmask |= channelbit;
                                ++trigger_set;
                        }
                                ++trigger_set;
                        }
-                       else if (probe->trigger[0] == 'r') {
-                               devc->trigger.risingmask |= probebit;
+                       else if (ch->trigger[0] == 'r') {
+                               devc->trigger.risingmask |= channelbit;
                                ++trigger_set;
                        }
 
                                ++trigger_set;
                        }
 
@@ -945,8 +945,8 @@ static int decode_chunk_ts(uint8_t *buf, uint16_t *lastts,
                        for (k = 0; k < devc->samples_per_event; ++k) {
                                cur_sample = 0;
 
                        for (k = 0; k < devc->samples_per_event; ++k) {
                                cur_sample = 0;
 
-                               /* For each probe. */
-                               for (l = 0; l < devc->num_probes; ++l)
+                               /* For each channel. */
+                               for (l = 0; l < devc->num_channels; ++l)
                                        cur_sample |= (!!(event[j] & (1 << (l *
                                           devc->samples_per_event + k)))) << l;
 
                                        cur_sample |= (!!(event[j] & (1 << (l *
                                           devc->samples_per_event + k)))) << l;
 
@@ -1099,14 +1099,14 @@ static void build_lut_entry(uint16_t value, uint16_t mask, uint16_t *entry)
 {
        int i, j, k, bit;
 
 {
        int i, j, k, bit;
 
-       /* For each quad probe. */
+       /* For each quad channel. */
        for (i = 0; i < 4; ++i) {
                entry[i] = 0xffff;
 
                /* For each bit in LUT. */
                for (j = 0; j < 16; ++j)
 
        for (i = 0; i < 4; ++i) {
                entry[i] = 0xffff;
 
                /* For each bit in LUT. */
                for (j = 0; j < 16; ++j)
 
-                       /* For each probe in quad. */
+                       /* For each channel in quad. */
                        for (k = 0; k < 4; ++k) {
                                bit = 1 << (i * 4 + k);
 
                        for (k = 0; k < 4; ++k) {
                                bit = 1 << (i * 4 + k);
 
@@ -1265,8 +1265,8 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi, void *cb_data)
 
        devc = sdi->priv;
 
 
        devc = sdi->priv;
 
-       if (configure_probes(sdi) != SR_OK) {
-               sr_err("Failed to configure probes.");
+       if (configure_channels(sdi) != SR_OK) {
+               sr_err("Failed to configure channels.");
                return SR_ERR;
        }
 
                return SR_ERR;
        }
 
@@ -1319,10 +1319,10 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi, void *cb_data)
 
        /* Set clock select register. */
        if (devc->cur_samplerate == SR_MHZ(200))
 
        /* Set clock select register. */
        if (devc->cur_samplerate == SR_MHZ(200))
-               /* Enable 4 probes. */
+               /* Enable 4 channels. */
                sigma_set_register(WRITE_CLOCK_SELECT, 0xf0, devc);
        else if (devc->cur_samplerate == SR_MHZ(100))
                sigma_set_register(WRITE_CLOCK_SELECT, 0xf0, devc);
        else if (devc->cur_samplerate == SR_MHZ(100))
-               /* Enable 8 probes. */
+               /* Enable 8 channels. */
                sigma_set_register(WRITE_CLOCK_SELECT, 0x00, devc);
        else {
                /*
                sigma_set_register(WRITE_CLOCK_SELECT, 0x00, devc);
        else {
                /*
@@ -1333,7 +1333,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi, void *cb_data)
 
                clockselect.async = 0;
                clockselect.fraction = frac;
 
                clockselect.async = 0;
                clockselect.fraction = frac;
-               clockselect.disabled_probes = 0;
+               clockselect.disabled_channels = 0;
 
                sigma_write_register(WRITE_CLOCK_SELECT,
                                     (uint8_t *) &clockselect,
 
                sigma_write_register(WRITE_CLOCK_SELECT,
                                     (uint8_t *) &clockselect,
index 74178b1c7451490e351ce3c5197d8a2ed28aa4bf..528e6617a6386076518f47473b9aa3b20af89835 100644 (file)
@@ -79,7 +79,7 @@ enum sigma_read_register {
 struct clockselect_50 {
        uint8_t async;
        uint8_t fraction;
 struct clockselect_50 {
        uint8_t async;
        uint8_t fraction;
-       uint16_t disabled_probes;
+       uint16_t disabled_channels;
 };
 
 /* The effect of all these are still a bit unclear. */
 };
 
 /* The effect of all these are still a bit unclear. */
@@ -126,7 +126,7 @@ struct triggerlut {
 
 /* Trigger configuration */
 struct sigma_trigger {
 
 /* Trigger configuration */
 struct sigma_trigger {
-       /* Only two probes can be used in mask. */
+       /* Only two channels can be used in mask. */
        uint16_t risingmask;
        uint16_t fallingmask;
 
        uint16_t risingmask;
        uint16_t fallingmask;
 
@@ -183,7 +183,7 @@ struct dev_context {
        uint64_t limit_msec;
        struct timeval start_tv;
        int cur_firmware;
        uint64_t limit_msec;
        struct timeval start_tv;
        int cur_firmware;
-       int num_probes;
+       int num_channels;
        int samples_per_event;
        int capture_ratio;
        struct sigma_trigger trigger;
        int samples_per_event;
        int capture_ratio;
        struct sigma_trigger trigger;
index 94e8fe44f5c32a8d3fefcf0cce9e2fc0c1e41235..6dc62511dc4bed0ec9cb9ba51185e699b62101c8 100644 (file)
@@ -87,7 +87,7 @@ static GSList *scan(GSList *options, int modelid)
        struct drv_context *drvc;
        struct dev_context *devc;
        struct sr_config *src;
        struct drv_context *drvc;
        struct dev_context *devc;
        struct sr_config *src;
-       struct sr_channel *probe;
+       struct sr_channel *ch;
        struct sr_channel_group *cg;
        struct sr_serial_dev_inst *serial;
        GSList *l, *devices;
        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);
 
                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;
        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);
        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_probe_new(i, SR_PROBE_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 = 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);
        }
                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;
                const struct sr_channel_group *cg)
 {
        struct dev_context *devc;
-       struct sr_channel *probe;
+       struct sr_channel *ch;
        int channel, ret;
 
        if (!sdi)
        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. */
                }
        } 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:
 
                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;
                const struct sr_channel_group *cg)
 {
        struct dev_context *devc;
-       struct sr_channel *probe;
+       struct sr_channel *ch;
        gdouble dval;
        int channel, ret, ival;
        const char *sval;
        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. */
        } 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:
 
                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;
                const struct sr_channel_group *cg)
 {
        struct dev_context *devc;
-       struct sr_channel *probe;
+       struct sr_channel *ch;
        GVariant *gvar;
        GVariantBuilder gvb;
        int channel, ret, i;
        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. */
                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:
 
                switch (key) {
                case SR_CONF_DEVICE_OPTIONS:
@@ -473,7 +473,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi,
        serial_source_add(serial, G_IO_IN, 50, atten_pps3xxx_receive_data, (void *)sdi);
        std_session_send_df_header(cb_data, LOG_PREFIX);
 
        serial_source_add(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;
        memset(packet, 0, PACKET_SIZE);
        packet[0] = 0xaa;
        packet[1] = 0xaa;
index 68a3860c18d716deada1f41a5502cc3b9e333fe0..5658d5d576795bf1cc1c4b5a74d7fca70a4d7588 100644 (file)
@@ -45,7 +45,7 @@ static void handle_packet(const struct sr_dev_inst *sdi)
        dump_packet("received", devc->packet);
        packet.type = SR_DF_ANALOG;
        packet.payload = &analog;
        dump_packet("received", devc->packet);
        packet.type = SR_DF_ANALOG;
        packet.payload = &analog;
-       analog.probes = sdi->probes;
+       analog.channels = sdi->channels;
        analog.num_samples = 1;
 
        analog.mq = SR_MQ_VOLTAGE;
        analog.num_samples = 1;
 
        analog.mq = SR_MQ_VOLTAGE;
index 07f2e49e393be9482d9149ac1d2a2c2cb416921d..22a4862af4da0d5dcffbd0719ae8a5b8a6269ce9 100644 (file)
@@ -48,7 +48,7 @@ static GSList *scan(GSList *options)
        struct sr_dev_inst *sdi;
        struct sr_usb_dev_inst *usb;
        struct sr_config *src;
        struct sr_dev_inst *sdi;
        struct sr_usb_dev_inst *usb;
        struct sr_config *src;
-       struct sr_channel *probe;
+       struct sr_channel *ch;
        const char *conn;
 
        drvc = di->priv;
        const char *conn;
 
        drvc = di->priv;
@@ -86,12 +86,12 @@ static GSList *scan(GSList *options)
 
                sdi->priv = devc;
                sdi->driver = di;
 
                sdi->priv = devc;
                sdi->driver = di;
-               if (!(probe = sr_probe_new(0, SR_PROBE_ANALOG, TRUE, "P1")))
+               if (!(ch = sr_probe_new(0, SR_PROBE_ANALOG, TRUE, "P1")))
                        return NULL;
                        return NULL;
-               sdi->probes = g_slist_append(sdi->probes, probe);
-               if (!(probe = sr_probe_new(0, SR_PROBE_ANALOG, TRUE, "P2")))
+               sdi->channels = g_slist_append(sdi->channels, ch);
+               if (!(ch = sr_probe_new(0, SR_PROBE_ANALOG, TRUE, "P2")))
                        return NULL;
                        return NULL;
-               sdi->probes = g_slist_append(sdi->probes, probe);
+               sdi->channels = g_slist_append(sdi->channels, ch);
 
                sdi->inst_type = SR_INST_USB;
                sdi->conn = usb;
 
                sdi->inst_type = SR_INST_USB;
                sdi->conn = usb;
index 85329ac4755536c41a5794b7d76820ebce6aa6d6..b8fdcaab0e234778e68aa05b06e94c7f01f33ba3 100644 (file)
@@ -208,22 +208,22 @@ static void brymen_bm86x_handle_packet(const struct sr_dev_inst *sdi,
                /* Got a measurement. */
                analog[0].num_samples = 1;
                analog[0].data = &floatval[0];
                /* Got a measurement. */
                analog[0].num_samples = 1;
                analog[0].data = &floatval[0];
-               analog[0].probes = g_slist_append(NULL, sdi->probes->data);
+               analog[0].channels = g_slist_append(NULL, sdi->channels->data);
                packet.type = SR_DF_ANALOG;
                packet.payload = &analog[0];
                sr_session_send(devc->session_cb_data, &packet);
                packet.type = SR_DF_ANALOG;
                packet.payload = &analog[0];
                sr_session_send(devc->session_cb_data, &packet);
-               g_slist_free(analog[0].probes);
+               g_slist_free(analog[0].channels);
        }
 
        if (analog[1].mq != -1) {
                /* Got a measurement. */
                analog[1].num_samples = 1;
                analog[1].data = &floatval[1];
        }
 
        if (analog[1].mq != -1) {
                /* Got a measurement. */
                analog[1].num_samples = 1;
                analog[1].data = &floatval[1];
-               analog[1].probes = g_slist_append(NULL, sdi->probes->next->data);
+               analog[1].channels = g_slist_append(NULL, sdi->channels->next->data);
                packet.type = SR_DF_ANALOG;
                packet.payload = &analog[1];
                sr_session_send(devc->session_cb_data, &packet);
                packet.type = SR_DF_ANALOG;
                packet.payload = &analog[1];
                sr_session_send(devc->session_cb_data, &packet);
-               g_slist_free(analog[1].probes);
+               g_slist_free(analog[1].channels);
        }
 
        if (analog[0].mq != -1 || analog[1].mq != -1)
        }
 
        if (analog[0].mq != -1 || analog[1].mq != -1)
index df89fbbeadaa422dab41c2bb6a9fcfaaa947f1e5..fced965499972e2fd2a0183705b25a37d68837d0 100644 (file)
@@ -44,7 +44,7 @@ static GSList *brymen_scan(const char *conn, const char *serialcomm)
        struct sr_dev_inst *sdi;
        struct dev_context *devc;
        struct drv_context *drvc;
        struct sr_dev_inst *sdi;
        struct dev_context *devc;
        struct drv_context *drvc;
-       struct sr_channel *probe;
+       struct sr_channel *ch;
        struct sr_serial_dev_inst *serial;
        GSList *devices;
        int ret;
        struct sr_serial_dev_inst *serial;
        GSList *devices;
        int ret;
@@ -89,10 +89,10 @@ static GSList *brymen_scan(const char *conn, const char *serialcomm)
        sdi->priv = devc;
        sdi->driver = di;
 
        sdi->priv = devc;
        sdi->driver = di;
 
-       if (!(probe = sr_probe_new(0, SR_PROBE_ANALOG, TRUE, "P1")))
+       if (!(ch = sr_probe_new(0, SR_PROBE_ANALOG, TRUE, "P1")))
                goto scan_cleanup;
 
                goto scan_cleanup;
 
-       sdi->probes = g_slist_append(sdi->probes, probe);
+       sdi->channels = g_slist_append(sdi->channels, ch);
        drvc->instances = g_slist_append(drvc->instances, sdi);
        devices = g_slist_append(devices, sdi);
 
        drvc->instances = g_slist_append(drvc->instances, sdi);
        devices = g_slist_append(devices, sdi);
 
index 97c582365ed120c2849b48c0198332ab66e85e70..664258aa72f53fb3cc06799176d51b5eb12e24a6 100644 (file)
@@ -35,7 +35,7 @@ static void handle_packet(const uint8_t *buf, struct sr_dev_inst *sdi)
                return;
        analog.data = &floatval;
 
                return;
        analog.data = &floatval;
 
-       analog.probes = sdi->probes;
+       analog.channels = sdi->channels;
 
        if (analog.mq != -1) {
                /* Got a measurement. */
 
        if (analog.mq != -1) {
                /* Got a measurement. */
index e42f859854852c8ab2d0388f0848ce2afc08170e..6a5b327566e3a332c4673f370b68df7f4f26f1ec 100644 (file)
@@ -79,7 +79,7 @@ static GSList *scan(GSList *options)
        struct sr_config *src;
        struct sr_serial_dev_inst *serial;
        struct sr_dev_inst *sdi;
        struct sr_config *src;
        struct sr_serial_dev_inst *serial;
        struct sr_dev_inst *sdi;
-       struct sr_channel *probe;
+       struct sr_channel *ch;
        GSList *l, *devices;
        gint64 start;
        const char *conn;
        GSList *l, *devices;
        gint64 start;
        const char *conn;
@@ -126,9 +126,9 @@ static GSList *scan(GSList *options)
                        sdi->inst_type = SR_INST_SERIAL;
                        sdi->priv = devc;
                        sdi->driver = di;
                        sdi->inst_type = SR_INST_SERIAL;
                        sdi->priv = devc;
                        sdi->driver = di;
-                       if (!(probe = sr_probe_new(0, SR_PROBE_ANALOG, TRUE, "SPL")))
+                       if (!(ch = sr_probe_new(0, SR_PROBE_ANALOG, TRUE, "SPL")))
                                return NULL;
                                return NULL;
-                       sdi->probes = g_slist_append(sdi->probes, probe);
+                       sdi->channels = g_slist_append(sdi->channels, ch);
                        drvc->instances = g_slist_append(drvc->instances, sdi);
                        devices = g_slist_append(devices, sdi);
                        break;
                        drvc->instances = g_slist_append(drvc->instances, sdi);
                        devices = g_slist_append(devices, sdi);
                        break;
index 78b02f6a0728213207209b095fb6c3fabbeaf782..19e083062c69331230589be10ab7e6ec34bab4e2 100644 (file)
@@ -134,7 +134,7 @@ static void process_mset(const struct sr_dev_inst *sdi)
                analog.mq = SR_MQ_SOUND_PRESSURE_LEVEL;
                analog.mqflags = devc->cur_mqflags;
                analog.unit = SR_UNIT_DECIBEL_SPL;
                analog.mq = SR_MQ_SOUND_PRESSURE_LEVEL;
                analog.mqflags = devc->cur_mqflags;
                analog.unit = SR_UNIT_DECIBEL_SPL;
-               analog.probes = sdi->probes;
+               analog.channels = sdi->channels;
                analog.num_samples = 1;
                analog.data = &devc->last_spl;
                packet.type = SR_DF_ANALOG;
                analog.num_samples = 1;
                analog.data = &devc->last_spl;
                packet.type = SR_DF_ANALOG;
@@ -193,7 +193,7 @@ static void send_data(const struct sr_dev_inst *sdi, unsigned char *data,
        analog.mq = SR_MQ_SOUND_PRESSURE_LEVEL;
        analog.mqflags = devc->cur_mqflags;
        analog.unit = SR_UNIT_DECIBEL_SPL;
        analog.mq = SR_MQ_SOUND_PRESSURE_LEVEL;
        analog.mqflags = devc->cur_mqflags;
        analog.unit = SR_UNIT_DECIBEL_SPL;
-       analog.probes = sdi->probes;
+       analog.channels = sdi->channels;
        analog.num_samples = num_samples;
        analog.data = fbuf;
        packet.type = SR_DF_ANALOG;
        analog.num_samples = num_samples;
        analog.data = fbuf;
        packet.type = SR_DF_ANALOG;
index 9c3bba7a6ea9735f1cca1010d75515f63a47a1bc..e2b9900472c7acf16e497630ff0a01a216b9c674 100644 (file)
@@ -32,7 +32,7 @@ static const int32_t hwcaps[] = {
        SR_CONF_CONTINUOUS,
 };
 
        SR_CONF_CONTINUOUS,
 };
 
-static const char *probe_names[] = {
+static const char *channel_names[] = {
        "T1", "T2", "T3", "T4",
        NULL,
 };
        "T1", "T2", "T3", "T4",
        NULL,
 };
@@ -71,7 +71,7 @@ static GSList *center_scan(const char *conn, const char *serialcomm, int idx)
        struct sr_dev_inst *sdi;
        struct drv_context *drvc;
        struct dev_context *devc;
        struct sr_dev_inst *sdi;
        struct drv_context *drvc;
        struct dev_context *devc;
-       struct sr_channel *probe;
+       struct sr_channel *ch;
        struct sr_serial_dev_inst *serial;
        GSList *devices;
 
        struct sr_serial_dev_inst *serial;
        GSList *devices;
 
@@ -103,10 +103,10 @@ static GSList *center_scan(const char *conn, const char *serialcomm, int idx)
        sdi->driver = center_devs[idx].di;
 
        for (i = 0; i <  center_devs[idx].num_channels; i++) {
        sdi->driver = center_devs[idx].di;
 
        for (i = 0; i <  center_devs[idx].num_channels; i++) {
-               if (!(probe = sr_probe_new(i, SR_PROBE_ANALOG,
-                                          TRUE, probe_names[i])))
+               if (!(ch = sr_probe_new(i, SR_PROBE_ANALOG,
+                                          TRUE, channel_names[i])))
                        goto scan_cleanup;
                        goto scan_cleanup;
-               sdi->probes = g_slist_append(sdi->probes, probe);
+               sdi->channels = g_slist_append(sdi->channels, ch);
        }
 
        drvc->instances = g_slist_append(drvc->instances, sdi);
        }
 
        drvc->instances = g_slist_append(drvc->instances, sdi);
index f9e5e8156d67d437da9b040a829123faa40885fb..ef8b9dcd600c7f45858e399b6fbfb93aa678fc55 100644 (file)
@@ -136,7 +136,7 @@ static int handle_packet(const uint8_t *buf, struct sr_dev_inst *sdi, int idx)
                return SR_ERR;
        }
 
                return SR_ERR;
        }
 
-       /* Common values for all 4 probes. */
+       /* Common values for all 4 channels. */
        packet.type = SR_DF_ANALOG;
        packet.payload = &analog;
        analog.mq = SR_MQ_TEMPERATURE;
        packet.type = SR_DF_ANALOG;
        packet.payload = &analog;
        analog.mq = SR_MQ_TEMPERATURE;
@@ -146,8 +146,8 @@ static int handle_packet(const uint8_t *buf, struct sr_dev_inst *sdi, int idx)
        /* Send the values for T1 - T4. */
        for (i = 0; i < 4; i++) {
                l = NULL;
        /* Send the values for T1 - T4. */
        for (i = 0; i < 4; i++) {
                l = NULL;
-               l = g_slist_append(l, g_slist_nth_data(sdi->probes, i));
-               analog.probes = l;
+               l = g_slist_append(l, g_slist_nth_data(sdi->channels, i));
+               analog.channels = l;
                analog.data = &(info.temp[i]);
                sr_session_send(devc->cb_data, &packet);
                g_slist_free(l);
                analog.data = &(info.temp[i]);
                sr_session_send(devc->cb_data, &packet);
                g_slist_free(l);
index 2d6a00ad67fcd83dea282cf4f4b7e9e28559a839..9d07955941cc674dfb94ac3db487948219f9a193 100644 (file)
@@ -79,7 +79,7 @@ static int init(struct sr_context *sr_ctx)
 static GSList *scan(GSList *options)
 {
        struct sr_dev_inst *sdi;
 static GSList *scan(GSList *options)
 {
        struct sr_dev_inst *sdi;
-       struct sr_channel *probe;
+       struct sr_channel *ch;
        struct drv_context *drvc;
        struct dev_context *devc;
        GSList *devices;
        struct drv_context *drvc;
        struct dev_context *devc;
        GSList *devices;
@@ -107,7 +107,7 @@ static GSList *scan(GSList *options)
        memset(devc->mangled_buf, 0, BS);
        devc->final_buf = NULL;
        devc->trigger_pattern = 0x00; /* Value irrelevant, see trigger_mask. */
        memset(devc->mangled_buf, 0, BS);
        devc->final_buf = NULL;
        devc->trigger_pattern = 0x00; /* Value irrelevant, see trigger_mask. */
-       devc->trigger_mask = 0x00; /* All probes are "don't care". */
+       devc->trigger_mask = 0x00; /* All channels are "don't care". */
        devc->trigger_timeout = 10; /* Default to 10s trigger timeout. */
        devc->trigger_found = 0;
        devc->done = 0;
        devc->trigger_timeout = 10; /* Default to 10s trigger timeout. */
        devc->trigger_found = 0;
        devc->done = 0;
@@ -153,11 +153,11 @@ static GSList *scan(GSList *options)
        sdi->driver = di;
        sdi->priv = devc;
 
        sdi->driver = di;
        sdi->priv = devc;
 
-       for (i = 0; chronovu_la8_probe_names[i]; i++) {
-               if (!(probe = sr_probe_new(i, SR_PROBE_LOGIC, TRUE,
-                                          chronovu_la8_probe_names[i])))
+       for (i = 0; chronovu_la8_channel_names[i]; i++) {
+               if (!(ch = sr_probe_new(i, SR_PROBE_LOGIC, TRUE,
+                                          chronovu_la8_channel_names[i])))
                        return NULL;
                        return NULL;
-               sdi->probes = g_slist_append(sdi->probes, probe);
+               sdi->channels = g_slist_append(sdi->channels, ch);
        }
 
        devices = g_slist_append(devices, sdi);
        }
 
        devices = g_slist_append(devices, sdi);
@@ -446,8 +446,8 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi, void *cb_data)
                return SR_ERR;
        }
 
                return SR_ERR;
        }
 
-       if (configure_probes(sdi) != SR_OK) {
-               sr_err("Failed to configure probes.");
+       if (configure_channels(sdi) != SR_OK) {
+               sr_err("Failed to configure channels.");
                return SR_ERR;
        }
 
                return SR_ERR;
        }
 
index 4dcf26ff4a68311176c2d2362331c49825e3231e..85d21d992f385e4ff3987bdad680014ad5095d6b 100644 (file)
@@ -25,7 +25,7 @@
 #include "protocol.h"
 
 /* Probes are numbered 0-7. */
 #include "protocol.h"
 
 /* Probes are numbered 0-7. */
-SR_PRIV const char *chronovu_la8_probe_names[NUM_PROBES + 1] = {
+SR_PRIV const char *chronovu_la8_channel_names[NUM_PROBES + 1] = {
        "0", "1", "2", "3", "4", "5", "6", "7",
        NULL,
 };
        "0", "1", "2", "3", "4", "5", "6", "7",
        NULL,
 };
@@ -284,46 +284,46 @@ SR_PRIV int la8_reset(struct dev_context *devc)
        return SR_OK;
 }
 
        return SR_OK;
 }
 
-SR_PRIV int configure_probes(const struct sr_dev_inst *sdi)
+SR_PRIV int configure_channels(const struct sr_dev_inst *sdi)
 {
        struct dev_context *devc;
 {
        struct dev_context *devc;
-       const struct sr_channel *probe;
+       const struct sr_channel *ch;
        const GSList *l;
        const GSList *l;
-       uint8_t probe_bit;
+       uint8_t channel_bit;
        char *tc;
 
        devc = sdi->priv;
        devc->trigger_pattern = 0;
        char *tc;
 
        devc = sdi->priv;
        devc->trigger_pattern = 0;
-       devc->trigger_mask = 0; /* Default to "don't care" for all probes. */
+       devc->trigger_mask = 0; /* Default to "don't care" for all channels. */
 
 
-       for (l = sdi->probes; l; l = l->next) {
-               probe = (struct sr_channel *)l->data;
+       for (l = sdi->channels; l; l = l->next) {
+               ch = (struct sr_channel *)l->data;
 
 
-               if (!probe) {
-                       sr_err("%s: probe was NULL.", __func__);
+               if (!ch) {
+                       sr_err("%s: channel was NULL.", __func__);
                        return SR_ERR;
                }
 
                        return SR_ERR;
                }
 
-               /* Skip disabled probes. */
-               if (!probe->enabled)
+               /* Skip disabled channels. */
+               if (!ch->enabled)
                        continue;
 
                        continue;
 
-               /* Skip (enabled) probes with no configured trigger. */
-               if (!probe->trigger)
+               /* Skip (enabled) channels with no configured trigger. */
+               if (!ch->trigger)
                        continue;
 
                        continue;
 
-               /* Note: Must only be run if probe->trigger != NULL. */
-               if (probe->index < 0 || probe->index > 7) {
-                       sr_err("%s: Invalid probe index %d, must be "
-                              "between 0 and 7.", __func__, probe->index);
+               /* Note: Must only be run if ch->trigger != NULL. */
+               if (ch->index < 0 || ch->index > 7) {
+                       sr_err("%s: Invalid channel index %d, must be "
+                              "between 0 and 7.", __func__, ch->index);
                        return SR_ERR;
                }
 
                        return SR_ERR;
                }
 
-               probe_bit = (1 << (probe->index));
+               channel_bit = (1 << (ch->index));
 
 
-               /* Configure the probe's trigger mask and trigger pattern. */
-               for (tc = probe->trigger; tc && *tc; tc++) {
-                       devc->trigger_mask |= probe_bit;
+               /* Configure the channel's trigger mask and trigger pattern. */
+               for (tc = ch->trigger; tc && *tc; tc++) {
+                       devc->trigger_mask |= channel_bit;
 
                        /* Sanity check, LA8 only supports low/high trigger. */
                        if (*tc != '0' && *tc != '1') {
 
                        /* Sanity check, LA8 only supports low/high trigger. */
                        if (*tc != '0' && *tc != '1') {
@@ -333,7 +333,7 @@ SR_PRIV int configure_probes(const struct sr_dev_inst *sdi)
                        }
 
                        if (*tc == '1')
                        }
 
                        if (*tc == '1')
-                               devc->trigger_pattern |= probe_bit;
+                               devc->trigger_pattern |= channel_bit;
                }
        }
 
                }
        }
 
index 146fc112d5955feb4b8fb6c031bb76e665711267..2887ba03cd65ef73ac4c22708295a3e0532a504f 100644 (file)
@@ -74,7 +74,7 @@ struct dev_context {
 
        /**
         * Trigger pattern (MSB = channel 7, LSB = channel 0).
 
        /**
         * Trigger pattern (MSB = channel 7, LSB = channel 0).
-        * A 1 bit matches a high signal, 0 matches a low signal on a probe.
+        * A 1 bit matches a high signal, 0 matches a low signal on a channel.
         * Only low/high triggers (but not e.g. rising/falling) are supported.
         */
        uint8_t trigger_pattern;
         * Only low/high triggers (but not e.g. rising/falling) are supported.
         */
        uint8_t trigger_pattern;
@@ -107,7 +107,7 @@ struct dev_context {
 /* protocol.c */
 extern const int32_t chronovu_la8_hwcaps[];
 extern uint64_t chronovu_la8_samplerates[];
 /* protocol.c */
 extern const int32_t chronovu_la8_hwcaps[];
 extern uint64_t chronovu_la8_samplerates[];
-extern SR_PRIV const char *chronovu_la8_probe_names[];
+extern SR_PRIV const char *chronovu_la8_channel_names[];
 SR_PRIV void fill_supported_samplerates_if_needed(void);
 SR_PRIV int is_valid_samplerate(uint64_t samplerate);
 SR_PRIV uint8_t samplerate_to_divcount(uint64_t samplerate);
 SR_PRIV void fill_supported_samplerates_if_needed(void);
 SR_PRIV int is_valid_samplerate(uint64_t samplerate);
 SR_PRIV uint8_t samplerate_to_divcount(uint64_t samplerate);
@@ -116,7 +116,7 @@ SR_PRIV int la8_read(struct dev_context *devc, uint8_t *buf, int size);
 SR_PRIV int la8_close(struct dev_context *devc);
 SR_PRIV int la8_close_usb_reset_sequencer(struct dev_context *devc);
 SR_PRIV int la8_reset(struct dev_context *devc);
 SR_PRIV int la8_close(struct dev_context *devc);
 SR_PRIV int la8_close_usb_reset_sequencer(struct dev_context *devc);
 SR_PRIV int la8_reset(struct dev_context *devc);
-SR_PRIV int configure_probes(const struct sr_dev_inst *sdi);
+SR_PRIV int configure_channels(const struct sr_dev_inst *sdi);
 SR_PRIV int set_samplerate(const struct sr_dev_inst *sdi, uint64_t samplerate);
 SR_PRIV int la8_read_block(struct dev_context *devc);
 SR_PRIV void send_block_to_session_bus(struct dev_context *devc, int block);
 SR_PRIV int set_samplerate(const struct sr_dev_inst *sdi, uint64_t samplerate);
 SR_PRIV int la8_read_block(struct dev_context *devc);
 SR_PRIV void send_block_to_session_bus(struct dev_context *devc, int block);
index 58b8dfb60c68de49b941702bf6b6b779cb775b07..a73fe299df1678b390b02c025c43b818d426655e 100644 (file)
@@ -56,7 +56,7 @@ static GSList *scan(GSList *options)
        struct dev_context *devc;
        struct sr_dev_inst *sdi;
        struct sr_config *src;
        struct dev_context *devc;
        struct sr_dev_inst *sdi;
        struct sr_config *src;
-       struct sr_channel *probe;
+       struct sr_channel *ch;
        GSList *devices, *l;
        const char *conn, *serialcomm;
 
        GSList *devices, *l;
        const char *conn, *serialcomm;
 
@@ -97,9 +97,9 @@ static GSList *scan(GSList *options)
        sdi->inst_type = SR_INST_SERIAL;
        sdi->priv = devc;
        sdi->driver = di;
        sdi->inst_type = SR_INST_SERIAL;
        sdi->priv = devc;
        sdi->driver = di;
-       if (!(probe = sr_probe_new(0, SR_PROBE_ANALOG, TRUE, "P1")))
+       if (!(ch = sr_probe_new(0, SR_PROBE_ANALOG, TRUE, "P1")))
                return NULL;
                return NULL;
-       sdi->probes = g_slist_append(sdi->probes, probe);
+       sdi->channels = g_slist_append(sdi->channels, ch);
        drvc->instances = g_slist_append(drvc->instances, sdi);
        devices = g_slist_append(devices, sdi);
 
        drvc->instances = g_slist_append(drvc->instances, sdi);
        devices = g_slist_append(devices, sdi);
 
index e10fc37e438b8dbf7f914faafa579fbd9160f031..4abcdd5e43dc336814fa4f70862713aa6744a59f 100644 (file)
@@ -74,7 +74,7 @@ static void process_packet(const struct sr_dev_inst *sdi)
        memset(&analog, 0, sizeof(struct sr_datafeed_analog));
        analog.mq = SR_MQ_SOUND_PRESSURE_LEVEL;
        analog.unit = SR_UNIT_DECIBEL_SPL;
        memset(&analog, 0, sizeof(struct sr_datafeed_analog));
        analog.mq = SR_MQ_SOUND_PRESSURE_LEVEL;
        analog.unit = SR_UNIT_DECIBEL_SPL;
-       analog.probes = sdi->probes;
+       analog.channels = sdi->channels;
        analog.num_samples = 1;
        analog.data = &fvalue;
 
        analog.num_samples = 1;
        analog.data = &fvalue;
 
index 2a8c6dc0cfa50cc9b0fe9449f03ae3600b70667c..9d5f9d0d49e27b24c7ff6123ddb8bd515e06f1d2 100644 (file)
@@ -52,7 +52,7 @@ static GSList *scan(GSList *options)
        struct sr_dev_inst *sdi;
        struct drv_context *drvc;
        struct sr_config *src;
        struct sr_dev_inst *sdi;
        struct drv_context *drvc;
        struct sr_config *src;
-       struct sr_channel *probe;
+       struct sr_channel *ch;
        struct sr_serial_dev_inst *serial;
        GSList *l, *devices;
        const char *conn, *serialcomm;
        struct sr_serial_dev_inst *serial;
        GSList *l, *devices;
        const char *conn, *serialcomm;
@@ -101,9 +101,9 @@ static GSList *scan(GSList *options)
        sdi->conn = serial;
        sdi->priv = NULL;
        sdi->driver = di;
        sdi->conn = serial;
        sdi->priv = NULL;
        sdi->driver = di;
-       if (!(probe = sr_probe_new(0, SR_PROBE_ANALOG, TRUE, "CH1")))
+       if (!(ch = sr_probe_new(0, SR_PROBE_ANALOG, TRUE, "CH1")))
                return NULL;
                return NULL;
-       sdi->probes = g_slist_append(sdi->probes, probe);
+       sdi->channels = g_slist_append(sdi->channels, ch);
 
        drvc->instances = g_slist_append(drvc->instances, sdi);
        devices = g_slist_append(devices, sdi);
 
        drvc->instances = g_slist_append(drvc->instances, sdi);
        devices = g_slist_append(devices, sdi);
index 45a6a13c5f002740ae9bd4101794fd820cab81c2..3c6585dd0086d81fad2a7e5957a5c2357a8ff171 100644 (file)
 /* Logic patterns we can generate. */
 enum {
        /**
 /* Logic patterns we can generate. */
 enum {
        /**
-        * Spells "sigrok" across 8 probes using '0's (with '1's as
+        * Spells "sigrok" across 8 channels using '0's (with '1's as
         * "background") when displayed using the 'bits' output format.
         * "background") when displayed using the 'bits' output format.
-        * The pattern is repeasted every 8 probes, shifted to the right
+        * The pattern is repeasted every 8 channels, shifted to the right
         * in time by one bit.
         */
        PATTERN_SIGROK,
 
         * in time by one bit.
         */
        PATTERN_SIGROK,
 
-       /** Pseudo-random values on all probes. */
+       /** Pseudo-random values on all channels. */
        PATTERN_RANDOM,
 
        /**
        PATTERN_RANDOM,
 
        /**
-        * Incrementing number across 8 probes. The pattern is repeasted
-        * every 8 probes, shifted to the right in time by one bit.
+        * Incrementing number across 8 channels. The pattern is repeasted
+        * every 8 channels, shifted to the right in time by one bit.
         */
        PATTERN_INC,
 
         */
        PATTERN_INC,
 
-       /** All probes have a low logic state. */
+       /** All channels have a low logic state. */
        PATTERN_ALL_LOW,
 
        PATTERN_ALL_LOW,
 
-       /** All probes have a high logic state. */
+       /** All channels have a high logic state. */
        PATTERN_ALL_HIGH,
 };
 
        PATTERN_ALL_HIGH,
 };
 
@@ -116,13 +116,13 @@ struct dev_context {
        int64_t starttime;
        uint64_t step;
        /* Logic */
        int64_t starttime;
        uint64_t step;
        /* Logic */
-       int32_t num_logic_probes;
+       int32_t num_logic_channels;
        unsigned int logic_unitsize;
        /* There is only ever one logic channel group, so its pattern goes here. */
        uint8_t logic_pattern;
        unsigned char logic_data[LOGIC_BUFSIZE];
        /* Analog */
        unsigned int logic_unitsize;
        /* 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;
+       int32_t num_analog_channels;
        GSList *analog_channel_groups;
 };
 
        GSList *analog_channel_groups;
 };
 
@@ -255,26 +255,26 @@ static GSList *scan(GSList *options)
        struct drv_context *drvc;
        struct dev_context *devc;
        struct sr_dev_inst *sdi;
        struct drv_context *drvc;
        struct dev_context *devc;
        struct sr_dev_inst *sdi;
-       struct sr_channel *probe;
+       struct sr_channel *ch;
        struct sr_channel_group *cg;
        struct sr_config *src;
        struct analog_gen *ag;
        GSList *devices, *l;
        struct sr_channel_group *cg;
        struct sr_config *src;
        struct analog_gen *ag;
        GSList *devices, *l;
-       int num_logic_probes, num_analog_probes, pattern, i;
-       char probe_name[16];
+       int num_logic_channels, num_analog_channels, pattern, i;
+       char channel_name[16];
 
        drvc = di->priv;
 
 
        drvc = di->priv;
 
-       num_logic_probes = DEFAULT_NUM_LOGIC_PROBES;
-       num_analog_probes = DEFAULT_NUM_ANALOG_PROBES;
+       num_logic_channels = DEFAULT_NUM_LOGIC_PROBES;
+       num_analog_channels = DEFAULT_NUM_ANALOG_PROBES;
        for (l = options; l; l = l->next) {
                src = l->data;
                switch (src->key) {
                case SR_CONF_NUM_LOGIC_PROBES:
        for (l = options; l; l = l->next) {
                src = l->data;
                switch (src->key) {
                case SR_CONF_NUM_LOGIC_PROBES:
-                       num_logic_probes = g_variant_get_int32(src->data);
+                       num_logic_channels = g_variant_get_int32(src->data);
                        break;
                case SR_CONF_NUM_ANALOG_PROBES:
                        break;
                case SR_CONF_NUM_ANALOG_PROBES:
-                       num_analog_probes = g_variant_get_int32(src->data);
+                       num_analog_channels = g_variant_get_int32(src->data);
                        break;
                }
        }
                        break;
                }
        }
@@ -295,47 +295,47 @@ static GSList *scan(GSList *options)
        devc->limit_samples = 0;
        devc->limit_msec = 0;
        devc->step = 0;
        devc->limit_samples = 0;
        devc->limit_msec = 0;
        devc->step = 0;
-       devc->num_logic_probes = num_logic_probes;
-       devc->logic_unitsize = (devc->num_logic_probes + 7) / 8;
+       devc->num_logic_channels = num_logic_channels;
+       devc->logic_unitsize = (devc->num_logic_channels + 7) / 8;
        devc->logic_pattern = PATTERN_SIGROK;
        devc->logic_pattern = PATTERN_SIGROK;
-       devc->num_analog_probes = num_analog_probes;
+       devc->num_analog_channels = num_analog_channels;
        devc->analog_channel_groups = NULL;
 
        devc->analog_channel_groups = NULL;
 
-       /* Logic probes, all in one channel group. */
+       /* Logic channels, all in one channel group. */
        if (!(cg = g_try_malloc(sizeof(struct sr_channel_group))))
                return NULL;
        cg->name = g_strdup("Logic");
        cg->channels = NULL;
        cg->priv = NULL;
        if (!(cg = g_try_malloc(sizeof(struct sr_channel_group))))
                return NULL;
        cg->name = g_strdup("Logic");
        cg->channels = NULL;
        cg->priv = NULL;
-       for (i = 0; i < num_logic_probes; i++) {
-               sprintf(probe_name, "D%d", i);
-               if (!(probe = sr_probe_new(i, SR_PROBE_LOGIC, TRUE, probe_name)))
+       for (i = 0; i < num_logic_channels; i++) {
+               sprintf(channel_name, "D%d", i);
+               if (!(ch = sr_probe_new(i, SR_PROBE_LOGIC, TRUE, channel_name)))
                        return NULL;
                        return NULL;
-               sdi->probes = g_slist_append(sdi->probes, probe);
-               cg->channels = g_slist_append(cg->channels, probe);
+               sdi->channels = g_slist_append(sdi->channels, ch);
+               cg->channels = g_slist_append(cg->channels, ch);
        }
        sdi->channel_groups = g_slist_append(NULL, cg);
 
        }
        sdi->channel_groups = g_slist_append(NULL, cg);
 
-       /* Analog probes, channel groups and pattern generators. */
+       /* Analog channels, channel groups and pattern generators. */
 
        pattern = 0;
 
        pattern = 0;
-       for (i = 0; i < num_analog_probes; i++) {
-               sprintf(probe_name, "A%d", i);
-               if (!(probe = sr_probe_new(i + num_logic_probes,
-                               SR_PROBE_ANALOG, TRUE, probe_name)))
+       for (i = 0; i < num_analog_channels; i++) {
+               sprintf(channel_name, "A%d", i);
+               if (!(ch = sr_probe_new(i + num_logic_channels,
+                               SR_PROBE_ANALOG, TRUE, channel_name)))
                        return NULL;
                        return NULL;
-               sdi->probes = g_slist_append(sdi->probes, probe);
+               sdi->channels = g_slist_append(sdi->channels, ch);
 
 
-               /* Every analog probe gets its own channel group. */
+               /* Every analog channel gets its own channel group. */
                if (!(cg = g_try_malloc(sizeof(struct sr_channel_group))))
                        return NULL;
                if (!(cg = g_try_malloc(sizeof(struct sr_channel_group))))
                        return NULL;
-               cg->name = g_strdup(probe_name);
-               cg->channels = g_slist_append(NULL, probe);
+               cg->name = g_strdup(channel_name);
+               cg->channels = g_slist_append(NULL, ch);
 
                /* Every channel group gets a generator struct. */
                if (!(ag = g_try_malloc(sizeof(struct analog_gen))))
                        return NULL;
 
                /* Every channel group gets a generator struct. */
                if (!(ag = g_try_malloc(sizeof(struct analog_gen))))
                        return NULL;
-               ag->packet.probes = cg->channels;
+               ag->packet.channels = cg->channels;
                ag->packet.mq = 0;
                ag->packet.mqflags = 0;
                ag->packet.unit = SR_UNIT_VOLT;
                ag->packet.mq = 0;
                ag->packet.mqflags = 0;
                ag->packet.unit = SR_UNIT_VOLT;
@@ -385,7 +385,7 @@ static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi,
                const struct sr_channel_group *cg)
 {
        struct dev_context *devc;
                const struct sr_channel_group *cg)
 {
        struct dev_context *devc;
-       struct sr_channel *probe;
+       struct sr_channel *ch;
        struct analog_gen *ag;
        int pattern;
 
        struct analog_gen *ag;
        int pattern;
 
@@ -406,11 +406,11 @@ static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi,
        case SR_CONF_PATTERN_MODE:
                if (!cg)
                        return SR_ERR_CHANNEL_GROUP;
        case SR_CONF_PATTERN_MODE:
                if (!cg)
                        return SR_ERR_CHANNEL_GROUP;
-               probe = cg->channels->data;
-               if (probe->type == SR_PROBE_LOGIC) {
+               ch = cg->channels->data;
+               if (ch->type == SR_PROBE_LOGIC) {
                        pattern = devc->logic_pattern;
                        *data = g_variant_new_string(logic_pattern_str[pattern]);
                        pattern = devc->logic_pattern;
                        *data = g_variant_new_string(logic_pattern_str[pattern]);
-               } else if (probe->type == SR_PROBE_ANALOG) {
+               } else if (ch->type == SR_PROBE_ANALOG) {
                        ag = cg->priv;
                        pattern = ag->pattern;
                        *data = g_variant_new_string(analog_pattern_str[pattern]);
                        ag = cg->priv;
                        pattern = ag->pattern;
                        *data = g_variant_new_string(analog_pattern_str[pattern]);
@@ -418,10 +418,10 @@ static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi,
                        return SR_ERR_BUG;
                break;
        case SR_CONF_NUM_LOGIC_PROBES:
                        return SR_ERR_BUG;
                break;
        case SR_CONF_NUM_LOGIC_PROBES:
-               *data = g_variant_new_int32(devc->num_logic_probes);
+               *data = g_variant_new_int32(devc->num_logic_channels);
                break;
        case SR_CONF_NUM_ANALOG_PROBES:
                break;
        case SR_CONF_NUM_ANALOG_PROBES:
-               *data = g_variant_new_int32(devc->num_analog_probes);
+               *data = g_variant_new_int32(devc->num_analog_channels);
                break;
        default:
                return SR_ERR_NA;
                break;
        default:
                return SR_ERR_NA;
@@ -435,7 +435,7 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
 {
        struct dev_context *devc;
        struct analog_gen *ag;
 {
        struct dev_context *devc;
        struct analog_gen *ag;
-       struct sr_channel *probe;
+       struct sr_channel *ch;
        int pattern, ret;
        unsigned int i;
        const char *stropt;
        int pattern, ret;
        unsigned int i;
        const char *stropt;
@@ -465,9 +465,9 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
                if (!cg)
                        return SR_ERR_CHANNEL_GROUP;
                stropt = g_variant_get_string(data, NULL);
                if (!cg)
                        return SR_ERR_CHANNEL_GROUP;
                stropt = g_variant_get_string(data, NULL);
-               probe = cg->channels->data;
+               ch = cg->channels->data;
                pattern = -1;
                pattern = -1;
-               if (probe->type == SR_PROBE_LOGIC) {
+               if (ch->type == SR_PROBE_LOGIC) {
                        for (i = 0; i < ARRAY_SIZE(logic_pattern_str); i++) {
                                if (!strcmp(stropt, logic_pattern_str[i])) {
                                        pattern = i;
                        for (i = 0; i < ARRAY_SIZE(logic_pattern_str); i++) {
                                if (!strcmp(stropt, logic_pattern_str[i])) {
                                        pattern = i;
@@ -485,7 +485,7 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
                                memset(devc->logic_data, 0xff, LOGIC_BUFSIZE);
                        sr_dbg("Setting logic pattern to %s",
                                        logic_pattern_str[pattern]);
                                memset(devc->logic_data, 0xff, LOGIC_BUFSIZE);
                        sr_dbg("Setting logic pattern to %s",
                                        logic_pattern_str[pattern]);
-               } else if (probe->type == SR_PROBE_ANALOG) {
+               } else if (ch->type == SR_PROBE_ANALOG) {
                        for (i = 0; i < ARRAY_SIZE(analog_pattern_str); i++) {
                                if (!strcmp(stropt, analog_pattern_str[i])) {
                                        pattern = i;
                        for (i = 0; i < ARRAY_SIZE(analog_pattern_str); i++) {
                                if (!strcmp(stropt, analog_pattern_str[i])) {
                                        pattern = i;
@@ -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_channel_group *cg)
 {
 static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
                const struct sr_channel_group *cg)
 {
-       struct sr_channel *probe;
+       struct sr_channel *ch;
        GVariant *gvar;
        GVariantBuilder gvb;
 
        GVariant *gvar;
        GVariantBuilder gvb;
 
@@ -543,17 +543,17 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
                        return SR_ERR_NA;
                }
        } else {
                        return SR_ERR_NA;
                }
        } else {
-               probe = cg->channels->data;
+               ch = cg->channels->data;
                switch (key) {
                case SR_CONF_DEVICE_OPTIONS:
                        *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
                                        devopts_cg, ARRAY_SIZE(devopts_cg), sizeof(int32_t));
                        break;
                case SR_CONF_PATTERN_MODE:
                switch (key) {
                case SR_CONF_DEVICE_OPTIONS:
                        *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
                                        devopts_cg, ARRAY_SIZE(devopts_cg), sizeof(int32_t));
                        break;
                case SR_CONF_PATTERN_MODE:
-                       if (probe->type == SR_PROBE_LOGIC)
+                       if (ch->type == SR_PROBE_LOGIC)
                                *data = g_variant_new_strv(logic_pattern_str,
                                                ARRAY_SIZE(logic_pattern_str));
                                *data = g_variant_new_strv(logic_pattern_str,
                                                ARRAY_SIZE(logic_pattern_str));
-                       else if (probe->type == SR_PROBE_ANALOG)
+                       else if (ch->type == SR_PROBE_ANALOG)
                                *data = g_variant_new_strv(analog_pattern_str,
                                                ARRAY_SIZE(analog_pattern_str));
                        else
                                *data = g_variant_new_strv(analog_pattern_str,
                                                ARRAY_SIZE(analog_pattern_str));
                        else
@@ -638,7 +638,7 @@ static int prepare_data(int fd, int revents, void *cb_data)
 
        while (logic_todo || analog_todo) {
                /* Logic */
 
        while (logic_todo || analog_todo) {
                /* Logic */
-               if (devc->num_logic_probes > 0 && logic_todo > 0) {
+               if (devc->num_logic_channels > 0 && logic_todo > 0) {
                        sending_now = MIN(logic_todo,
                                        LOGIC_BUFSIZE / devc->logic_unitsize);
                        logic_generator(sdi, sending_now * devc->logic_unitsize);
                        sending_now = MIN(logic_todo,
                                        LOGIC_BUFSIZE / devc->logic_unitsize);
                        logic_generator(sdi, sending_now * devc->logic_unitsize);
@@ -652,8 +652,8 @@ static int prepare_data(int fd, int revents, void *cb_data)
                        devc->logic_counter += sending_now;
                }
 
                        devc->logic_counter += sending_now;
                }
 
-               /* Analog, one probe at a time */
-               if (devc->num_analog_probes > 0 && analog_todo > 0) {
+               /* Analog, one channel at a time */
+               if (devc->num_analog_channels > 0 && analog_todo > 0) {
                        sending_now = 0;
                        for (l = devc->analog_channel_groups; l; l = l->next) {
                                cg = l->data;
                        sending_now = 0;
                        for (l = devc->analog_channel_groups; l; l = l->next) {
                                cg = l->data;
index 5a5323e5684388d2511282e452539d4b41ff5bbb..83aaad4c17381e9c734e5a5f707476a8748ebbb2 100644 (file)
@@ -69,7 +69,7 @@ static GSList *fluke_scan(const char *conn, const char *serialcomm)
        struct sr_dev_inst *sdi;
        struct drv_context *drvc;
        struct dev_context *devc;
        struct sr_dev_inst *sdi;
        struct drv_context *drvc;
        struct dev_context *devc;
-       struct sr_channel *probe;
+       struct sr_channel *ch;
        struct sr_serial_dev_inst *serial;
        GSList *devices;
        int retry, len, i, s;
        struct sr_serial_dev_inst *serial;
        GSList *devices;
        int retry, len, i, s;
@@ -135,9 +135,9 @@ static GSList *fluke_scan(const char *conn, const char *serialcomm)
                                sdi->conn = serial;
                                sdi->priv = devc;
                                sdi->driver = di;
                                sdi->conn = serial;
                                sdi->priv = devc;
                                sdi->driver = di;
-                               if (!(probe = sr_probe_new(0, SR_PROBE_ANALOG, TRUE, "P1")))
+                               if (!(ch = sr_probe_new(0, SR_PROBE_ANALOG, TRUE, "P1")))
                                        return NULL;
                                        return NULL;
-                               sdi->probes = g_slist_append(sdi->probes, probe);
+                               sdi->channels = g_slist_append(sdi->channels, ch);
                                drvc->instances = g_slist_append(drvc->instances, sdi);
                                devices = g_slist_append(devices, sdi);
                                break;
                                drvc->instances = g_slist_append(drvc->instances, sdi);
                                devices = g_slist_append(devices, sdi);
                                break;
index 493bcc157ea22a990fa21dd54432e8e018ca3229..edb6734adbd06166a1204cbd02012c16f77e060f 100644 (file)
@@ -63,7 +63,7 @@ static struct sr_datafeed_analog *handle_qm_18x(const struct sr_dev_inst *sdi,
                return NULL;
        if (!(analog->data = g_try_malloc(sizeof(float))))
                return NULL;
                return NULL;
        if (!(analog->data = g_try_malloc(sizeof(float))))
                return NULL;
-       analog->probes = sdi->probes;
+       analog->channels = sdi->channels;
        analog->num_samples = 1;
        if (is_oor)
                *analog->data = NAN;
        analog->num_samples = 1;
        if (is_oor)
                *analog->data = NAN;
@@ -174,7 +174,7 @@ static struct sr_datafeed_analog *handle_qm_28x(const struct sr_dev_inst *sdi,
                return NULL;
        if (!(analog->data = g_try_malloc(sizeof(float))))
                return NULL;
                return NULL;
        if (!(analog->data = g_try_malloc(sizeof(float))))
                return NULL;
-       analog->probes = sdi->probes;
+       analog->channels = sdi->channels;
        analog->num_samples = 1;
        *analog->data = fvalue;
        analog->mq = -1;
        analog->num_samples = 1;
        *analog->data = fvalue;
        analog->mq = -1;
@@ -396,7 +396,7 @@ static void handle_qm_19x_data(const struct sr_dev_inst *sdi, char **tokens)
                        fvalue = 1.0;
        }
 
                        fvalue = 1.0;
        }
 
-       analog.probes = sdi->probes;
+       analog.channels = sdi->channels;
        analog.num_samples = 1;
        analog.data = &fvalue;
        analog.mq = devc->mq;
        analog.num_samples = 1;
        analog.data = &fvalue;
        analog.mq = devc->mq;
index 7f35ea81574fe2909d6350dcb98f6ec535f45761..b11a2e1a93ea4fd47ef8f0adce761c14a0570d18 100644 (file)
@@ -87,7 +87,7 @@ static const int32_t hwcaps[] = {
        SR_CONF_CONTINUOUS,
 };
 
        SR_CONF_CONTINUOUS,
 };
 
-static const char *probe_names[] = {
+static const char *channel_names[] = {
        "0",  "1",  "2",  "3",  "4",  "5",  "6",  "7",
        "8",  "9", "10", "11", "12", "13", "14", "15",
        NULL,
        "0",  "1",  "2",  "3",  "4",  "5",  "6",  "7",
        "8",  "9", "10", "11", "12", "13", "14", "15",
        NULL,
@@ -126,13 +126,13 @@ static GSList *scan(GSList *options)
        struct dev_context *devc;
        struct sr_dev_inst *sdi;
        struct sr_usb_dev_inst *usb;
        struct dev_context *devc;
        struct sr_dev_inst *sdi;
        struct sr_usb_dev_inst *usb;
-       struct sr_channel *probe;
+       struct sr_channel *ch;
        struct sr_config *src;
        const struct fx2lafw_profile *prof;
        GSList *l, *devices, *conn_devices;
        struct libusb_device_descriptor des;
        libusb_device **devlist;
        struct sr_config *src;
        const struct fx2lafw_profile *prof;
        GSList *l, *devices, *conn_devices;
        struct libusb_device_descriptor des;
        libusb_device **devlist;
-       int devcnt, num_logic_probes, ret, i, j;
+       int devcnt, num_logic_channels, ret, i, j;
        const char *conn;
 
        drvc = di->priv;
        const char *conn;
 
        drvc = di->priv;
@@ -194,13 +194,13 @@ static GSList *scan(GSList *options)
                        return NULL;
                sdi->driver = di;
 
                        return NULL;
                sdi->driver = di;
 
-               /* Fill in probelist according to this device's profile. */
-               num_logic_probes = prof->dev_caps & DEV_CAPS_16BIT ? 16 : 8;
-               for (j = 0; j < num_logic_probes; j++) {
-                       if (!(probe = sr_probe_new(j, SR_PROBE_LOGIC, TRUE,
-                                       probe_names[j])))
+               /* Fill in channellist according to this device's profile. */
+               num_logic_channels = prof->dev_caps & DEV_CAPS_16BIT ? 16 : 8;
+               for (j = 0; j < num_logic_channels; j++) {
+                       if (!(ch = sr_probe_new(j, SR_PROBE_LOGIC, TRUE,
+                                       channel_names[j])))
                                return NULL;
                                return NULL;
-                       sdi->probes = g_slist_append(sdi->probes, probe);
+                       sdi->channels = g_slist_append(sdi->channels, ch);
                }
 
                devc = fx2lafw_dev_new();
                }
 
                devc = fx2lafw_dev_new();
@@ -477,8 +477,8 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi, void *cb_data)
        usb = sdi->conn;
 
        /* Configures devc->trigger_* and devc->sample_wide */
        usb = sdi->conn;
 
        /* Configures devc->trigger_* and devc->sample_wide */
-       if (fx2lafw_configure_probes(sdi) != SR_OK) {
-               sr_err("Failed to configure probes.");
+       if (fx2lafw_configure_channels(sdi) != SR_OK) {
+               sr_err("Failed to configure channels.");
                return SR_ERR;
        }
 
                return SR_ERR;
        }
 
index 60dd9e6914a05de7807f343f1664cbbc91fa97d3..f4f23e3775dda667d4086fd19b7f84d5f4558b6d 100644 (file)
@@ -292,12 +292,12 @@ SR_PRIV int fx2lafw_dev_open(struct sr_dev_inst *sdi, struct sr_dev_driver *di)
        return SR_OK;
 }
 
        return SR_OK;
 }
 
-SR_PRIV int fx2lafw_configure_probes(const struct sr_dev_inst *sdi)
+SR_PRIV int fx2lafw_configure_channels(const struct sr_dev_inst *sdi)
 {
        struct dev_context *devc;
 {
        struct dev_context *devc;
-       struct sr_channel *probe;
+       struct sr_channel *ch;
        GSList *l;
        GSList *l;
-       int probe_bit, stage, i;
+       int channel_bit, stage, i;
        char *tc;
 
        devc = sdi->priv;
        char *tc;
 
        devc = sdi->priv;
@@ -307,23 +307,23 @@ SR_PRIV int fx2lafw_configure_probes(const struct sr_dev_inst *sdi)
        }
 
        stage = -1;
        }
 
        stage = -1;
-       for (l = sdi->probes; l; l = l->next) {
-               probe = (struct sr_channel *)l->data;
-               if (probe->enabled == FALSE)
+       for (l = sdi->channels; l; l = l->next) {
+               ch = (struct sr_channel *)l->data;
+               if (ch->enabled == FALSE)
                        continue;
 
                        continue;
 
-               if (probe->index > 7)
+               if (ch->index > 7)
                        devc->sample_wide = TRUE;
 
                        devc->sample_wide = TRUE;
 
-               probe_bit = 1 << (probe->index);
-               if (!(probe->trigger))
+               channel_bit = 1 << (ch->index);
+               if (!(ch->trigger))
                        continue;
 
                stage = 0;
                        continue;
 
                stage = 0;
-               for (tc = probe->trigger; *tc; tc++) {
-                       devc->trigger_mask[stage] |= probe_bit;
+               for (tc = ch->trigger; *tc; tc++) {
+                       devc->trigger_mask[stage] |= channel_bit;
                        if (*tc == '1')
                        if (*tc == '1')
-                               devc->trigger_value[stage] |= probe_bit;
+                               devc->trigger_value[stage] |= channel_bit;
                        stage++;
                        if (stage > NUM_TRIGGER_STAGES)
                                return SR_ERR;
                        stage++;
                        if (stage > NUM_TRIGGER_STAGES)
                                return SR_ERR;
index c23db39aadecebb85c02dfe146bb581812dfa598..25a8c56a29e42e6d1e0dc5fd77de353a7752962e 100644 (file)
@@ -103,7 +103,7 @@ SR_PRIV int fx2lafw_command_start_acquisition(libusb_device_handle *devhdl,
                uint64_t samplerate, gboolean samplewide);
 SR_PRIV gboolean fx2lafw_check_conf_profile(libusb_device *dev);
 SR_PRIV int fx2lafw_dev_open(struct sr_dev_inst *sdi, struct sr_dev_driver *di);
                uint64_t samplerate, gboolean samplewide);
 SR_PRIV gboolean fx2lafw_check_conf_profile(libusb_device *dev);
 SR_PRIV int fx2lafw_dev_open(struct sr_dev_inst *sdi, struct sr_dev_driver *di);
-SR_PRIV int fx2lafw_configure_probes(const struct sr_dev_inst *sdi);
+SR_PRIV int fx2lafw_configure_channels(const struct sr_dev_inst *sdi);
 SR_PRIV struct dev_context *fx2lafw_dev_new(void);
 SR_PRIV void fx2lafw_abort_acquisition(struct dev_context *devc);
 SR_PRIV void fx2lafw_receive_transfer(struct libusb_transfer *transfer);
 SR_PRIV struct dev_context *fx2lafw_dev_new(void);
 SR_PRIV void fx2lafw_abort_acquisition(struct dev_context *devc);
 SR_PRIV void fx2lafw_receive_transfer(struct libusb_transfer *transfer);
index ce849765a0fd1b61f89177d794f34c20c3feea05..98d200e7c8940dddc350803a59844a65ce2a5fc9 100644 (file)
@@ -162,7 +162,7 @@ static GSList *scan_1x_2x_rs232(GSList *options)
        struct drv_context *drvc;
        struct dev_context *devc;
        struct sr_config *src;
        struct drv_context *drvc;
        struct dev_context *devc;
        struct sr_config *src;
-       struct sr_channel *probe;
+       struct sr_channel *ch;
        struct sr_serial_dev_inst *serial;
        GSList *l, *devices;
        const char *conn, *serialcomm;
        struct sr_serial_dev_inst *serial;
        GSList *l, *devices;
        const char *conn, *serialcomm;
@@ -240,9 +240,9 @@ static GSList *scan_1x_2x_rs232(GSList *options)
                sdi->conn = serial;
                sdi->priv = devc;
                sdi->driver = &gmc_mh_1x_2x_rs232_driver_info;
                sdi->conn = serial;
                sdi->priv = devc;
                sdi->driver = &gmc_mh_1x_2x_rs232_driver_info;
-               if (!(probe = sr_probe_new(0, SR_PROBE_ANALOG, TRUE, "P1")))
+               if (!(ch = sr_probe_new(0, SR_PROBE_ANALOG, TRUE, "P1")))
                        return NULL;
                        return NULL;
-               sdi->probes = g_slist_append(sdi->probes, probe);
+               sdi->channels = g_slist_append(sdi->channels, ch);
                drvc->instances = g_slist_append(drvc->instances, sdi);
                devices = g_slist_append(devices, sdi);
        }
                drvc->instances = g_slist_append(drvc->instances, sdi);
                devices = g_slist_append(devices, sdi);
        }
@@ -259,7 +259,7 @@ static GSList *scan_2x_bd232(GSList *options)
        struct drv_context *drvc;
        struct dev_context *devc;
        struct sr_config *src;
        struct drv_context *drvc;
        struct dev_context *devc;
        struct sr_config *src;
-       struct sr_channel *probe;
+       struct sr_channel *ch;
        struct sr_serial_dev_inst *serial;
        GSList *l, *devices;
        const char *conn, *serialcomm;
        struct sr_serial_dev_inst *serial;
        GSList *l, *devices;
        const char *conn, *serialcomm;
@@ -343,9 +343,9 @@ static GSList *scan_2x_bd232(GSList *options)
                        sdi->conn = serial;
                        sdi->priv = devc;
                        sdi->driver = &gmc_mh_2x_bd232_driver_info;
                        sdi->conn = serial;
                        sdi->priv = devc;
                        sdi->driver = &gmc_mh_2x_bd232_driver_info;
-                       if (!(probe = sr_probe_new(0, SR_PROBE_ANALOG, TRUE, "P1")))
+                       if (!(ch = sr_probe_new(0, SR_PROBE_ANALOG, TRUE, "P1")))
                                goto exit_err;
                                goto exit_err;
-                       sdi->probes = g_slist_append(sdi->probes, probe);
+                       sdi->channels = g_slist_append(sdi->channels, ch);
                        drvc->instances = g_slist_append(drvc->instances, sdi);
                        devices = g_slist_append(devices, sdi);
 
                        drvc->instances = g_slist_append(drvc->instances, sdi);
                        devices = g_slist_append(devices, sdi);
 
index 85228ab5c55da09d1b9b33e2e9d6469b3ff29937..fc086a7d93a306c073667bcb76845ff30ac00957 100644 (file)
@@ -648,7 +648,7 @@ static void send_value(struct sr_dev_inst *sdi)
        devc = sdi->priv;
 
        memset(&analog, 0, sizeof(analog));
        devc = sdi->priv;
 
        memset(&analog, 0, sizeof(analog));
-       analog.probes = sdi->probes;
+       analog.channels = sdi->channels;
        analog.num_samples = 1;
        analog.mq = devc->mq;
        analog.unit = devc->unit;
        analog.num_samples = 1;
        analog.mq = devc->mq;
        analog.unit = devc->unit;
index 2988823b5a7f5a3691e881bcfefc6b7d079330f2..bfc0f62aa6e5b68c4f766d2213308fa95980ce5e 100644 (file)
@@ -565,53 +565,53 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
 SR_PRIV int hmo_request_data(const struct sr_dev_inst *sdi)
 {
        char command[MAX_COMMAND_SIZE];
 SR_PRIV int hmo_request_data(const struct sr_dev_inst *sdi)
 {
        char command[MAX_COMMAND_SIZE];
-       struct sr_channel *probe;
+       struct sr_channel *ch;
        struct dev_context *devc;
        struct scope_config *model;
 
        devc = sdi->priv;
        model = devc->model_config;
 
        struct dev_context *devc;
        struct scope_config *model;
 
        devc = sdi->priv;
        model = devc->model_config;
 
-       probe = devc->current_probe->data;
+       ch = devc->current_channel->data;
 
 
-       switch (probe->type) {
+       switch (ch->type) {
        case SR_PROBE_ANALOG:
                g_snprintf(command, sizeof(command),
                           (*model->scpi_dialect)[SCPI_CMD_GET_ANALOG_DATA],
        case SR_PROBE_ANALOG:
                g_snprintf(command, sizeof(command),
                           (*model->scpi_dialect)[SCPI_CMD_GET_ANALOG_DATA],
-                          probe->index + 1);
+                          ch->index + 1);
                break;
        case SR_PROBE_LOGIC:
                g_snprintf(command, sizeof(command),
                           (*model->scpi_dialect)[SCPI_CMD_GET_DIG_DATA],
                break;
        case SR_PROBE_LOGIC:
                g_snprintf(command, sizeof(command),
                           (*model->scpi_dialect)[SCPI_CMD_GET_DIG_DATA],
-                          probe->index < 8 ? 1 : 2);
+                          ch->index < 8 ? 1 : 2);
                break;
        default:
                break;
        default:
-               sr_err("Invalid probe type.");
+               sr_err("Invalid channel type.");
                break;
        }
 
        return sr_scpi_send(sdi->conn, command);
 }
 
                break;
        }
 
        return sr_scpi_send(sdi->conn, command);
 }
 
-static int hmo_check_probes(GSList *probes)
+static int hmo_check_channels(GSList *channels)
 {
        GSList *l;
 {
        GSList *l;
-       struct sr_channel *probe;
+       struct sr_channel *ch;
        gboolean enabled_pod1, enabled_pod2, enabled_chan3, enabled_chan4;
 
        enabled_pod1 = enabled_pod2 = enabled_chan3 = enabled_chan4 = FALSE;
 
        gboolean enabled_pod1, enabled_pod2, enabled_chan3, enabled_chan4;
 
        enabled_pod1 = enabled_pod2 = enabled_chan3 = enabled_chan4 = FALSE;
 
-       for (l = probes; l; l = l->next) {
-               probe = l->data;
-               switch (probe->type) {
+       for (l = channels; l; l = l->next) {
+               ch = l->data;
+               switch (ch->type) {
                case SR_PROBE_ANALOG:
                case SR_PROBE_ANALOG:
-                       if (probe->index == 2)
+                       if (ch->index == 2)
                                enabled_chan3 = TRUE;
                                enabled_chan3 = TRUE;
-                       else if (probe->index == 3)
+                       else if (ch->index == 3)
                                enabled_chan4 = TRUE;
                        break;
                case SR_PROBE_LOGIC:
                                enabled_chan4 = TRUE;
                        break;
                case SR_PROBE_LOGIC:
-                       if (probe->index < 8)
+                       if (ch->index < 8)
                                enabled_pod1 = TRUE;
                        else
                                enabled_pod2 = TRUE;
                                enabled_pod1 = TRUE;
                        else
                                enabled_pod2 = TRUE;
@@ -628,7 +628,7 @@ static int hmo_check_probes(GSList *probes)
        return SR_OK;
 }
 
        return SR_OK;
 }
 
-static int hmo_setup_probes(const struct sr_dev_inst *sdi)
+static int hmo_setup_channels(const struct sr_dev_inst *sdi)
 {
        GSList *l;
        unsigned int i;
 {
        GSList *l;
        unsigned int i;
@@ -636,7 +636,7 @@ static int hmo_setup_probes(const struct sr_dev_inst *sdi)
        char command[MAX_COMMAND_SIZE];
        struct scope_state *state;
        struct scope_config *model;
        char command[MAX_COMMAND_SIZE];
        struct scope_state *state;
        struct scope_config *model;
-       struct sr_channel *probe;
+       struct sr_channel *ch;
        struct dev_context *devc;
        struct sr_scpi_dev_inst *scpi;
 
        struct dev_context *devc;
        struct sr_scpi_dev_inst *scpi;
 
@@ -648,39 +648,39 @@ static int hmo_setup_probes(const struct sr_dev_inst *sdi)
 
        pod_enabled = g_try_malloc0(sizeof(gboolean) * model->digital_pods);
 
 
        pod_enabled = g_try_malloc0(sizeof(gboolean) * model->digital_pods);
 
-       for (l = sdi->probes; l; l = l->next) {
-               probe = l->data;
-               switch (probe->type) {
+       for (l = sdi->channels; l; l = l->next) {
+               ch = l->data;
+               switch (ch->type) {
                case SR_PROBE_ANALOG:
                case SR_PROBE_ANALOG:
-                       if (probe->enabled == state->analog_channels[probe->index].state)
+                       if (ch->enabled == state->analog_channels[ch->index].state)
                                break;
                        g_snprintf(command, sizeof(command),
                                   (*model->scpi_dialect)[SCPI_CMD_SET_ANALOG_CHAN_STATE],
                                break;
                        g_snprintf(command, sizeof(command),
                                   (*model->scpi_dialect)[SCPI_CMD_SET_ANALOG_CHAN_STATE],
-                                  probe->index + 1, probe->enabled);
+                                  ch->index + 1, ch->enabled);
 
                        if (sr_scpi_send(scpi, command) != SR_OK)
                                return SR_ERR;
 
                        if (sr_scpi_send(scpi, command) != SR_OK)
                                return SR_ERR;
-                       state->analog_channels[probe->index].state = probe->enabled;
+                       state->analog_channels[ch->index].state = ch->enabled;
                        setup_changed = TRUE;
                        break;
                case SR_PROBE_LOGIC:
                        /*
                         * A digital POD needs to be enabled for every group of
                        setup_changed = TRUE;
                        break;
                case SR_PROBE_LOGIC:
                        /*
                         * A digital POD needs to be enabled for every group of
-                        * 8 probes.
+                        * 8 channels.
                         */
                         */
-                       if (probe->enabled)
-                               pod_enabled[probe->index < 8 ? 0 : 1] = TRUE;
+                       if (ch->enabled)
+                               pod_enabled[ch->index < 8 ? 0 : 1] = TRUE;
 
 
-                       if (probe->enabled == state->digital_channels[probe->index])
+                       if (ch->enabled == state->digital_channels[ch->index])
                                break;
                        g_snprintf(command, sizeof(command),
                                   (*model->scpi_dialect)[SCPI_CMD_SET_DIG_CHAN_STATE],
                                break;
                        g_snprintf(command, sizeof(command),
                                   (*model->scpi_dialect)[SCPI_CMD_SET_DIG_CHAN_STATE],
-                                  probe->index, probe->enabled);
+                                  ch->index, ch->enabled);
 
                        if (sr_scpi_send(scpi, command) != SR_OK)
                                return SR_ERR;
 
 
                        if (sr_scpi_send(scpi, command) != SR_OK)
                                return SR_ERR;
 
-                       state->digital_channels[probe->index] = probe->enabled;
+                       state->digital_channels[ch->index] = ch->enabled;
                        setup_changed = TRUE;
                        break;
                default:
                        setup_changed = TRUE;
                        break;
                default:
@@ -712,7 +712,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi, void *cb_data)
 {
        GSList *l;
        gboolean digital_added;
 {
        GSList *l;
        gboolean digital_added;
-       struct sr_channel *probe;
+       struct sr_channel *ch;
        struct dev_context *devc;
        struct sr_scpi_dev_inst *scpi;
 
        struct dev_context *devc;
        struct sr_scpi_dev_inst *scpi;
 
@@ -723,29 +723,29 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi, void *cb_data)
        devc = sdi->priv;
        digital_added = FALSE;
 
        devc = sdi->priv;
        digital_added = FALSE;
 
-       for (l = sdi->probes; l; l = l->next) {
-               probe = l->data;
-               if (!probe->enabled)
+       for (l = sdi->channels; l; l = l->next) {
+               ch = l->data;
+               if (!ch->enabled)
                        continue;
                        continue;
-               /* Only add a single digital probe. */
-               if (probe->type != SR_PROBE_LOGIC || !digital_added) {
-                       devc->enabled_probes = g_slist_append(
-                                       devc->enabled_probes, probe);
-                       if (probe->type == SR_PROBE_LOGIC)
+               /* Only add a single digital channel. */
+               if (ch->type != SR_PROBE_LOGIC || !digital_added) {
+                       devc->enabled_channels = g_slist_append(
+                                       devc->enabled_channels, ch);
+                       if (ch->type == SR_PROBE_LOGIC)
                                digital_added = TRUE;
                }
        }
 
                                digital_added = TRUE;
                }
        }
 
-       if (!devc->enabled_probes)
+       if (!devc->enabled_channels)
                return SR_ERR;
 
                return SR_ERR;
 
-       if (hmo_check_probes(devc->enabled_probes) != SR_OK) {
-               sr_err("Invalid probe configuration specified!");
+       if (hmo_check_channels(devc->enabled_channels) != SR_OK) {
+               sr_err("Invalid channel configuration specified!");
                return SR_ERR_NA;
        }
 
                return SR_ERR_NA;
        }
 
-       if (hmo_setup_probes(sdi) != SR_OK) {
-               sr_err("Failed to setup probe configuration!");
+       if (hmo_setup_channels(sdi) != SR_OK) {
+               sr_err("Failed to setup channel configuration!");
                return SR_ERR;
        }
 
                return SR_ERR;
        }
 
@@ -754,7 +754,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi, void *cb_data)
        /* Send header packet to the session bus. */
        std_session_send_df_header(cb_data, LOG_PREFIX);
 
        /* Send header packet to the session bus. */
        std_session_send_df_header(cb_data, LOG_PREFIX);
 
-       devc->current_probe = devc->enabled_probes;
+       devc->current_channel = devc->enabled_channels;
 
        return hmo_request_data(sdi);
 }
 
        return hmo_request_data(sdi);
 }
@@ -777,8 +777,8 @@ static int dev_acquisition_stop(struct sr_dev_inst *sdi, void *cb_data)
        devc = sdi->priv;
 
        devc->num_frames = 0;
        devc = sdi->priv;
 
        devc->num_frames = 0;
-       g_slist_free(devc->enabled_probes);
-       devc->enabled_probes = NULL;
+       g_slist_free(devc->enabled_channels);
+       devc->enabled_channels = NULL;
        scpi = sdi->conn;
        sr_scpi_source_remove(scpi);
 
        scpi = sdi->conn;
        sr_scpi_source_remove(scpi);
 
index c364d2245574aedd49cf1eb766ea32d156dfca1a..eedaf7975b139d8c41e59c403c3f855a4c78c376 100644 (file)
@@ -168,14 +168,14 @@ static const uint64_t hmo_vdivs[][2] = {
        { 10, 1 },
 };
 
        { 10, 1 },
 };
 
-static const char *scope_analog_probe_names[] = {
+static const char *scope_analog_channel_names[] = {
        "CH1",
        "CH2",
        "CH3",
        "CH4",
 };
 
        "CH1",
        "CH2",
        "CH3",
        "CH4",
 };
 
-static const char *scope_digital_probe_names[] = {
+static const char *scope_digital_channel_names[] = {
        "D0",
        "D1",
        "D2",
        "D0",
        "D1",
        "D2",
@@ -201,8 +201,8 @@ static struct scope_config scope_models[] = {
                .digital_channels = 8,
                .digital_pods = 1,
 
                .digital_channels = 8,
                .digital_pods = 1,
 
-               .analog_names = &scope_analog_probe_names,
-               .digital_names = &scope_digital_probe_names,
+               .analog_names = &scope_analog_channel_names,
+               .digital_names = &scope_digital_channel_names,
 
                .hw_caps = &hmo_hwcaps,
                .num_hwcaps = ARRAY_SIZE(hmo_hwcaps),
 
                .hw_caps = &hmo_hwcaps,
                .num_hwcaps = ARRAY_SIZE(hmo_hwcaps),
@@ -231,8 +231,8 @@ static struct scope_config scope_models[] = {
                .digital_channels = 8,
                .digital_pods = 1,
 
                .digital_channels = 8,
                .digital_pods = 1,
 
-               .analog_names = &scope_analog_probe_names,
-               .digital_names = &scope_digital_probe_names,
+               .analog_names = &scope_analog_channel_names,
+               .digital_names = &scope_digital_channel_names,
 
                .hw_caps = &hmo_hwcaps,
                .num_hwcaps = ARRAY_SIZE(hmo_hwcaps),
 
                .hw_caps = &hmo_hwcaps,
                .num_hwcaps = ARRAY_SIZE(hmo_hwcaps),
@@ -581,7 +581,7 @@ SR_PRIV int hmo_init_device(struct sr_dev_inst *sdi)
        char tmp[25];
        int model_index;
        unsigned int i, j;
        char tmp[25];
        int model_index;
        unsigned int i, j;
-       struct sr_channel *probe;
+       struct sr_channel *ch;
        struct dev_context *devc;
 
        devc = sdi->priv;
        struct dev_context *devc;
 
        devc = sdi->priv;
@@ -614,14 +614,14 @@ SR_PRIV int hmo_init_device(struct sr_dev_inst *sdi)
 
        /* Add analog channels. */
        for (i = 0; i < scope_models[model_index].analog_channels; i++) {
 
        /* Add analog channels. */
        for (i = 0; i < scope_models[model_index].analog_channels; i++) {
-               if (!(probe = sr_probe_new(i, SR_PROBE_ANALOG, TRUE,
+               if (!(ch = sr_probe_new(i, SR_PROBE_ANALOG, TRUE,
                           (*scope_models[model_index].analog_names)[i])))
                        return SR_ERR_MALLOC;
                           (*scope_models[model_index].analog_names)[i])))
                        return SR_ERR_MALLOC;
-               sdi->probes = g_slist_append(sdi->probes, probe);
+               sdi->channels = g_slist_append(sdi->channels, ch);
 
                devc->analog_groups[i].name =
                        (char *)(*scope_models[model_index].analog_names)[i];
 
                devc->analog_groups[i].name =
                        (char *)(*scope_models[model_index].analog_names)[i];
-               devc->analog_groups[i].channels = g_slist_append(NULL, probe);
+               devc->analog_groups[i].channels = g_slist_append(NULL, ch);
 
                sdi->channel_groups = g_slist_append(sdi->channel_groups,
                                                   &devc->analog_groups[i]);
 
                sdi->channel_groups = g_slist_append(sdi->channel_groups,
                                                   &devc->analog_groups[i]);
@@ -637,13 +637,13 @@ SR_PRIV int hmo_init_device(struct sr_dev_inst *sdi)
 
        /* Add digital channels. */
        for (i = 0; i < scope_models[model_index].digital_channels; i++) {
 
        /* Add digital channels. */
        for (i = 0; i < scope_models[model_index].digital_channels; i++) {
-               if (!(probe = sr_probe_new(i, SR_PROBE_LOGIC, TRUE,
+               if (!(ch = sr_probe_new(i, SR_PROBE_LOGIC, TRUE,
                           (*scope_models[model_index].digital_names)[i])))
                        return SR_ERR_MALLOC;
                           (*scope_models[model_index].digital_names)[i])))
                        return SR_ERR_MALLOC;
-               sdi->probes = g_slist_append(sdi->probes, probe);
+               sdi->channels = g_slist_append(sdi->channels, ch);
 
                devc->digital_groups[i < 8 ? 0 : 1].channels = g_slist_append(
 
                devc->digital_groups[i < 8 ? 0 : 1].channels = g_slist_append(
-                       devc->digital_groups[i < 8 ? 0 : 1].channels, probe);
+                       devc->digital_groups[i < 8 ? 0 : 1].channels, ch);
        }
 
        devc->model_config = &scope_models[model_index];
        }
 
        devc->model_config = &scope_models[model_index];
@@ -657,7 +657,7 @@ SR_PRIV int hmo_init_device(struct sr_dev_inst *sdi)
 
 SR_PRIV int hmo_receive_data(int fd, int revents, void *cb_data)
 {
 
 SR_PRIV int hmo_receive_data(int fd, int revents, void *cb_data)
 {
-       struct sr_channel *probe;
+       struct sr_channel *ch;
        struct sr_dev_inst *sdi;
        struct dev_context *devc;
        struct sr_datafeed_packet packet;
        struct sr_dev_inst *sdi;
        struct dev_context *devc;
        struct sr_datafeed_packet packet;
@@ -674,9 +674,9 @@ SR_PRIV int hmo_receive_data(int fd, int revents, void *cb_data)
                return TRUE;
 
        if (revents == G_IO_IN) {
                return TRUE;
 
        if (revents == G_IO_IN) {
-               probe = devc->current_probe->data;
+               ch = devc->current_channel->data;
 
 
-               switch (probe->type) {
+               switch (ch->type) {
                case SR_PROBE_ANALOG:
                        if (sr_scpi_get_floatv(sdi->conn, NULL, &data) != SR_OK) {
                                if (data)
                case SR_PROBE_ANALOG:
                        if (sr_scpi_get_floatv(sdi->conn, NULL, &data) != SR_OK) {
                                if (data)
@@ -688,7 +688,7 @@ SR_PRIV int hmo_receive_data(int fd, int revents, void *cb_data)
                        packet.type = SR_DF_FRAME_BEGIN;
                        sr_session_send(sdi, &packet);
 
                        packet.type = SR_DF_FRAME_BEGIN;
                        sr_session_send(sdi, &packet);
 
-                       analog.probes = g_slist_append(NULL, probe);
+                       analog.channels = g_slist_append(NULL, ch);
                        analog.num_samples = data->len;
                        analog.data = (float *) data->data;
                        analog.mq = SR_MQ_VOLTAGE;
                        analog.num_samples = data->len;
                        analog.data = (float *) data->data;
                        analog.mq = SR_MQ_VOLTAGE;
@@ -697,7 +697,7 @@ SR_PRIV int hmo_receive_data(int fd, int revents, void *cb_data)
                        packet.type = SR_DF_ANALOG;
                        packet.payload = &analog;
                        sr_session_send(cb_data, &packet);
                        packet.type = SR_DF_ANALOG;
                        packet.payload = &analog;
                        sr_session_send(cb_data, &packet);
-                       g_slist_free(analog.probes);
+                       g_slist_free(analog.channels);
                        g_array_free(data, TRUE);
                        break;
                case SR_PROBE_LOGIC:
                        g_array_free(data, TRUE);
                        break;
                case SR_PROBE_LOGIC:
@@ -719,20 +719,20 @@ SR_PRIV int hmo_receive_data(int fd, int revents, void *cb_data)
                        g_array_free(data, TRUE);
                        break;
                default:
                        g_array_free(data, TRUE);
                        break;
                default:
-                       sr_err("Invalid probe type.");
+                       sr_err("Invalid channel type.");
                        break;
                }
 
                packet.type = SR_DF_FRAME_END;
                sr_session_send(sdi, &packet);
 
                        break;
                }
 
                packet.type = SR_DF_FRAME_END;
                sr_session_send(sdi, &packet);
 
-               if (devc->current_probe->next) {
-                       devc->current_probe = devc->current_probe->next;
+               if (devc->current_channel->next) {
+                       devc->current_channel = devc->current_channel->next;
                        hmo_request_data(sdi);
                } else if (++devc->num_frames == devc->frame_limit) {
                        sdi->driver->dev_acquisition_stop(sdi, cb_data);
                } else {
                        hmo_request_data(sdi);
                } else if (++devc->num_frames == devc->frame_limit) {
                        sdi->driver->dev_acquisition_stop(sdi, cb_data);
                } else {
-                       devc->current_probe = devc->enabled_probes;
+                       devc->current_channel = devc->enabled_channels;
                        hmo_request_data(sdi);
                }
        }
                        hmo_request_data(sdi);
                }
        }
index 932eaa4ad0e246dbd147dcbc440b29b9b281052a..bdf70fc55ca3b6262162cb95f761e2436056c0f6 100644 (file)
@@ -96,8 +96,8 @@ struct dev_context {
        struct sr_channel_group *analog_groups;
        struct sr_channel_group *digital_groups;
 
        struct sr_channel_group *analog_groups;
        struct sr_channel_group *digital_groups;
 
-       GSList *enabled_probes;
-       GSList *current_probe;
+       GSList *enabled_channels;
+       GSList *current_channel;
        uint64_t num_frames;
 
        uint64_t frame_limit;
        uint64_t num_frames;
 
        uint64_t frame_limit;
index bb7529586f2ea7dd93f8c8e2840384140e4702a6..c4c1464ac98f1a7024c9d5bb81ef8927f08678a6 100644 (file)
@@ -60,7 +60,7 @@ static const int32_t devopts[] = {
        SR_CONF_NUM_VDIV,
 };
 
        SR_CONF_NUM_VDIV,
 };
 
-static const char *probe_names[] = {
+static const char *channel_names[] = {
        "CH1", "CH2",
        NULL,
 };
        "CH1", "CH2",
        NULL,
 };
@@ -160,7 +160,7 @@ static int dev_acquisition_stop(struct sr_dev_inst *sdi, void *cb_data);
 static struct sr_dev_inst *dso_dev_new(int index, const struct dso_profile *prof)
 {
        struct sr_dev_inst *sdi;
 static struct sr_dev_inst *dso_dev_new(int index, const struct dso_profile *prof)
 {
        struct sr_dev_inst *sdi;
-       struct sr_channel *probe;
+       struct sr_channel *ch;
        struct drv_context *drvc;
        struct dev_context *devc;
        int i;
        struct drv_context *drvc;
        struct dev_context *devc;
        int i;
@@ -172,14 +172,14 @@ static struct sr_dev_inst *dso_dev_new(int index, const struct dso_profile *prof
        sdi->driver = di;
 
        /*
        sdi->driver = di;
 
        /*
-        * Add only the real probes -- EXT isn't a source of data, only
+        * Add only the real channels -- EXT isn't a source of data, only
         * a trigger source internal to the device.
         */
         * a trigger source internal to the device.
         */
-       for (i = 0; probe_names[i]; i++) {
-               if (!(probe = sr_probe_new(i, SR_PROBE_ANALOG, TRUE,
-                               probe_names[i])))
+       for (i = 0; channel_names[i]; i++) {
+               if (!(ch = sr_probe_new(i, SR_PROBE_ANALOG, TRUE,
+                               channel_names[i])))
                        return NULL;
                        return NULL;
-               sdi->probes = g_slist_append(sdi->probes, probe);
+               sdi->channels = g_slist_append(sdi->channels, ch);
        }
 
        if (!(devc = g_try_malloc0(sizeof(struct dev_context)))) {
        }
 
        if (!(devc = g_try_malloc0(sizeof(struct dev_context)))) {
@@ -210,25 +210,25 @@ static struct sr_dev_inst *dso_dev_new(int index, const struct dso_profile *prof
        return sdi;
 }
 
        return sdi;
 }
 
-static int configure_probes(const struct sr_dev_inst *sdi)
+static int configure_channels(const struct sr_dev_inst *sdi)
 {
        struct dev_context *devc;
 {
        struct dev_context *devc;
-       struct sr_channel *probe;
+       struct sr_channel *ch;
        const GSList *l;
        int p;
 
        devc = sdi->priv;
 
        const GSList *l;
        int p;
 
        devc = sdi->priv;
 
-       g_slist_free(devc->enabled_probes);
+       g_slist_free(devc->enabled_channels);
        devc->ch1_enabled = devc->ch2_enabled = FALSE;
        devc->ch1_enabled = devc->ch2_enabled = FALSE;
-       for (l = sdi->probes, p = 0; l; l = l->next, p++) {
-               probe = l->data;
+       for (l = sdi->channels, p = 0; l; l = l->next, p++) {
+               ch = l->data;
                if (p == 0)
                if (p == 0)
-                       devc->ch1_enabled = probe->enabled;
+                       devc->ch1_enabled = ch->enabled;
                else
                else
-                       devc->ch2_enabled = probe->enabled;
-               if (probe->enabled)
-                       devc->enabled_probes = g_slist_append(devc->enabled_probes, probe);
+                       devc->ch2_enabled = ch->enabled;
+               if (ch->enabled)
+                       devc->enabled_channels = g_slist_append(devc->enabled_channels, ch);
        }
 
        return SR_OK;
        }
 
        return SR_OK;
@@ -240,7 +240,7 @@ static void clear_dev_context(void *priv)
 
        devc = priv;
        g_free(devc->triggersource);
 
        devc = priv;
        g_free(devc->triggersource);
-       g_slist_free(devc->enabled_probes);
+       g_slist_free(devc->enabled_channels);
 
 }
 
 
 }
 
@@ -657,19 +657,19 @@ static void send_chunk(struct sr_dev_inst *sdi, unsigned char *buf,
        struct sr_datafeed_analog analog;
        struct dev_context *devc;
        float ch1, ch2, range;
        struct sr_datafeed_analog analog;
        struct dev_context *devc;
        float ch1, ch2, range;
-       int num_probes, data_offset, i;
+       int num_channels, data_offset, i;
 
        devc = sdi->priv;
 
        devc = sdi->priv;
-       num_probes = (devc->ch1_enabled && devc->ch2_enabled) ? 2 : 1;
+       num_channels = (devc->ch1_enabled && devc->ch2_enabled) ? 2 : 1;
        packet.type = SR_DF_ANALOG;
        packet.payload = &analog;
        /* TODO: support for 5xxx series 9-bit samples */
        packet.type = SR_DF_ANALOG;
        packet.payload = &analog;
        /* TODO: support for 5xxx series 9-bit samples */
-       analog.probes = devc->enabled_probes;
+       analog.channels = devc->enabled_channels;
        analog.num_samples = num_samples;
        analog.mq = SR_MQ_VOLTAGE;
        analog.unit = SR_UNIT_VOLT;
        /* TODO: Check malloc return value. */
        analog.num_samples = num_samples;
        analog.mq = SR_MQ_VOLTAGE;
        analog.unit = SR_UNIT_VOLT;
        /* TODO: Check malloc return value. */
-       analog.data = g_try_malloc(analog.num_samples * sizeof(float) * num_probes);
+       analog.data = g_try_malloc(analog.num_samples * sizeof(float) * num_channels);
        data_offset = 0;
        for (i = 0; i < analog.num_samples; i++) {
                /*
        data_offset = 0;
        for (i = 0; i < analog.num_samples; i++) {
                /*
@@ -806,7 +806,7 @@ static int handle_event(int fd, int revents, void *cb_data)
        struct timeval tv;
        struct dev_context *devc;
        struct drv_context *drvc = di->priv;
        struct timeval tv;
        struct dev_context *devc;
        struct drv_context *drvc = di->priv;
-       int num_probes;
+       int num_channels;
        uint32_t trigger_offset;
        uint8_t capturestate;
 
        uint32_t trigger_offset;
        uint8_t capturestate;
 
@@ -876,9 +876,9 @@ static int handle_event(int fd, int revents, void *cb_data)
                /* Remember where in the captured frame the trigger is. */
                devc->trigger_offset = trigger_offset;
 
                /* Remember where in the captured frame the trigger is. */
                devc->trigger_offset = trigger_offset;
 
-               num_probes = (devc->ch1_enabled && devc->ch2_enabled) ? 2 : 1;
+               num_channels = (devc->ch1_enabled && devc->ch2_enabled) ? 2 : 1;
                /* TODO: Check malloc return value. */
                /* TODO: Check malloc return value. */
-               devc->framebuf = g_try_malloc(devc->framesize * num_probes * 2);
+               devc->framebuf = g_try_malloc(devc->framesize * num_channels * 2);
                devc->samp_buffered = devc->samp_received = 0;
 
                /* Tell the scope to send us the first frame. */
                devc->samp_buffered = devc->samp_received = 0;
 
                /* Tell the scope to send us the first frame. */
@@ -921,8 +921,8 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi, void *cb_data)
        devc = sdi->priv;
        devc->cb_data = cb_data;
 
        devc = sdi->priv;
        devc->cb_data = cb_data;
 
-       if (configure_probes(sdi) != SR_OK) {
-               sr_err("Failed to configure probes.");
+       if (configure_channels(sdi) != SR_OK) {
+               sr_err("Failed to configure channels.");
                return SR_ERR;
        }
 
                return SR_ERR;
        }
 
index 16826db2623c62e152c3f37ef231a8a2e9e8398b..edccb725cf3830bc873833e6e4856e3468392a59 100644 (file)
@@ -165,7 +165,7 @@ struct dev_context {
        void *cb_data;
        uint64_t limit_frames;
        uint64_t num_frames;
        void *cb_data;
        uint64_t limit_frames;
        uint64_t num_frames;
-       GSList *enabled_probes;
+       GSList *enabled_channels;
        /* We can't keep track of an FX2-based device after upgrading
         * the firmware (it re-enumerates into a different device address
         * after the upgrade) this is like a global lock. No device will open
        /* We can't keep track of an FX2-based device after upgrading
         * the firmware (it re-enumerates into a different device address
         * after the upgrade) this is like a global lock. No device will open
index b00f9adf3711d0a51e8b3e300410383a56cbc7e1..0443bc9f7908dbf46af8ec4299152da9eca35674 100644 (file)
@@ -41,7 +41,7 @@ SR_PRIV const uint64_t sl2_samplerates[NUM_SAMPLERATES] = {
        SR_MHZ(20),
 };
 
        SR_MHZ(20),
 };
 
-static const char *probe_names[NUM_PROBES + 1] = {
+static const char *channel_names[NUM_PROBES + 1] = {
        "0", "1", "2", "3",
        NULL,
 };
        "0", "1", "2", "3",
        NULL,
 };
@@ -59,7 +59,7 @@ static GSList *scan(GSList *options)
        GSList *usb_devices, *devices, *l;
        struct drv_context *drvc;
        struct sr_dev_inst *sdi;
        GSList *usb_devices, *devices, *l;
        struct drv_context *drvc;
        struct sr_dev_inst *sdi;
-       struct sr_channel *probe;
+       struct sr_channel *ch;
        struct dev_context *devc;
        struct sr_usb_dev_inst *usb;
        struct device_info dev_info;
        struct dev_context *devc;
        struct sr_usb_dev_inst *usb;
        struct device_info dev_info;
@@ -136,11 +136,11 @@ static GSList *scan(GSList *options)
                sdi->inst_type = SR_INST_USB;
                sdi->conn = usb;
 
                sdi->inst_type = SR_INST_USB;
                sdi->conn = usb;
 
-               for (i = 0; probe_names[i]; i++) {
-                       probe = sr_probe_new(i, SR_PROBE_LOGIC, TRUE,
-                               probe_names[i]);
-                       sdi->probes = g_slist_append(sdi->probes, probe);
-                       devc->probes[i] = probe;
+               for (i = 0; channel_names[i]; i++) {
+                       ch = sr_probe_new(i, SR_PROBE_LOGIC, TRUE,
+                               channel_names[i]);
+                       sdi->channels = g_slist_append(sdi->channels, ch);
+                       devc->channels[i] = ch;
                }
 
                devc->state = STATE_IDLE;
                }
 
                devc->state = STATE_IDLE;
@@ -443,21 +443,21 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi, void *cb_data)
        if (trigger_bytes % PACKET_NUM_SAMPLE_BYTES != 0)
                devc->num_sample_packets++;
 
        if (trigger_bytes % PACKET_NUM_SAMPLE_BYTES != 0)
                devc->num_sample_packets++;
 
-       devc->num_enabled_probes = 0;
+       devc->num_enabled_channels = 0;
 
        /*
 
        /*
-        * Count the number of enabled probes and number them for a sequential
+        * Count the number of enabled channels and number them for a sequential
         * access.
         */
        for (i = 0, j = 0; i < NUM_PROBES; i++) {
         * access.
         */
        for (i = 0, j = 0; i < NUM_PROBES; i++) {
-               if (devc->probes[i]->enabled) {
-                       devc->num_enabled_probes++;
-                       devc->probe_map[j] = i;
+               if (devc->channels[i]->enabled) {
+                       devc->num_enabled_channels++;
+                       devc->channel_map[j] = i;
                        j++;
                }
        }
 
                        j++;
                }
        }
 
-       sr_dbg("Number of enabled probes: %i.", devc->num_enabled_probes);
+       sr_dbg("Number of enabled channels: %i.", devc->num_enabled_channels);
 
        /* Set up the transfer buffer for the acquisition. */
        devc->xfer_data_out[0] = CMD_SAMPLE;
 
        /* Set up the transfer buffer for the acquisition. */
        devc->xfer_data_out[0] = CMD_SAMPLE;
index 475b6225b4c3290111e0041a7c724c08a4da1921..dd460d42d0f6fecab04455b880b214ac15ef9fd2 100644 (file)
@@ -65,7 +65,7 @@ static void buffer_sample_data(const struct sr_dev_inst *sdi)
 
        devc = sdi->priv;
 
 
        devc = sdi->priv;
 
-       if (devc->probes[devc->channel]->enabled) {
+       if (devc->channels[devc->channel]->enabled) {
                offset = devc->sample_packet * PACKET_NUM_SAMPLE_BYTES;
 
                /*
                offset = devc->sample_packet * PACKET_NUM_SAMPLE_BYTES;
 
                /*
@@ -101,8 +101,8 @@ static void process_sample_data(const struct sr_dev_inst *sdi)
         * enabled one for an uniform access to them. Note that the currently
         * received samples always belong to the last enabled channel.
         */
         * enabled one for an uniform access to them. Note that the currently
         * received samples always belong to the last enabled channel.
         */
-       for (i = 0; i < devc->num_enabled_probes - 1; i++)
-               ptr[i] = devc->sample_buffer[devc->probe_map[i]] + offset;
+       for (i = 0; i < devc->num_enabled_channels - 1; i++)
+               ptr[i] = devc->sample_buffer[devc->channel_map[i]] + offset;
 
        /*
         * Skip the first 4 bytes of the buffer because they contain channel
 
        /*
         * Skip the first 4 bytes of the buffer because they contain channel
@@ -156,9 +156,9 @@ static void process_sample_data(const struct sr_dev_inst *sdi)
                         * Extract the current sample for each enabled channel
                         * and store them in the buffer.
                         */
                         * Extract the current sample for each enabled channel
                         * and store them in the buffer.
                         */
-                       for (j = 0; j < devc->num_enabled_probes; j++) {
+                       for (j = 0; j < devc->num_enabled_channels; j++) {
                                tmp = (ptr[j][i] & (1 << k)) >> k;
                                tmp = (ptr[j][i] & (1 << k)) >> k;
-                               buffer[n] |= tmp << devc->probe_map[j];
+                               buffer[n] |= tmp << devc->channel_map[j];
                        }
 
                        n++;
                        }
 
                        n++;
@@ -313,7 +313,7 @@ SR_PRIV void sl2_receive_transfer_in( struct libusb_transfer *transfer)
                        devc->wait_data_ready_time = g_get_monotonic_time();
                }
        } else if (devc->state == STATE_RECEIVE_DATA) {
                        devc->wait_data_ready_time = g_get_monotonic_time();
                }
        } else if (devc->state == STATE_RECEIVE_DATA) {
-               last_channel = devc->probe_map[devc->num_enabled_probes - 1];
+               last_channel = devc->channel_map[devc->num_enabled_channels - 1];
 
                if (devc->channel < last_channel) {
                        buffer_sample_data(sdi);
 
                if (devc->channel < last_channel) {
                        buffer_sample_data(sdi);
@@ -322,7 +322,7 @@ SR_PRIV void sl2_receive_transfer_in( struct libusb_transfer *transfer)
                } else {
                        /*
                         * Stop acquisition because all samples of enabled
                } else {
                        /*
                         * Stop acquisition because all samples of enabled
-                        * probes are processed.
+                        * channels are processed.
                         */
                        devc->next_state = STATE_RESET_AND_IDLE;
                }
                         */
                        devc->next_state = STATE_RESET_AND_IDLE;
                }
@@ -482,9 +482,9 @@ SR_PRIV int sl2_set_limit_samples(const struct sr_dev_inst *sdi,
 SR_PRIV void sl2_configure_trigger(const struct sr_dev_inst *sdi)
 {
        struct dev_context *devc;
 SR_PRIV void sl2_configure_trigger(const struct sr_dev_inst *sdi)
 {
        struct dev_context *devc;
-       struct sr_channel *probe;
+       struct sr_channel *ch;
        uint8_t trigger_type;
        uint8_t trigger_type;
-       int probe_index, num_triggers_anyedge;
+       int channel_index, num_triggers_anyedge;
        char *trigger;
        GSList *l;
 
        char *trigger;
        GSList *l;
 
@@ -496,11 +496,11 @@ SR_PRIV void sl2_configure_trigger(const struct sr_dev_inst *sdi)
 
        num_triggers_anyedge = 0;
 
 
        num_triggers_anyedge = 0;
 
-       for (l = sdi->probes, probe_index = 0; l; l = l->next, probe_index++) {
-               probe = l->data;
-               trigger = probe->trigger;
+       for (l = sdi->channels, channel_index = 0; l; l = l->next, channel_index++) {
+               ch = l->data;
+               trigger = ch->trigger;
 
 
-               if (!trigger || !probe->enabled)
+               if (!trigger || !ch->enabled)
                        continue;
 
                switch (*trigger) {
                        continue;
 
                switch (*trigger) {
@@ -518,7 +518,7 @@ SR_PRIV void sl2_configure_trigger(const struct sr_dev_inst *sdi)
                        continue;
                }
 
                        continue;
                }
 
-               devc->trigger_channel = probe_index + 1;
+               devc->trigger_channel = channel_index + 1;
                devc->trigger_type = trigger_type;
        }
 
                devc->trigger_type = trigger_type;
        }
 
index 6cdb607254a0d10b3eb69649d57133ff05ac5567..26adeedb5efffd3516bcb231db307aeaa4319e45 100644 (file)
@@ -151,8 +151,8 @@ struct dev_context {
 
        void *cb_data;
 
 
        void *cb_data;
 
-       /* Array to provide an index based access to all probes. */
-       const struct sr_channel *probes[NUM_PROBES];
+       /* Array to provide an index based access to all channels. */
+       const struct sr_channel *channels[NUM_PROBES];
 
        struct libusb_transfer *xfer_in, *xfer_out;
 
 
        struct libusb_transfer *xfer_in, *xfer_out;
 
@@ -208,11 +208,11 @@ struct dev_context {
        /* Channel number that is currently processed. */
        uint8_t channel;
 
        /* Channel number that is currently processed. */
        uint8_t channel;
 
-       /* Number of enabled probes. */
-       unsigned int num_enabled_probes;
+       /* Number of enabled channels. */
+       unsigned int num_enabled_channels;
 
 
-       /* Array to provide a sequential access to all enabled probe indices. */
-       uint8_t probe_map[NUM_PROBES];
+       /* Array to provide a sequential access to all enabled channel indices. */
+       uint8_t channel_map[NUM_PROBES];
 
        /* Indicates whether a transfer failed. */
        gboolean transfer_error;
 
        /* Indicates whether a transfer failed. */
        gboolean transfer_error;
index ad39c9a0da602172a88eb5ffaad979ce1200c780..07ef3df335b43d7bf86fdcdc5f0fe1e6836220ef 100644 (file)
@@ -36,8 +36,8 @@ static const int32_t hwcaps[] = {
        SR_CONF_CONTINUOUS, // TODO?
 };
 
        SR_CONF_CONTINUOUS, // TODO?
 };
 
-/* Probes are numbered 1-9. */
-static const char *probe_names[] = {
+/* Channels are numbered 1-9. */
+static const char *channel_names[] = {
        "1", "2", "3", "4", "5", "6", "7", "8", "9",
        NULL,
 };
        "1", "2", "3", "4", "5", "6", "7", "8", "9",
        NULL,
 };
@@ -74,7 +74,7 @@ static int init(struct sr_context *sr_ctx)
 static GSList *scan(GSList *options)
 {
        struct sr_dev_inst *sdi;
 static GSList *scan(GSList *options)
 {
        struct sr_dev_inst *sdi;
-       struct sr_channel *probe;
+       struct sr_channel *ch;
        struct drv_context *drvc;
        struct dev_context *devc;
        GSList *devices;
        struct drv_context *drvc;
        struct dev_context *devc;
        GSList *devices;
@@ -132,11 +132,11 @@ static GSList *scan(GSList *options)
        sdi->driver = di;
        sdi->priv = devc;
 
        sdi->driver = di;
        sdi->priv = devc;
 
-       for (i = 0; probe_names[i]; i++) {
-               if (!(probe = sr_probe_new(i, SR_PROBE_LOGIC, TRUE,
-                                          probe_names[i])))
+       for (i = 0; channel_names[i]; i++) {
+               if (!(ch = sr_probe_new(i, SR_PROBE_LOGIC, TRUE,
+                                          channel_names[i])))
                        return NULL;
                        return NULL;
-               sdi->probes = g_slist_append(sdi->probes, probe);
+               sdi->channels = g_slist_append(sdi->channels, ch);
        }
 
        devices = g_slist_append(devices, sdi);
        }
 
        devices = g_slist_append(devices, sdi);
@@ -377,7 +377,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi, void *cb_data)
        if (!devc->ftdic)
                return SR_ERR_BUG;
 
        if (!devc->ftdic)
                return SR_ERR_BUG;
 
-       /* TODO: Configure probes later (thresholds etc.). */
+       /* TODO: Configure channels later (thresholds etc.). */
 
        devc->cb_data = cb_data;
 
 
        devc->cb_data = cb_data;
 
index 86597850afe2ab0d77e3d5947a6b2a1c1ad1177a..3a834f7b444e72d0d7ad7139c0b1c97a2584fdb1 100644 (file)
@@ -116,7 +116,7 @@ static void send_samples(struct dev_context *devc, uint64_t samples_to_send)
        packet.type = SR_DF_LOGIC;
        packet.payload = &logic;
        logic.length = samples_to_send * 2;
        packet.type = SR_DF_LOGIC;
        packet.payload = &logic;
        logic.length = samples_to_send * 2;
-       logic.unitsize = 2; /* We need 2 bytes for 9 probes. */
+       logic.unitsize = 2; /* We need 2 bytes for 9 channels. */
        logic.data = devc->sample_buf;
        sr_session_send(devc->cb_data, &packet);
 
        logic.data = devc->sample_buf;
        sr_session_send(devc->cb_data, &packet);
 
@@ -267,17 +267,17 @@ SR_PRIV int scanaplus_start_acquisition(struct dev_context *devc)
 {
        uint8_t buf[4];
 
 {
        uint8_t buf[4];
 
-       /* Threshold and differential probe settings not yet implemented. */
+       /* Threshold and differential channel settings not yet implemented. */
 
        buf[0] = 0x89;
 
        buf[0] = 0x89;
-       buf[1] = 0x7f; /* Logic level threshold for probes 1-4. */
+       buf[1] = 0x7f; /* Logic level threshold for channels 1-4. */
        buf[2] = 0x8a;
        buf[2] = 0x8a;
-       buf[3] = 0x7f; /* Logic level threshold for probes 5-9. */
+       buf[3] = 0x7f; /* Logic level threshold for channels 5-9. */
        if (scanaplus_write(devc, (uint8_t *)&buf, 4) < 0)
                return SR_ERR;
 
        buf[0] = 0x88;
        if (scanaplus_write(devc, (uint8_t *)&buf, 4) < 0)
                return SR_ERR;
 
        buf[0] = 0x88;
-       buf[1] = 0x40; /* Special config of probes 5/6 and 7/8. */
+       buf[1] = 0x40; /* Special config of channels 5/6 and 7/8. */
        /* 0x40: normal, 0x50: ch56 diff, 0x48: ch78 diff, 0x58: ch5678 diff */
        if (scanaplus_write(devc, (uint8_t *)&buf, 2) < 0)
                return SR_ERR;
        /* 0x40: normal, 0x50: ch56 diff, 0x48: ch78 diff, 0x58: ch5678 diff */
        if (scanaplus_write(devc, (uint8_t *)&buf, 2) < 0)
                return SR_ERR;
@@ -327,7 +327,7 @@ SR_PRIV int scanaplus_receive_data(int fd, int revents, void *cb_data)
        /*
         * After a ScanaPLUS acquisition starts, a bunch of samples will be
         * returned as all-zero, no matter which signals are actually present
        /*
         * After a ScanaPLUS acquisition starts, a bunch of samples will be
         * returned as all-zero, no matter which signals are actually present
-        * on the probes. This is probably due to the FPGA reconfiguring some
+        * on the channels. This is probably due to the FPGA reconfiguring some
         * of its internal state/config during this time.
         *
         * As far as we know there is apparently no way for the PC-side to
         * of its internal state/config during this time.
         *
         * As far as we know there is apparently no way for the PC-side to
index 279b7d626813204e80d60f33909387b7923be2d0..fcb54381e01b9da030bdfe2ac0b0d65e8e965b38 100644 (file)
@@ -112,7 +112,7 @@ static GSList *scan(GSList *options)
        struct drv_context *drvc;
        struct dev_context *devc;
        struct sr_dev_inst *sdi;
        struct drv_context *drvc;
        struct dev_context *devc;
        struct sr_dev_inst *sdi;
-       struct sr_channel *probe;
+       struct sr_channel *ch;
        GSList *usb_devices, *devices, *l;
        char *model;
 
        GSList *usb_devices, *devices, *l;
        char *model;
 
@@ -135,9 +135,9 @@ static GSList *scan(GSList *options)
                        sdi->driver = di;
                        sdi->inst_type = SR_INST_USB;
                        sdi->conn = l->data;
                        sdi->driver = di;
                        sdi->inst_type = SR_INST_USB;
                        sdi->conn = l->data;
-                       if (!(probe = sr_probe_new(0, SR_PROBE_ANALOG, TRUE, "SPL")))
+                       if (!(ch = sr_probe_new(0, SR_PROBE_ANALOG, TRUE, "SPL")))
                                return NULL;
                                return NULL;
-                       sdi->probes = g_slist_append(sdi->probes, probe);
+                       sdi->channels = g_slist_append(sdi->channels, ch);
 
                        if (!(devc = g_try_malloc(sizeof(struct dev_context)))) {
                                sr_dbg("Device context malloc failed.");
 
                        if (!(devc = g_try_malloc(sizeof(struct dev_context)))) {
                                sr_dbg("Device context malloc failed.");
index ba55f36f3d3d4627c4f595908ba4d02ad09ca91e..072eb7efa45454234a6aa281a6e01cbf6d7e91bb 100644 (file)
@@ -114,7 +114,7 @@ static void send_data(const struct sr_dev_inst *sdi, void *buf, unsigned int buf
        analog.mq = SR_MQ_SOUND_PRESSURE_LEVEL;
        analog.mqflags = devc->mqflags;
        analog.unit = SR_UNIT_DECIBEL_SPL;
        analog.mq = SR_MQ_SOUND_PRESSURE_LEVEL;
        analog.mqflags = devc->mqflags;
        analog.unit = SR_UNIT_DECIBEL_SPL;
-       analog.probes = sdi->probes;
+       analog.channels = sdi->channels;
        analog.num_samples = buf_len;
        analog.data = buf;
        packet.type = SR_DF_ANALOG;
        analog.num_samples = buf_len;
        analog.data = buf;
        packet.type = SR_DF_ANALOG;
index bf85900809da08f1bea4d7de0e4bba207320f4e6..eeb22199f36fdfe2dd74e17afed64fa6b5548d2c 100644 (file)
@@ -293,7 +293,7 @@ static struct sr_dev_inst *lascar_identify(unsigned char *config)
        struct dev_context *devc;
        const struct elusb_profile *profile;
        struct sr_dev_inst *sdi;
        struct dev_context *devc;
        const struct elusb_profile *profile;
        struct sr_dev_inst *sdi;
-       struct sr_channel *probe;
+       struct sr_channel *ch;
        int modelid, i;
        char firmware[5];
 
        int modelid, i;
        char firmware[5];
 
@@ -329,21 +329,21 @@ static struct sr_dev_inst *lascar_identify(unsigned char *config)
                sdi->driver = di;
 
                if (profile->logformat == LOG_TEMP_RH) {
                sdi->driver = di;
 
                if (profile->logformat == LOG_TEMP_RH) {
-                       /* Model this as two probes: temperature and humidity. */
-                       if (!(probe = sr_probe_new(0, SR_PROBE_ANALOG, TRUE, "Temp")))
+                       /* Model this as two channels: temperature and humidity. */
+                       if (!(ch = sr_probe_new(0, SR_PROBE_ANALOG, TRUE, "Temp")))
                                return NULL;
                                return NULL;
-                       sdi->probes = g_slist_append(NULL, probe);
-                       if (!(probe = sr_probe_new(0, SR_PROBE_ANALOG, TRUE, "Hum")))
+                       sdi->channels = g_slist_append(NULL, ch);
+                       if (!(ch = sr_probe_new(0, SR_PROBE_ANALOG, TRUE, "Hum")))
                                return NULL;
                                return NULL;
-                       sdi->probes = g_slist_append(sdi->probes, probe);
+                       sdi->channels = g_slist_append(sdi->channels, ch);
                } else if (profile->logformat == LOG_CO) {
                } else if (profile->logformat == LOG_CO) {
-                       if (!(probe = sr_probe_new(0, SR_PROBE_ANALOG, TRUE, "CO")))
+                       if (!(ch = sr_probe_new(0, SR_PROBE_ANALOG, TRUE, "CO")))
                                return NULL;
                                return NULL;
-                       sdi->probes = g_slist_append(NULL, probe);
+                       sdi->channels = g_slist_append(NULL, ch);
                } else {
                } else {
-                       if (!(probe = sr_probe_new(0, SR_PROBE_ANALOG, TRUE, "P1")))
+                       if (!(ch = sr_probe_new(0, SR_PROBE_ANALOG, TRUE, "P1")))
                                return NULL;
                                return NULL;
-                       sdi->probes = g_slist_append(NULL, probe);
+                       sdi->channels = g_slist_append(NULL, ch);
                }
 
                if (!(devc = g_try_malloc0(sizeof(struct dev_context))))
                }
 
                if (!(devc = g_try_malloc0(sizeof(struct dev_context))))
@@ -398,7 +398,7 @@ static void lascar_el_usb_dispatch(struct sr_dev_inst *sdi, unsigned char *buf,
        struct dev_context *devc;
        struct sr_datafeed_packet packet;
        struct sr_datafeed_analog analog;
        struct dev_context *devc;
        struct sr_datafeed_packet packet;
        struct sr_datafeed_analog analog;
-       struct sr_channel *probe;
+       struct sr_channel *ch;
        float *temp, *rh;
        uint16_t s;
        int samples, samples_left, i, j;
        float *temp, *rh;
        uint16_t s;
        int samples, samples_left, i, j;
@@ -435,9 +435,9 @@ static void lascar_el_usb_dispatch(struct sr_dev_inst *sdi, unsigned char *buf,
                }
                analog.num_samples = j;
 
                }
                analog.num_samples = j;
 
-               probe = sdi->probes->data;
-               if (probe->enabled) {
-                       analog.probes = g_slist_append(NULL, probe);
+               ch = sdi->channels->data;
+               if (ch->enabled) {
+                       analog.channels = g_slist_append(NULL, ch);
                        analog.mq = SR_MQ_TEMPERATURE;
                        if (devc->temp_unit == 1)
                                analog.unit = SR_UNIT_FAHRENHEIT;
                        analog.mq = SR_MQ_TEMPERATURE;
                        if (devc->temp_unit == 1)
                                analog.unit = SR_UNIT_FAHRENHEIT;
@@ -447,9 +447,9 @@ static void lascar_el_usb_dispatch(struct sr_dev_inst *sdi, unsigned char *buf,
                        sr_session_send(devc->cb_data, &packet);
                }
 
                        sr_session_send(devc->cb_data, &packet);
                }
 
-               probe = sdi->probes->next->data;
-               if (probe->enabled) {
-                       analog.probes = g_slist_append(NULL, probe);
+               ch = sdi->channels->next->data;
+               if (ch->enabled) {
+                       analog.channels = g_slist_append(NULL, ch);
                        analog.mq = SR_MQ_RELATIVE_HUMIDITY;
                        analog.unit = SR_UNIT_PERCENTAGE;
                        analog.data = rh;
                        analog.mq = SR_MQ_RELATIVE_HUMIDITY;
                        analog.unit = SR_UNIT_PERCENTAGE;
                        analog.data = rh;
@@ -462,7 +462,7 @@ static void lascar_el_usb_dispatch(struct sr_dev_inst *sdi, unsigned char *buf,
        case LOG_CO:
                packet.type = SR_DF_ANALOG;
                packet.payload = &analog;
        case LOG_CO:
                packet.type = SR_DF_ANALOG;
                packet.payload = &analog;
-               analog.probes = sdi->probes;
+               analog.channels = sdi->channels;
                analog.num_samples = samples;
                analog.mq = SR_MQ_CARBON_MONOXIDE;
                analog.unit = SR_UNIT_CONCENTRATION;
                analog.num_samples = samples;
                analog.mq = SR_MQ_CARBON_MONOXIDE;
                analog.unit = SR_UNIT_CONCENTRATION;
index daa08d1c4663c2c4df12bea15678778657f2126b..f1b28e93bca7313a1145dc89d7b2a24606bbf151 100644 (file)
@@ -33,11 +33,11 @@ static const int32_t hwcaps[] = {
 };
 
 /*
 };
 
 /*
- * Probes are numbered 0 to 7.
+ * Channels are numbered 0 to 7.
  *
  * See also: http://www.linkinstruments.com/images/mso19_1113.gif
  */
  *
  * See also: http://www.linkinstruments.com/images/mso19_1113.gif
  */
-SR_PRIV const char *mso19_probe_names[NUM_PROBES + 1] = {
+SR_PRIV const char *mso19_channel_names[NUM_PROBES + 1] = {
        /* Note: DSO needs to be first. */
        "DSO", "0", "1", "2", "3", "4", "5", "6", "7", NULL,
 };
        /* Note: DSO needs to be first. */
        "DSO", "0", "1", "2", "3", "4", "5", "6", "7", NULL,
 };
@@ -217,12 +217,12 @@ static GSList *scan(GSList *options)
                sdi->priv = devc;
 
                for (i = 0; i < NUM_PROBES; i++) {
                sdi->priv = devc;
 
                for (i = 0; i < NUM_PROBES; i++) {
-                       struct sr_channel *probe;
+                       struct sr_channel *ch;
                        ptype = (i == 0) ? SR_PROBE_ANALOG : SR_PROBE_LOGIC;
                        ptype = (i == 0) ? SR_PROBE_ANALOG : SR_PROBE_LOGIC;
-                       if (!(probe = sr_probe_new(i, ptype, TRUE,
-                                                  mso19_probe_names[i])))
+                       if (!(ch = sr_probe_new(i, ptype, TRUE,
+                                                  mso19_channel_names[i])))
                                return 0;
                                return 0;
-                       sdi->probes = g_slist_append(sdi->probes, probe);
+                       sdi->channels = g_slist_append(sdi->channels, ch);
                }
 
                //Add the driver
                }
 
                //Add the driver
@@ -409,8 +409,8 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi, void *cb_data)
 
        devc = sdi->priv;
 
 
        devc = sdi->priv;
 
-       if (mso_configure_probes(sdi) != SR_OK) {
-               sr_err("Failed to configure probes.");
+       if (mso_configure_channels(sdi) != SR_OK) {
+               sr_err("Failed to configure channels.");
                return SR_ERR;
        }
 
                return SR_ERR;
        }
 
@@ -457,7 +457,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi, void *cb_data)
        /* Send header packet to the session bus. */
        std_session_send_df_header(cb_data, LOG_PREFIX);
 
        /* Send header packet to the session bus. */
        std_session_send_df_header(cb_data, LOG_PREFIX);
 
-       /* Our first probe is analog, the other 8 are of type 'logic'. */
+       /* Our first channel is analog, the other 8 are of type 'logic'. */
        /* TODO. */
 
        serial_source_add(devc->serial, G_IO_IN, -1, mso_receive_data, cb_data);
        /* TODO. */
 
        serial_source_add(devc->serial, G_IO_IN, -1, mso_receive_data, cb_data);
index 942f0488c6d1eea39e62d6f78cd1e9dd40ed2616..40a30b944a3f5711181e59f945877c12bee44a88 100644 (file)
@@ -435,10 +435,10 @@ SR_PRIV int mso_receive_data(int fd, int revents, void *cb_data)
        return TRUE;
 }
 
        return TRUE;
 }
 
-SR_PRIV int mso_configure_probes(const struct sr_dev_inst *sdi)
+SR_PRIV int mso_configure_channels(const struct sr_dev_inst *sdi)
 {
        struct dev_context *devc;
 {
        struct dev_context *devc;
-       struct sr_channel *probe;
+       struct sr_channel *ch;
        GSList *l;
        char *tc;
 
        GSList *l;
        char *tc;
 
@@ -452,21 +452,21 @@ SR_PRIV int mso_configure_probes(const struct sr_dev_inst *sdi)
        devc->trigger_chan = 3; //LA combination trigger
        devc->use_trigger = FALSE;
 
        devc->trigger_chan = 3; //LA combination trigger
        devc->use_trigger = FALSE;
 
-       for (l = sdi->probes; l; l = l->next) {
-               probe = (struct sr_channel *)l->data;
-               if (probe->enabled == FALSE)
+       for (l = sdi->channels; l; l = l->next) {
+               ch = (struct sr_channel *)l->data;
+               if (ch->enabled == FALSE)
                        continue;
 
                        continue;
 
-               int probe_bit = 1 << (probe->index);
-               if (!(probe->trigger))
+               int channel_bit = 1 << (ch->index);
+               if (!(ch->trigger))
                        continue;
 
                devc->use_trigger = TRUE;
                //Configure trigger mask and value.
                        continue;
 
                devc->use_trigger = TRUE;
                //Configure trigger mask and value.
-               for (tc = probe->trigger; *tc; tc++) {
-                       devc->la_trigger_mask &= ~probe_bit;
+               for (tc = ch->trigger; *tc; tc++) {
+                       devc->la_trigger_mask &= ~channel_bit;
                        if (*tc == '1')
                        if (*tc == '1')
-                               devc->la_trigger |= probe_bit;
+                               devc->la_trigger |= channel_bit;
                }
        }
 
                }
        }
 
index ebf67c48e419f9614e6780a61e6f8a0581cd9843..48502c5aca28648cef856b602ae258bfa0cc5263 100644 (file)
@@ -139,7 +139,7 @@ SR_PRIV inline uint16_t mso_calc_raw_from_mv(struct dev_context *devc);
 SR_PRIV int mso_reset_fsm(struct sr_dev_inst *sdi);
 SR_PRIV int mso_toggle_led(struct sr_dev_inst *sdi, int state);
 
 SR_PRIV int mso_reset_fsm(struct sr_dev_inst *sdi);
 SR_PRIV int mso_toggle_led(struct sr_dev_inst *sdi, int state);
 
-SR_PRIV int mso_configure_probes(const struct sr_dev_inst *sdi);
+SR_PRIV int mso_configure_channels(const struct sr_dev_inst *sdi);
 SR_PRIV void stop_acquisition(const struct sr_dev_inst *sdi);
 
 /* bank agnostic registers */
 SR_PRIV void stop_acquisition(const struct sr_dev_inst *sdi);
 
 /* bank agnostic registers */
index 0cb029cc6093394892b0bd88e4c71cc926b83ce1..257d0d18584ae2d8f7f88e88feaf90b8d5817d48 100644 (file)
@@ -66,7 +66,7 @@ static GSList *mic_scan(const char *conn, const char *serialcomm, int idx)
        struct sr_dev_inst *sdi;
        struct drv_context *drvc;
        struct dev_context *devc;
        struct sr_dev_inst *sdi;
        struct drv_context *drvc;
        struct dev_context *devc;
-       struct sr_channel *probe;
+       struct sr_channel *ch;
        struct sr_serial_dev_inst *serial;
        GSList *devices;
 
        struct sr_serial_dev_inst *serial;
        GSList *devices;
 
@@ -101,14 +101,14 @@ static GSList *mic_scan(const char *conn, const char *serialcomm, int idx)
        sdi->priv = devc;
        sdi->driver = mic_devs[idx].di;
 
        sdi->priv = devc;
        sdi->driver = mic_devs[idx].di;
 
-       if (!(probe = sr_probe_new(0, SR_PROBE_ANALOG, TRUE, "Temperature")))
+       if (!(ch = sr_probe_new(0, SR_PROBE_ANALOG, TRUE, "Temperature")))
                goto scan_cleanup;
                goto scan_cleanup;
-       sdi->probes = g_slist_append(sdi->probes, probe);
+       sdi->channels = g_slist_append(sdi->channels, ch);
 
        if (mic_devs[idx].has_humidity) {
 
        if (mic_devs[idx].has_humidity) {
-               if (!(probe = sr_probe_new(1, SR_PROBE_ANALOG, TRUE, "Humidity")))
+               if (!(ch = sr_probe_new(1, SR_PROBE_ANALOG, TRUE, "Humidity")))
                        goto scan_cleanup;
                        goto scan_cleanup;
-               sdi->probes = g_slist_append(sdi->probes, probe);
+               sdi->channels = g_slist_append(sdi->channels, ch);
        }
 
        drvc->instances = g_slist_append(drvc->instances, sdi);
        }
 
        drvc->instances = g_slist_append(drvc->instances, sdi);
index 15368065a6d3145c29754da7bbc0f0d74d83e442..ce5f0209649e3afc00a4f4f5c6b3accf508ff7a5 100644 (file)
@@ -111,15 +111,15 @@ static int handle_packet(const uint8_t *buf, struct sr_dev_inst *sdi, int idx)
        /* Clear 'analog', otherwise it'll contain random garbage. */
        memset(&analog, 0, sizeof(struct sr_datafeed_analog));
 
        /* Clear 'analog', otherwise it'll contain random garbage. */
        memset(&analog, 0, sizeof(struct sr_datafeed_analog));
 
-       /* Common values for both probes. */
+       /* Common values for both channels. */
        packet.type = SR_DF_ANALOG;
        packet.payload = &analog;
        analog.num_samples = 1;
 
        /* Temperature. */
        packet.type = SR_DF_ANALOG;
        packet.payload = &analog;
        analog.num_samples = 1;
 
        /* Temperature. */
-       l = g_slist_copy(sdi->probes);
+       l = g_slist_copy(sdi->channels);
        l = g_slist_remove_link(l, g_slist_nth(l, 1));
        l = g_slist_remove_link(l, g_slist_nth(l, 1));
-       analog.probes = l;
+       analog.channels = l;
        analog.mq = SR_MQ_TEMPERATURE;
        analog.unit = SR_UNIT_CELSIUS; /* TODO: Use C/F correctly. */
        analog.data = &temperature;
        analog.mq = SR_MQ_TEMPERATURE;
        analog.unit = SR_UNIT_CELSIUS; /* TODO: Use C/F correctly. */
        analog.data = &temperature;
@@ -128,9 +128,9 @@ static int handle_packet(const uint8_t *buf, struct sr_dev_inst *sdi, int idx)
 
        /* Humidity. */
        if (mic_devs[idx].has_humidity) {
 
        /* Humidity. */
        if (mic_devs[idx].has_humidity) {
-               l = g_slist_copy(sdi->probes);
+               l = g_slist_copy(sdi->channels);
                l = g_slist_remove_link(l, g_slist_nth(l, 0));
                l = g_slist_remove_link(l, g_slist_nth(l, 0));
-               analog.probes = l;
+               analog.channels = l;
                analog.mq = SR_MQ_RELATIVE_HUMIDITY;
                analog.unit = SR_UNIT_PERCENTAGE;
                analog.data = &humidity;
                analog.mq = SR_MQ_RELATIVE_HUMIDITY;
                analog.unit = SR_UNIT_PERCENTAGE;
                analog.data = &humidity;
index a11812e9c704a269a361b81ebaa332d595393c77..652e7bef312453684b51edba73639292748537a4 100644 (file)
@@ -49,7 +49,7 @@ static GSList *scan(GSList *options)
        struct drv_context *drvc;
        struct dev_context *devc;
        struct sr_config *src;
        struct drv_context *drvc;
        struct dev_context *devc;
        struct sr_config *src;
-       struct sr_channel *probe;
+       struct sr_channel *ch;
        struct sr_serial_dev_inst *serial;
        GSList *l, *devices;
        int len, cnt;
        struct sr_serial_dev_inst *serial;
        GSList *l, *devices;
        int len, cnt;
@@ -128,10 +128,10 @@ static GSList *scan(GSList *options)
                        sdi->conn = serial;
                        sdi->priv = devc;
                        sdi->driver = di;
                        sdi->conn = serial;
                        sdi->priv = devc;
                        sdi->driver = di;
-                       if (!(probe = sr_probe_new(0, SR_PROBE_ANALOG, TRUE,
+                       if (!(ch = sr_probe_new(0, SR_PROBE_ANALOG, TRUE,
                                "P1")))
                                return NULL;
                                "P1")))
                                return NULL;
-                       sdi->probes = g_slist_append(sdi->probes, probe);
+                       sdi->channels = g_slist_append(sdi->channels, ch);
                        drvc->instances = g_slist_append(drvc->instances, sdi);
                        devices = g_slist_append(devices, sdi);
                        break;
                        drvc->instances = g_slist_append(drvc->instances, sdi);
                        devices = g_slist_append(devices, sdi);
                        break;
index d5004a180808ca9e5264d3c139c068bbd4f25df9..8e1466a42df76e0a5504890cf492bd21fb233380 100644 (file)
@@ -349,7 +349,7 @@ static void nma_process_line(const struct sr_dev_inst *sdi)
                (double)scale, (double)value);
 
        /* Finish and send packet. */
                (double)scale, (double)value);
 
        /* Finish and send packet. */
-       analog.probes = sdi->probes;
+       analog.channels = sdi->channels;
        analog.num_samples = 1;
        analog.data = &value;
 
        analog.num_samples = 1;
        analog.data = &value;
 
index c45b931ce63bbd40a125e93c61181e041f08653c..258897118161ee9cd26d0488d5beb574734a34e5 100644 (file)
@@ -61,8 +61,8 @@ static const char *patterns[] = {
        STR_PATTERN_INTERNAL,
 };
 
        STR_PATTERN_INTERNAL,
 };
 
-/* Probes are numbered 0-31 (on the PCB silkscreen). */
-SR_PRIV const char *ols_probe_names[NUM_PROBES + 1] = {
+/* Channels are numbered 0-31 (on the PCB silkscreen). */
+SR_PRIV const char *ols_channel_names[NUM_PROBES + 1] = {
        "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12",
        "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23",
        "24", "25", "26", "27", "28", "29", "30", "31",
        "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12",
        "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23",
        "24", "25", "26", "27", "28", "29", "30", "31",
@@ -90,7 +90,7 @@ static GSList *scan(GSList *options)
        struct sr_dev_inst *sdi;
        struct drv_context *drvc;
        struct dev_context *devc;
        struct sr_dev_inst *sdi;
        struct drv_context *drvc;
        struct dev_context *devc;
-       struct sr_channel *probe;
+       struct sr_channel *ch;
        struct sr_serial_dev_inst *serial;
        GPollFD probefd;
        GSList *l, *devices;
        struct sr_serial_dev_inst *serial;
        GPollFD probefd;
        GSList *l, *devices;
@@ -177,10 +177,10 @@ static GSList *scan(GSList *options)
                                "Sump", "Logic Analyzer", "v1.0");
                sdi->driver = di;
                for (i = 0; i < 32; i++) {
                                "Sump", "Logic Analyzer", "v1.0");
                sdi->driver = di;
                for (i = 0; i < 32; i++) {
-                       if (!(probe = sr_probe_new(i, SR_PROBE_LOGIC, TRUE,
-                                       ols_probe_names[i])))
+                       if (!(ch = sr_probe_new(i, SR_PROBE_LOGIC, TRUE,
+                                       ols_channel_names[i])))
                                return 0;
                                return 0;
-                       sdi->probes = g_slist_append(sdi->probes, probe);
+                       sdi->channels = g_slist_append(sdi->channels, ch);
                }
                devc = ols_dev_new();
                sdi->priv = devc;
                }
                devc = ols_dev_new();
                sdi->priv = devc;
@@ -190,7 +190,7 @@ static GSList *scan(GSList *options)
                sr_dbg("Failed to set default samplerate (%"PRIu64").",
                                DEFAULT_SAMPLERATE);
        /* Clear trigger masks, values and stages. */
                sr_dbg("Failed to set default samplerate (%"PRIu64").",
                                DEFAULT_SAMPLERATE);
        /* Clear trigger masks, values and stages. */
-       ols_configure_probes(sdi);
+       ols_configure_channels(sdi);
        sdi->inst_type = SR_INST_SERIAL;
        sdi->conn = serial;
 
        sdi->inst_type = SR_INST_SERIAL;
        sdi->conn = serial;
 
@@ -390,13 +390,13 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
                        /* Device didn't specify sample memory size in metadata. */
                        return SR_ERR_NA;
                /*
                        /* Device didn't specify sample memory size in metadata. */
                        return SR_ERR_NA;
                /*
-                * Channel groups are turned off if no probes in that group are
+                * Channel groups are turned off if no channels in that group are
                 * enabled, making more room for samples for the enabled group.
                */
                 * enabled, making more room for samples for the enabled group.
                */
-               ols_configure_probes(sdi);
+               ols_configure_channels(sdi);
                num_channels = 0;
                for (i = 0; i < 4; i++) {
                num_channels = 0;
                for (i = 0; i < 4; i++) {
-                       if (devc->probe_mask & (0xff << (i * 8)))
+                       if (devc->channel_mask & (0xff << (i * 8)))
                                num_channels++;
                }
                grange[0] = g_variant_new_uint64(MIN_NUM_SAMPLES);
                                num_channels++;
                }
                grange[0] = g_variant_new_uint64(MIN_NUM_SAMPLES);
@@ -463,20 +463,20 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi,
        devc = sdi->priv;
        serial = sdi->conn;
 
        devc = sdi->priv;
        serial = sdi->conn;
 
-       if (ols_configure_probes(sdi) != SR_OK) {
-               sr_err("Failed to configure probes.");
+       if (ols_configure_channels(sdi) != SR_OK) {
+               sr_err("Failed to configure channels.");
                return SR_ERR;
        }
 
        /*
         * Enable/disable channel groups in the flag register according to the
                return SR_ERR;
        }
 
        /*
         * Enable/disable channel groups in the flag register according to the
-        * probe mask. Calculate this here, because num_channels is needed
+        * channel mask. Calculate this here, because num_channels is needed
         * to limit readcount.
         */
        changrp_mask = 0;
        num_channels = 0;
        for (i = 0; i < 4; i++) {
         * to limit readcount.
         */
        changrp_mask = 0;
        num_channels = 0;
        for (i = 0; i < 4; i++) {
-               if (devc->probe_mask & (0xff << (i * 8))) {
+               if (devc->channel_mask & (0xff << (i * 8))) {
                        changrp_mask |= (1 << i);
                        num_channels++;
                }
                        changrp_mask |= (1 << i);
                        num_channels++;
                }
@@ -495,7 +495,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi,
 
        /* Basic triggers. */
        if (devc->trigger_mask[0] != 0x00000000) {
 
        /* Basic triggers. */
        if (devc->trigger_mask[0] != 0x00000000) {
-               /* At least one probe has a trigger on it. */
+               /* At least one channel has a trigger on it. */
                delaycount = readcount * (1 - devc->capture_ratio / 100.0);
                devc->trigger_at = (readcount - delaycount) * 4 - devc->num_stages;
                for (i = 0; i <= devc->num_stages; i++) {
                delaycount = readcount * (1 - devc->capture_ratio / 100.0);
                devc->trigger_at = (readcount - delaycount) * 4 - devc->num_stages;
                for (i = 0; i <= devc->num_stages; i++) {
index 46316db44923183883805c3a6844e994382584ce..28b1353ebee0b0057552052ca398dfcc6ade6b0d 100644 (file)
@@ -54,49 +54,49 @@ SR_PRIV int send_longcommand(struct sr_serial_dev_inst *serial,
        return SR_OK;
 }
 
        return SR_OK;
 }
 
-SR_PRIV int ols_configure_probes(const struct sr_dev_inst *sdi)
+SR_PRIV int ols_configure_channels(const struct sr_dev_inst *sdi)
 {
        struct dev_context *devc;
 {
        struct dev_context *devc;
-       const struct sr_channel *probe;
+       const struct sr_channel *ch;
        const GSList *l;
        const GSList *l;
-       int probe_bit, stage, i;
+       int channel_bit, stage, i;
        char *tc;
 
        devc = sdi->priv;
 
        char *tc;
 
        devc = sdi->priv;
 
-       devc->probe_mask = 0;
+       devc->channel_mask = 0;
        for (i = 0; i < NUM_TRIGGER_STAGES; i++) {
                devc->trigger_mask[i] = 0;
                devc->trigger_value[i] = 0;
        }
 
        devc->num_stages = 0;
        for (i = 0; i < NUM_TRIGGER_STAGES; i++) {
                devc->trigger_mask[i] = 0;
                devc->trigger_value[i] = 0;
        }
 
        devc->num_stages = 0;
-       for (l = sdi->probes; l; l = l->next) {
-               probe = (const struct sr_channel *)l->data;
-               if (!probe->enabled)
+       for (l = sdi->channels; l; l = l->next) {
+               ch = (const struct sr_channel *)l->data;
+               if (!ch->enabled)
                        continue;
 
                        continue;
 
-               if (probe->index >= devc->max_probes) {
-                       sr_err("Channels over the limit of %d\n", devc->max_probes);
+               if (ch->index >= devc->max_channels) {
+                       sr_err("Channels over the limit of %d\n", devc->max_channels);
                        return SR_ERR;
                }
 
                /*
                        return SR_ERR;
                }
 
                /*
-                * Set up the probe mask for later configuration into the
+                * Set up the channel mask for later configuration into the
                 * flag register.
                 */
                 * flag register.
                 */
-               probe_bit = 1 << (probe->index);
-               devc->probe_mask |= probe_bit;
+               channel_bit = 1 << (ch->index);
+               devc->channel_mask |= channel_bit;
 
 
-               if (!probe->trigger)
+               if (!ch->trigger)
                        continue;
 
                /* Configure trigger mask and value. */
                stage = 0;
                        continue;
 
                /* Configure trigger mask and value. */
                stage = 0;
-               for (tc = probe->trigger; tc && *tc; tc++) {
-                       devc->trigger_mask[stage] |= probe_bit;
+               for (tc = ch->trigger; tc && *tc; tc++) {
+                       devc->trigger_mask[stage] |= channel_bit;
                        if (*tc == '1')
                        if (*tc == '1')
-                               devc->trigger_value[stage] |= probe_bit;
+                               devc->trigger_value[stage] |= channel_bit;
                        stage++;
                        /* Only supporting parallel mode, with up to 4 stages. */
                        if (stage > 4)
                        stage++;
                        /* Only supporting parallel mode, with up to 4 stages. */
                        if (stage > 4)
@@ -124,7 +124,7 @@ SR_PRIV struct dev_context *ols_dev_new(void)
        /* Acquisition settings */
        devc->limit_samples = devc->capture_ratio = 0;
        devc->trigger_at = -1;
        /* Acquisition settings */
        devc->limit_samples = devc->capture_ratio = 0;
        devc->trigger_at = -1;
-       devc->probe_mask = 0xffffffff;
+       devc->channel_mask = 0xffffffff;
        devc->flag_reg = 0;
 
        return devc;
        devc->flag_reg = 0;
 
        return devc;
@@ -134,7 +134,7 @@ SR_PRIV struct sr_dev_inst *get_metadata(struct sr_serial_dev_inst *serial)
 {
        struct sr_dev_inst *sdi;
        struct dev_context *devc;
 {
        struct sr_dev_inst *sdi;
        struct dev_context *devc;
-       struct sr_channel *probe;
+       struct sr_channel *ch;
        uint32_t tmp_int, ui;
        uint8_t key, type, token;
        GString *tmp_str, *devname, *version;
        uint32_t tmp_int, ui;
        uint8_t key, type, token;
        GString *tmp_str, *devname, *version;
@@ -201,12 +201,12 @@ SR_PRIV struct sr_dev_inst *get_metadata(struct sr_serial_dev_inst *serial)
                               key, tmp_int);
                        switch (token) {
                        case 0x00:
                               key, tmp_int);
                        switch (token) {
                        case 0x00:
-                               /* Number of usable probes */
+                               /* Number of usable channels */
                                for (ui = 0; ui < tmp_int; ui++) {
                                for (ui = 0; ui < tmp_int; ui++) {
-                                       if (!(probe = sr_probe_new(ui, SR_PROBE_LOGIC, TRUE,
-                                                       ols_probe_names[ui])))
+                                       if (!(ch = sr_probe_new(ui, SR_PROBE_LOGIC, TRUE,
+                                                       ols_channel_names[ui])))
                                                return 0;
                                                return 0;
-                                       sdi->probes = g_slist_append(sdi->probes, probe);
+                                       sdi->channels = g_slist_append(sdi->channels, ch);
                                }
                                break;
                        case 0x01:
                                }
                                break;
                        case 0x01:
@@ -239,12 +239,12 @@ SR_PRIV struct sr_dev_inst *get_metadata(struct sr_serial_dev_inst *serial)
                               key, tmp_c);
                        switch (token) {
                        case 0x00:
                               key, tmp_c);
                        switch (token) {
                        case 0x00:
-                               /* Number of usable probes */
+                               /* Number of usable channels */
                                for (ui = 0; ui < tmp_c; ui++) {
                                for (ui = 0; ui < tmp_c; ui++) {
-                                       if (!(probe = sr_probe_new(ui, SR_PROBE_LOGIC, TRUE,
-                                                       ols_probe_names[ui])))
+                                       if (!(ch = sr_probe_new(ui, SR_PROBE_LOGIC, TRUE,
+                                                       ols_channel_names[ui])))
                                                return 0;
                                                return 0;
-                                       sdi->probes = g_slist_append(sdi->probes, probe);
+                                       sdi->channels = g_slist_append(sdi->channels, ch);
                                }
                                break;
                        case 0x01:
                                }
                                break;
                        case 0x01:
@@ -284,13 +284,13 @@ SR_PRIV int ols_set_samplerate(const struct sr_dev_inst *sdi,
                sr_info("Enabling demux mode.");
                devc->flag_reg |= FLAG_DEMUX;
                devc->flag_reg &= ~FLAG_FILTER;
                sr_info("Enabling demux mode.");
                devc->flag_reg |= FLAG_DEMUX;
                devc->flag_reg &= ~FLAG_FILTER;
-               devc->max_probes = NUM_PROBES / 2;
+               devc->max_channels = NUM_PROBES / 2;
                devc->cur_samplerate_divider = (CLOCK_RATE * 2 / samplerate) - 1;
        } else {
                sr_info("Disabling demux mode.");
                devc->flag_reg &= ~FLAG_DEMUX;
                devc->flag_reg |= FLAG_FILTER;
                devc->cur_samplerate_divider = (CLOCK_RATE * 2 / samplerate) - 1;
        } else {
                sr_info("Disabling demux mode.");
                devc->flag_reg &= ~FLAG_DEMUX;
                devc->flag_reg |= FLAG_FILTER;
-               devc->max_probes = NUM_PROBES;
+               devc->max_channels = NUM_PROBES;
                devc->cur_samplerate_divider = (CLOCK_RATE / samplerate) - 1;
        }
 
                devc->cur_samplerate_divider = (CLOCK_RATE / samplerate) - 1;
        }
 
@@ -415,7 +415,7 @@ SR_PRIV int ols_receive_data(int fd, int revents, void *cb_data)
                                 * submitting it over the session bus --
                                 * whatever is listening on the bus will be
                                 * expecting a full 32-bit sample, based on
                                 * submitting it over the session bus --
                                 * whatever is listening on the bus will be
                                 * expecting a full 32-bit sample, based on
-                                * the number of probes.
+                                * the number of channels.
                                 */
                                j = 0;
                                memset(devc->tmp_sample, 0, 4);
                                 */
                                j = 0;
                                memset(devc->tmp_sample, 0, 4);
index 9d3b2e54ee790babe09295ba96e1916031a90211..111ac69f2dfd3987b8f7a5811df14c3a7d1e5988 100644 (file)
@@ -70,7 +70,7 @@
 /* Private, per-device-instance driver context. */
 struct dev_context {
        /* Fixed device settings */
 /* Private, per-device-instance driver context. */
 struct dev_context {
        /* Fixed device settings */
-       int max_probes;
+       int max_channels;
        uint32_t max_samples;
        uint32_t max_samplerate;
        uint32_t protocol_version;
        uint32_t max_samples;
        uint32_t max_samplerate;
        uint32_t protocol_version;
@@ -81,7 +81,7 @@ struct dev_context {
        uint64_t limit_samples;
        int capture_ratio;
        int trigger_at;
        uint64_t limit_samples;
        int capture_ratio;
        int trigger_at;
-       uint32_t probe_mask;
+       uint32_t channel_mask;
        uint32_t trigger_mask[4];
        uint32_t trigger_value[4];
        int num_stages;
        uint32_t trigger_mask[4];
        uint32_t trigger_value[4];
        int num_stages;
@@ -103,13 +103,13 @@ struct dev_context {
 };
 
 
 };
 
 
-SR_PRIV extern const char *ols_probe_names[NUM_PROBES + 1];
+SR_PRIV extern const char *ols_channel_names[NUM_PROBES + 1];
 
 SR_PRIV int send_shortcommand(struct sr_serial_dev_inst *serial,
                uint8_t command);
 SR_PRIV int send_longcommand(struct sr_serial_dev_inst *serial,
                uint8_t command, uint8_t *data);
 
 SR_PRIV int send_shortcommand(struct sr_serial_dev_inst *serial,
                uint8_t command);
 SR_PRIV int send_longcommand(struct sr_serial_dev_inst *serial,
                uint8_t command, uint8_t *data);
-SR_PRIV int ols_configure_probes(const struct sr_dev_inst *sdi);
+SR_PRIV int ols_configure_channels(const struct sr_dev_inst *sdi);
 SR_PRIV struct dev_context *ols_dev_new(void);
 SR_PRIV struct sr_dev_inst *get_metadata(struct sr_serial_dev_inst *serial);
 SR_PRIV int ols_set_samplerate(const struct sr_dev_inst *sdi,
 SR_PRIV struct dev_context *ols_dev_new(void);
 SR_PRIV struct sr_dev_inst *get_metadata(struct sr_serial_dev_inst *serial);
 SR_PRIV int ols_set_samplerate(const struct sr_dev_inst *sdi,
index c23805c6acd1c24a0782bc4018af978ab2656cf5..ce78840b959c8ec03707e12e2c8684f0ad9cbbab 100644 (file)
@@ -260,7 +260,7 @@ static struct sr_dev_inst *probe_device(struct sr_scpi_dev_inst *scpi)
        struct dev_context *devc;
        struct sr_dev_inst *sdi;
        struct sr_scpi_hw_info *hw_info;
        struct dev_context *devc;
        struct sr_dev_inst *sdi;
        struct sr_scpi_hw_info *hw_info;
-       struct sr_channel *probe;
+       struct sr_channel *ch;
        long n[3];
        unsigned int i;
        const struct rigol_ds_model *model = NULL;
        long n[3];
        unsigned int i;
        const struct rigol_ds_model *model = NULL;
@@ -335,10 +335,10 @@ static struct sr_dev_inst *probe_device(struct sr_scpi_dev_inst *scpi)
        for (i = 0; i < model->analog_channels; i++) {
                if (!(channel_name = g_strdup_printf("CH%d", i + 1)))
                        return NULL;
        for (i = 0; i < model->analog_channels; i++) {
                if (!(channel_name = g_strdup_printf("CH%d", i + 1)))
                        return NULL;
-               probe = sr_probe_new(i, SR_PROBE_ANALOG, TRUE, channel_name);
-               sdi->probes = g_slist_append(sdi->probes, probe);
+               ch = sr_probe_new(i, SR_PROBE_ANALOG, TRUE, channel_name);
+               sdi->channels = g_slist_append(sdi->channels, ch);
                devc->analog_groups[i].name = channel_name;
                devc->analog_groups[i].name = channel_name;
-               devc->analog_groups[i].channels = g_slist_append(NULL, probe);
+               devc->analog_groups[i].channels = g_slist_append(NULL, ch);
                sdi->channel_groups = g_slist_append(sdi->channel_groups,
                                &devc->analog_groups[i]);
        }
                sdi->channel_groups = g_slist_append(sdi->channel_groups,
                                &devc->analog_groups[i]);
        }
@@ -347,13 +347,13 @@ static struct sr_dev_inst *probe_device(struct sr_scpi_dev_inst *scpi)
                for (i = 0; i < 16; i++) {
                        if (!(channel_name = g_strdup_printf("D%d", i)))
                                return NULL;
                for (i = 0; i < 16; i++) {
                        if (!(channel_name = g_strdup_printf("D%d", i)))
                                return NULL;
-                       probe = sr_probe_new(i, SR_PROBE_LOGIC, TRUE, channel_name);
+                       ch = sr_probe_new(i, SR_PROBE_LOGIC, TRUE, channel_name);
                        g_free(channel_name);
                        g_free(channel_name);
-                       if (!probe)
+                       if (!ch)
                                return NULL;
                                return NULL;
-                       sdi->probes = g_slist_append(sdi->probes, probe);
+                       sdi->channels = g_slist_append(sdi->channels, ch);
                        devc->digital_group.channels = g_slist_append(
                        devc->digital_group.channels = g_slist_append(
-                                       devc->digital_group.channels, probe);
+                                       devc->digital_group.channels, ch);
                }
                devc->digital_group.name = "LA";
                sdi->channel_groups = g_slist_append(sdi->channel_groups,
                }
                devc->digital_group.name = "LA";
                sdi->channel_groups = g_slist_append(sdi->channel_groups,
@@ -439,24 +439,24 @@ static int cleanup(void)
 static int analog_frame_size(const struct sr_dev_inst *sdi)
 {
        struct dev_context *devc = sdi->priv;
 static int analog_frame_size(const struct sr_dev_inst *sdi)
 {
        struct dev_context *devc = sdi->priv;
-       struct sr_channel *probe;
-       int analog_probes = 0;
+       struct sr_channel *ch;
+       int analog_channels = 0;
        GSList *l;
 
        GSList *l;
 
-       for (l = sdi->probes; l; l = l->next) {
-               probe = l->data;
-               if (probe->type == SR_PROBE_ANALOG && probe->enabled)
-                       analog_probes++;
+       for (l = sdi->channels; l; l = l->next) {
+               ch = l->data;
+               if (ch->type == SR_PROBE_ANALOG && ch->enabled)
+                       analog_channels++;
        }
 
        }
 
-       if (analog_probes == 0)
+       if (analog_channels == 0)
                return 0;
 
        switch (devc->data_source) {
        case DATA_SOURCE_LIVE:
                return devc->model->series->live_samples;
        case DATA_SOURCE_MEMORY:
                return 0;
 
        switch (devc->data_source) {
        case DATA_SOURCE_LIVE:
                return devc->model->series->live_samples;
        case DATA_SOURCE_MEMORY:
-               return devc->model->series->buffer_samples / analog_probes;
+               return devc->model->series->buffer_samples / analog_channels;
        default:
                return 0;
        }
        default:
                return 0;
        }
@@ -480,7 +480,7 @@ static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi,
                const struct sr_channel_group *cg)
 {
        struct dev_context *devc;
                const struct sr_channel_group *cg)
 {
        struct dev_context *devc;
-       struct sr_channel *probe;
+       struct sr_channel *ch;
        const char *tmp_str;
        uint64_t samplerate;
        int analog_channel = -1;
        const char *tmp_str;
        uint64_t samplerate;
        int analog_channel = -1;
@@ -498,13 +498,13 @@ static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi,
        }
 
        if (cg) {
        }
 
        if (cg) {
-               probe = g_slist_nth_data(cg->channels, 0);
-               if (!probe)
+               ch = g_slist_nth_data(cg->channels, 0);
+               if (!ch)
                        return SR_ERR;
                        return SR_ERR;
-               if (probe->type == SR_PROBE_ANALOG) {
-                       if (probe->name[2] < '1' || probe->name[2] > '4')
+               if (ch->type == SR_PROBE_ANALOG) {
+                       if (ch->name[2] < '1' || ch->name[2] > '4')
                                return SR_ERR;
                                return SR_ERR;
-                       analog_channel = probe->name[2] - '1';
+                       analog_channel = ch->name[2] - '1';
                }
        }
 
                }
        }
 
@@ -865,7 +865,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi, void *cb_data)
 {
        struct sr_scpi_dev_inst *scpi;
        struct dev_context *devc;
 {
        struct sr_scpi_dev_inst *scpi;
        struct dev_context *devc;
-       struct sr_channel *probe;
+       struct sr_channel *ch;
        struct sr_datafeed_packet packet;
        GSList *l;
 
        struct sr_datafeed_packet packet;
        GSList *l;
 
@@ -877,24 +877,24 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi, void *cb_data)
 
        devc->num_frames = 0;
 
 
        devc->num_frames = 0;
 
-       for (l = sdi->probes; l; l = l->next) {
-               probe = l->data;
-               sr_dbg("handling probe %s", probe->name);
-               if (probe->type == SR_PROBE_ANALOG) {
-                       if (probe->enabled)
-                               devc->enabled_analog_probes = g_slist_append(
-                                               devc->enabled_analog_probes, probe);
-                       if (probe->enabled != devc->analog_channels[probe->index]) {
+       for (l = sdi->channels; l; l = l->next) {
+               ch = l->data;
+               sr_dbg("handling channel %s", ch->name);
+               if (ch->type == SR_PROBE_ANALOG) {
+                       if (ch->enabled)
+                               devc->enabled_analog_channels = g_slist_append(
+                                               devc->enabled_analog_channels, ch);
+                       if (ch->enabled != devc->analog_channels[ch->index]) {
                                /* Enabled channel is currently disabled, or vice versa. */
                                /* Enabled channel is currently disabled, or vice versa. */
-                               if (rigol_ds_config_set(sdi, ":CHAN%d:DISP %s", probe->index + 1,
-                                               probe->enabled ? "ON" : "OFF") != SR_OK)
+                               if (rigol_ds_config_set(sdi, ":CHAN%d:DISP %s", ch->index + 1,
+                                               ch->enabled ? "ON" : "OFF") != SR_OK)
                                        return SR_ERR;
                                        return SR_ERR;
-                               devc->analog_channels[probe->index] = probe->enabled;
+                               devc->analog_channels[ch->index] = ch->enabled;
                        }
                        }
-               } else if (probe->type == SR_PROBE_LOGIC) {
-                       if (probe->enabled) {
-                               devc->enabled_digital_probes = g_slist_append(
-                                               devc->enabled_digital_probes, probe);
+               } else if (ch->type == SR_PROBE_LOGIC) {
+                       if (ch->enabled) {
+                               devc->enabled_digital_channels = g_slist_append(
+                                               devc->enabled_digital_channels, ch);
                                /* Turn on LA module if currently off. */
                                if (!devc->la_enabled) {
                                        if (rigol_ds_config_set(sdi, ":LA:DISP ON") != SR_OK)
                                /* Turn on LA module if currently off. */
                                if (!devc->la_enabled) {
                                        if (rigol_ds_config_set(sdi, ":LA:DISP ON") != SR_OK)
@@ -902,21 +902,21 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi, void *cb_data)
                                        devc->la_enabled = TRUE;
                                }
                        }
                                        devc->la_enabled = TRUE;
                                }
                        }
-                       if (probe->enabled != devc->digital_channels[probe->index]) {
+                       if (ch->enabled != devc->digital_channels[ch->index]) {
                                /* Enabled channel is currently disabled, or vice versa. */
                                /* Enabled channel is currently disabled, or vice versa. */
-                               if (rigol_ds_config_set(sdi, ":DIG%d:TURN %s", probe->index,
-                                               probe->enabled ? "ON" : "OFF") != SR_OK)
+                               if (rigol_ds_config_set(sdi, ":DIG%d:TURN %s", ch->index,
+                                               ch->enabled ? "ON" : "OFF") != SR_OK)
                                        return SR_ERR;
                                        return SR_ERR;
-                               devc->digital_channels[probe->index] = probe->enabled;
+                               devc->digital_channels[ch->index] = ch->enabled;
                        }
                }
        }
 
                        }
                }
        }
 
-       if (!devc->enabled_analog_probes && !devc->enabled_digital_probes)
+       if (!devc->enabled_analog_channels && !devc->enabled_digital_channels)
                return SR_ERR;
 
                return SR_ERR;
 
-       /* Turn off LA module if on and no digital probes selected. */
-       if (devc->la_enabled && !devc->enabled_digital_probes)
+       /* Turn off LA module if on and no digital channels selected. */
+       if (devc->la_enabled && !devc->enabled_digital_channels)
                if (rigol_ds_config_set(sdi, ":LA:DISP OFF") != SR_OK)
                        return SR_ERR;
 
                if (rigol_ds_config_set(sdi, ":LA:DISP OFF") != SR_OK)
                        return SR_ERR;
 
@@ -959,10 +959,10 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi, void *cb_data)
        /* Send header packet to the session bus. */
        std_session_send_df_header(cb_data, LOG_PREFIX);
 
        /* Send header packet to the session bus. */
        std_session_send_df_header(cb_data, LOG_PREFIX);
 
-       if (devc->enabled_analog_probes)
-               devc->channel_entry = devc->enabled_analog_probes;
+       if (devc->enabled_analog_channels)
+               devc->channel_entry = devc->enabled_analog_channels;
        else
        else
-               devc->channel_entry = devc->enabled_digital_probes;
+               devc->channel_entry = devc->enabled_digital_channels;
 
        if (rigol_ds_capture_start(sdi) != SR_OK)
                return SR_ERR;
 
        if (rigol_ds_capture_start(sdi) != SR_OK)
                return SR_ERR;
@@ -993,10 +993,10 @@ static int dev_acquisition_stop(struct sr_dev_inst *sdi, void *cb_data)
        packet.type = SR_DF_END;
        sr_session_send(sdi, &packet);
 
        packet.type = SR_DF_END;
        sr_session_send(sdi, &packet);
 
-       g_slist_free(devc->enabled_analog_probes);
-       g_slist_free(devc->enabled_digital_probes);
-       devc->enabled_analog_probes = NULL;
-       devc->enabled_digital_probes = NULL;
+       g_slist_free(devc->enabled_analog_channels);
+       g_slist_free(devc->enabled_digital_channels);
+       devc->enabled_analog_channels = NULL;
+       devc->enabled_digital_channels = NULL;
        scpi = sdi->conn;
        sr_scpi_source_remove(scpi);
 
        scpi = sdi->conn;
        sr_scpi_source_remove(scpi);
 
index d609b06079dd14bc9a29c0a7535e4467fc4eb471..ac177f149a07a4832bc0fe7d4a9fe97965bd19f6 100644 (file)
@@ -207,19 +207,19 @@ static int rigol_ds_stop_wait(const struct sr_dev_inst *sdi)
 static int rigol_ds_check_stop(const struct sr_dev_inst *sdi)
 {
        struct dev_context *devc;
 static int rigol_ds_check_stop(const struct sr_dev_inst *sdi)
 {
        struct dev_context *devc;
-       struct sr_channel *probe;
+       struct sr_channel *ch;
        int tmp;
 
        if (!(devc = sdi->priv))
                return SR_ERR;
 
        int tmp;
 
        if (!(devc = sdi->priv))
                return SR_ERR;
 
-       probe = devc->channel_entry->data;
+       ch = devc->channel_entry->data;
 
        if (devc->model->series->protocol <= PROTOCOL_V2)
                return SR_OK;
 
        if (rigol_ds_config_set(sdi, ":WAV:SOUR CHAN%d",
 
        if (devc->model->series->protocol <= PROTOCOL_V2)
                return SR_OK;
 
        if (rigol_ds_config_set(sdi, ":WAV:SOUR CHAN%d",
-                         probe->index + 1) != SR_OK)
+                         ch->index + 1) != SR_OK)
                return SR_ERR;
        /* Check that the number of samples will be accepted */
        if (rigol_ds_config_set(sdi, ":WAV:POIN %d", devc->analog_frame_size) != SR_OK)
                return SR_ERR;
        /* Check that the number of samples will be accepted */
        if (rigol_ds_config_set(sdi, ":WAV:POIN %d", devc->analog_frame_size) != SR_OK)
@@ -376,28 +376,28 @@ SR_PRIV int rigol_ds_capture_start(const struct sr_dev_inst *sdi)
 SR_PRIV int rigol_ds_channel_start(const struct sr_dev_inst *sdi)
 {
        struct dev_context *devc;
 SR_PRIV int rigol_ds_channel_start(const struct sr_dev_inst *sdi)
 {
        struct dev_context *devc;
-       struct sr_channel *probe;
+       struct sr_channel *ch;
 
        if (!(devc = sdi->priv))
                return SR_ERR;
 
 
        if (!(devc = sdi->priv))
                return SR_ERR;
 
-       probe = devc->channel_entry->data;
+       ch = devc->channel_entry->data;
 
 
-       sr_dbg("Starting reading data from channel %d", probe->index + 1);
+       sr_dbg("Starting reading data from channel %d", ch->index + 1);
 
        if (devc->model->series->protocol <= PROTOCOL_V2) {
 
        if (devc->model->series->protocol <= PROTOCOL_V2) {
-               if (probe->type == SR_PROBE_LOGIC) {
+               if (ch->type == SR_PROBE_LOGIC) {
                        if (sr_scpi_send(sdi->conn, ":WAV:DATA? DIG") != SR_OK)
                                return SR_ERR;
                } else {
                        if (sr_scpi_send(sdi->conn, ":WAV:DATA? CHAN%d",
                        if (sr_scpi_send(sdi->conn, ":WAV:DATA? DIG") != SR_OK)
                                return SR_ERR;
                } else {
                        if (sr_scpi_send(sdi->conn, ":WAV:DATA? CHAN%d",
-                                       probe->index + 1) != SR_OK)
+                                       ch->index + 1) != SR_OK)
                                return SR_ERR;
                }
                rigol_ds_set_wait_event(devc, WAIT_NONE);
        } else {
                if (rigol_ds_config_set(sdi, ":WAV:SOUR CHAN%d",
                                return SR_ERR;
                }
                rigol_ds_set_wait_event(devc, WAIT_NONE);
        } else {
                if (rigol_ds_config_set(sdi, ":WAV:SOUR CHAN%d",
-                                 probe->index + 1) != SR_OK)
+                                 ch->index + 1) != SR_OK)
                        return SR_ERR;
                if (devc->data_source != DATA_SOURCE_LIVE) {
                        if (rigol_ds_config_set(sdi, ":WAV:RES") != SR_OK)
                        return SR_ERR;
                if (devc->data_source != DATA_SOURCE_LIVE) {
                        if (rigol_ds_config_set(sdi, ":WAV:RES") != SR_OK)
@@ -483,7 +483,7 @@ SR_PRIV int rigol_ds_receive(int fd, int revents, void *cb_data)
        struct sr_datafeed_logic logic;
        double vdiv, offset;
        int len, i, vref;
        struct sr_datafeed_logic logic;
        double vdiv, offset;
        int len, i, vref;
-       struct sr_channel *probe;
+       struct sr_channel *ch;
        gsize expected_data_bytes;
 
        (void)fd;
        gsize expected_data_bytes;
 
        (void)fd;
@@ -522,9 +522,9 @@ SR_PRIV int rigol_ds_receive(int fd, int revents, void *cb_data)
                        sr_err("BUG: Unknown event target encountered");
                }
 
                        sr_err("BUG: Unknown event target encountered");
                }
 
-               probe = devc->channel_entry->data;
+               ch = devc->channel_entry->data;
 
 
-               expected_data_bytes = probe->type == SR_PROBE_ANALOG ?
+               expected_data_bytes = ch->type == SR_PROBE_ANALOG ?
                                devc->analog_frame_size : devc->digital_frame_size;
 
                if (devc->num_block_bytes == 0) {
                                devc->analog_frame_size : devc->digital_frame_size;
 
                if (devc->num_block_bytes == 0) {
@@ -586,17 +586,17 @@ SR_PRIV int rigol_ds_receive(int fd, int revents, void *cb_data)
 
                devc->num_block_read += len;
 
 
                devc->num_block_read += len;
 
-               if (probe->type == SR_PROBE_ANALOG) {
-                       vref = devc->vert_reference[probe->index];
-                       vdiv = devc->vdiv[probe->index] / 25.6;
-                       offset = devc->vert_offset[probe->index];
+               if (ch->type == SR_PROBE_ANALOG) {
+                       vref = devc->vert_reference[ch->index];
+                       vdiv = devc->vdiv[ch->index] / 25.6;
+                       offset = devc->vert_offset[ch->index];
                        if (devc->model->series->protocol >= PROTOCOL_V3)
                                for (i = 0; i < len; i++)
                                        devc->data[i] = ((int)devc->buffer[i] - vref) * vdiv - offset;
                        else
                                for (i = 0; i < len; i++)
                                        devc->data[i] = (128 - devc->buffer[i]) * vdiv - offset;
                        if (devc->model->series->protocol >= PROTOCOL_V3)
                                for (i = 0; i < len; i++)
                                        devc->data[i] = ((int)devc->buffer[i] - vref) * vdiv - offset;
                        else
                                for (i = 0; i < len; i++)
                                        devc->data[i] = (128 - devc->buffer[i]) * vdiv - offset;
-                       analog.probes = g_slist_append(NULL, probe);
+                       analog.channels = g_slist_append(NULL, ch);
                        analog.num_samples = len;
                        analog.data = devc->data;
                        analog.mq = SR_MQ_VOLTAGE;
                        analog.num_samples = len;
                        analog.data = devc->data;
                        analog.mq = SR_MQ_VOLTAGE;
@@ -605,7 +605,7 @@ SR_PRIV int rigol_ds_receive(int fd, int revents, void *cb_data)
                        packet.type = SR_DF_ANALOG;
                        packet.payload = &analog;
                        sr_session_send(cb_data, &packet);
                        packet.type = SR_DF_ANALOG;
                        packet.payload = &analog;
                        sr_session_send(cb_data, &packet);
-                       g_slist_free(analog.probes);
+                       g_slist_free(analog.channels);
                } else {
                        logic.length = len;
                        logic.unitsize = 2;
                } else {
                        logic.length = len;
                        logic.unitsize = 2;
@@ -658,7 +658,7 @@ SR_PRIV int rigol_ds_receive(int fd, int revents, void *cb_data)
                                rigol_ds_config_set(sdi, ":WAV:END");
                }
 
                                rigol_ds_config_set(sdi, ":WAV:END");
                }
 
-               if (probe->type == SR_PROBE_ANALOG
+               if (ch->type == SR_PROBE_ANALOG
                                && devc->channel_entry->next != NULL) {
                        /* We got the frame for this analog channel, but
                         * there's another analog channel. */
                                && devc->channel_entry->next != NULL) {
                        /* We got the frame for this analog channel, but
                         * there's another analog channel. */
@@ -666,10 +666,10 @@ SR_PRIV int rigol_ds_receive(int fd, int revents, void *cb_data)
                        rigol_ds_channel_start(sdi);
                } else {
                        /* Done with all analog channels in this frame. */
                        rigol_ds_channel_start(sdi);
                } else {
                        /* Done with all analog channels in this frame. */
-                       if (devc->enabled_digital_probes
-                                       && devc->channel_entry != devc->enabled_digital_probes) {
+                       if (devc->enabled_digital_channels
+                                       && devc->channel_entry != devc->enabled_digital_channels) {
                                /* Now we need to get the digital data. */
                                /* Now we need to get the digital data. */
-                               devc->channel_entry = devc->enabled_digital_probes;
+                               devc->channel_entry = devc->enabled_digital_channels;
                                rigol_ds_channel_start(sdi);
                        } else {
                                /* Done with this frame. */
                                rigol_ds_channel_start(sdi);
                        } else {
                                /* Done with this frame. */
@@ -681,10 +681,10 @@ SR_PRIV int rigol_ds_receive(int fd, int revents, void *cb_data)
                                        sdi->driver->dev_acquisition_stop(sdi, cb_data);
                                } else {
                                        /* Get the next frame, starting with the first analog channel. */
                                        sdi->driver->dev_acquisition_stop(sdi, cb_data);
                                } else {
                                        /* Get the next frame, starting with the first analog channel. */
-                                       if (devc->enabled_analog_probes)
-                                               devc->channel_entry = devc->enabled_analog_probes;
+                                       if (devc->enabled_analog_channels)
+                                               devc->channel_entry = devc->enabled_analog_channels;
                                        else
                                        else
-                                               devc->channel_entry = devc->enabled_digital_probes;
+                                               devc->channel_entry = devc->enabled_digital_channels;
 
                                        rigol_ds_capture_start(sdi);
 
 
                                        rigol_ds_capture_start(sdi);
 
index a53903e04854bf32c3c24c2c4caa175214681ce2..458ae3be73041a77fe8af2590f31ab78dedcf82a 100644 (file)
@@ -102,8 +102,8 @@ struct dev_context {
        struct sr_channel_group digital_group;
 
        /* Acquisition settings */
        struct sr_channel_group digital_group;
 
        /* Acquisition settings */
-       GSList *enabled_analog_probes;
-       GSList *enabled_digital_probes;
+       GSList *enabled_analog_channels;
+       GSList *enabled_digital_channels;
        uint64_t limit_frames;
        void *cb_data;
        enum data_source data_source;
        uint64_t limit_frames;
        void *cb_data;
        enum data_source data_source;
index 2e47899de1979d7211ab1f86eb845d467e57378a..438d91a4501137067d9c5f4d8250e8210522818e 100644 (file)
@@ -55,7 +55,7 @@ static const int32_t hwcaps[] = {
        SR_CONF_CONTINUOUS,
 };
 
        SR_CONF_CONTINUOUS,
 };
 
-static const char *probe_names[] = {
+static const char *channel_names[] = {
        "0", "1", "2", "3", "4", "5", "6", "7", "8",
        "9", "10", "11", "12", "13", "14", "15",
        NULL,
        "0", "1", "2", "3", "4", "5", "6", "7", "8",
        "9", "10", "11", "12", "13", "14", "15",
        NULL,
@@ -136,7 +136,7 @@ static GSList *scan(GSList *options)
        struct dev_context *devc;
        struct sr_dev_inst *sdi;
        struct sr_usb_dev_inst *usb;
        struct dev_context *devc;
        struct sr_dev_inst *sdi;
        struct sr_usb_dev_inst *usb;
-       struct sr_channel *probe;
+       struct sr_channel *ch;
        struct sr_config *src;
        GSList *l, *devices, *conn_devices;
        struct libusb_device_descriptor des;
        struct sr_config *src;
        GSList *l, *devices, *conn_devices;
        struct libusb_device_descriptor des;
@@ -194,11 +194,11 @@ static GSList *scan(GSList *options)
                        return NULL;
                sdi->driver = di;
 
                        return NULL;
                sdi->driver = di;
 
-               for (j = 0; probe_names[j]; j++) {
-                       if (!(probe = sr_probe_new(j, SR_PROBE_LOGIC, TRUE,
-                                                  probe_names[j])))
+               for (j = 0; channel_names[j]; j++) {
+                       if (!(ch = sr_probe_new(j, SR_PROBE_LOGIC, TRUE,
+                                                  channel_names[j])))
                                return NULL;
                                return NULL;
-                       sdi->probes = g_slist_append(sdi->probes, probe);
+                       sdi->channels = g_slist_append(sdi->channels, ch);
                }
 
                if (!(devc = g_try_malloc0(sizeof(struct dev_context))))
                }
 
                if (!(devc = g_try_malloc0(sizeof(struct dev_context))))
@@ -621,25 +621,25 @@ static unsigned int get_timeout(struct dev_context *devc)
        return timeout + timeout / 4; /* Leave a headroom of 25% percent. */
 }
 
        return timeout + timeout / 4; /* Leave a headroom of 25% percent. */
 }
 
-static int configure_probes(const struct sr_dev_inst *sdi)
+static int configure_channels(const struct sr_dev_inst *sdi)
 {
        struct dev_context *devc;
 {
        struct dev_context *devc;
-       struct sr_channel *probe;
+       struct sr_channel *ch;
        GSList *l;
        GSList *l;
-       uint16_t probe_bit;
+       uint16_t channel_bit;
 
        devc = sdi->priv;
 
        devc->cur_channels = 0;
        devc->num_channels = 0;
 
        devc = sdi->priv;
 
        devc->cur_channels = 0;
        devc->num_channels = 0;
-       for (l = sdi->probes; l; l = l->next) {
-               probe = (struct sr_channel *)l->data;
-               if (probe->enabled == FALSE)
+       for (l = sdi->channels; l; l = l->next) {
+               ch = (struct sr_channel *)l->data;
+               if (ch->enabled == FALSE)
                        continue;
 
                        continue;
 
-               probe_bit = 1 << (probe->index);
+               channel_bit = 1 << (ch->index);
 
 
-               devc->cur_channels |= probe_bit;
+               devc->cur_channels |= channel_bit;
 
 #ifdef WORDS_BIGENDIAN
                /*
 
 #ifdef WORDS_BIGENDIAN
                /*
@@ -647,10 +647,10 @@ static int configure_probes(const struct sr_dev_inst *sdi)
                 * To speed things up during conversion, do the switcharoo
                 * here instead.
                 */
                 * To speed things up during conversion, do the switcharoo
                 * here instead.
                 */
-               probe_bit = 1 << (probe->index ^ 8);
+               channel_bit = 1 << (ch->index ^ 8);
 #endif
 
 #endif
 
-               devc->channel_masks[devc->num_channels++] = probe_bit;
+               devc->channel_masks[devc->num_channels++] = channel_bit;
        }
 
        return SR_OK;
        }
 
        return SR_OK;
@@ -700,8 +700,8 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi, void *cb_data)
        usb = sdi->conn;
 
        /* Configures devc->cur_channels. */
        usb = sdi->conn;
 
        /* Configures devc->cur_channels. */
-       if (configure_probes(sdi) != SR_OK) {
-               sr_err("Failed to configure probes.");
+       if (configure_channels(sdi) != SR_OK) {
+               sr_err("Failed to configure channels.");
                return SR_ERR;
        }
 
                return SR_ERR;
        }
 
index 2982aaac64813eb69e48209753e39c547e0a85af..09e0ffbcb3bd0a2342fa475697779ef235924e7f 100644 (file)
@@ -337,7 +337,7 @@ static GSList *sdmm_scan(const char *conn, const char *serialcomm, int dmm)
        struct sr_dev_inst *sdi;
        struct drv_context *drvc;
        struct dev_context *devc;
        struct sr_dev_inst *sdi;
        struct drv_context *drvc;
        struct dev_context *devc;
-       struct sr_channel *probe;
+       struct sr_channel *ch;
        struct sr_serial_dev_inst *serial;
        GSList *devices;
        int dropped, ret;
        struct sr_serial_dev_inst *serial;
        GSList *devices;
        int dropped, ret;
@@ -405,9 +405,9 @@ static GSList *sdmm_scan(const char *conn, const char *serialcomm, int dmm)
 
        sdi->priv = devc;
        sdi->driver = dmms[dmm].di;
 
        sdi->priv = devc;
        sdi->driver = dmms[dmm].di;
-       if (!(probe = sr_probe_new(0, SR_PROBE_ANALOG, TRUE, "P1")))
+       if (!(ch = sr_probe_new(0, SR_PROBE_ANALOG, TRUE, "P1")))
                goto scan_cleanup;
                goto scan_cleanup;
-       sdi->probes = g_slist_append(sdi->probes, probe);
+       sdi->channels = g_slist_append(sdi->channels, ch);
        drvc->instances = g_slist_append(drvc->instances, sdi);
        devices = g_slist_append(devices, sdi);
 
        drvc->instances = g_slist_append(drvc->instances, sdi);
        devices = g_slist_append(devices, sdi);
 
index 1c0f3f56b3dea21f1b40764a676328a5c31fff8a..36e69444d8f7a815ccdc9483ce856ec1442e3ae3 100644 (file)
@@ -48,7 +48,7 @@ static void handle_packet(const uint8_t *buf, struct sr_dev_inst *sdi,
 
        memset(&analog, 0, sizeof(struct sr_datafeed_analog));
 
 
        memset(&analog, 0, sizeof(struct sr_datafeed_analog));
 
-       analog.probes = sdi->probes;
+       analog.channels = sdi->channels;
        analog.num_samples = 1;
        analog.mq = -1;
 
        analog.num_samples = 1;
        analog.mq = -1;
 
index 525af58ed89ab36f6deb93c6963d4a28f4f4823b..3cff652ac5bf90da6ad7f7e0b6a1ff9cf4a52f4d 100644 (file)
@@ -72,21 +72,21 @@ static int init(struct sr_context *sr_ctx)
        return std_init(sr_ctx, di, LOG_PREFIX);
 }
 
        return std_init(sr_ctx, di, LOG_PREFIX);
 }
 
-static GSList *gen_probe_list(int num_probes)
+static GSList *gen_channel_list(int num_channels)
 {
        GSList *list;
 {
        GSList *list;
-       struct sr_channel *probe;
+       struct sr_channel *ch;
        int i;
        char name[8];
 
        list = NULL;
 
        int i;
        char name[8];
 
        list = NULL;
 
-       for (i = num_probes; i > 0; --i) {
-               /* The LWLA series simply number probes from CH1 to CHxx. */
+       for (i = num_channels; i > 0; --i) {
+               /* The LWLA series simply number channels from CH1 to CHxx. */
                g_snprintf(name, sizeof(name), "CH%d", i);
 
                g_snprintf(name, sizeof(name), "CH%d", i);
 
-               probe = sr_probe_new(i - 1, SR_PROBE_LOGIC, TRUE, name);
-               list = g_slist_prepend(list, probe);
+               ch = sr_probe_new(i - 1, SR_PROBE_LOGIC, TRUE, name);
+               list = g_slist_prepend(list, ch);
        }
 
        return list;
        }
 
        return list;
@@ -113,12 +113,12 @@ static struct sr_dev_inst *dev_inst_new(int device_index)
                return NULL;
        }
 
                return NULL;
        }
 
-       /* Enable all channels to match the default probe configuration. */
+       /* Enable all channels to match the default channel configuration. */
        devc->channel_mask = ALL_CHANNELS_MASK;
        devc->samplerate = DEFAULT_SAMPLERATE;
 
        sdi->priv = devc;
        devc->channel_mask = ALL_CHANNELS_MASK;
        devc->samplerate = DEFAULT_SAMPLERATE;
 
        sdi->priv = devc;
-       sdi->probes = gen_probe_list(NUM_PROBES);
+       sdi->channels = gen_channel_list(NUM_PROBES);
 
        return sdi;
 }
 
        return sdi;
 }
@@ -402,9 +402,9 @@ static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi,
 }
 
 static int config_probe_set(const struct sr_dev_inst *sdi,
 }
 
 static int config_probe_set(const struct sr_dev_inst *sdi,
-                           struct sr_channel *probe, unsigned int changes)
+                           struct sr_channel *ch, unsigned int changes)
 {
 {
-       uint64_t probe_bit;
+       uint64_t channel_bit;
        uint64_t trigger_mask;
        uint64_t trigger_values;
        uint64_t trigger_edge_mask;
        uint64_t trigger_mask;
        uint64_t trigger_values;
        uint64_t trigger_edge_mask;
@@ -414,46 +414,46 @@ static int config_probe_set(const struct sr_dev_inst *sdi,
        if (!devc)
                return SR_ERR_DEV_CLOSED;
 
        if (!devc)
                return SR_ERR_DEV_CLOSED;
 
-       if (probe->index < 0 || probe->index >= NUM_PROBES) {
-               sr_err("Probe index %d out of range.", probe->index);
+       if (ch->index < 0 || ch->index >= NUM_PROBES) {
+               sr_err("Channel index %d out of range.", ch->index);
                return SR_ERR_BUG;
        }
                return SR_ERR_BUG;
        }
-       probe_bit = (uint64_t)1 << probe->index;
+       channel_bit = (uint64_t)1 << ch->index;
 
        if ((changes & SR_PROBE_SET_ENABLED) != 0) {
 
        if ((changes & SR_PROBE_SET_ENABLED) != 0) {
-               /* Enable or disable input channel for this probe. */
-               if (probe->enabled)
-                       devc->channel_mask |= probe_bit;
+               /* Enable or disable input channel for this channel. */
+               if (ch->enabled)
+                       devc->channel_mask |= channel_bit;
                else
                else
-                       devc->channel_mask &= ~probe_bit;
+                       devc->channel_mask &= ~channel_bit;
        }
 
        if ((changes & SR_PROBE_SET_TRIGGER) != 0) {
        }
 
        if ((changes & SR_PROBE_SET_TRIGGER) != 0) {
-               trigger_mask = devc->trigger_mask & ~probe_bit;
-               trigger_values = devc->trigger_values & ~probe_bit;
-               trigger_edge_mask = devc->trigger_edge_mask & ~probe_bit;
+               trigger_mask = devc->trigger_mask & ~channel_bit;
+               trigger_values = devc->trigger_values & ~channel_bit;
+               trigger_edge_mask = devc->trigger_edge_mask & ~channel_bit;
 
 
-               if (probe->trigger && probe->trigger[0] != '\0') {
-                       if (probe->trigger[1] != '\0') {
+               if (ch->trigger && ch->trigger[0] != '\0') {
+                       if (ch->trigger[1] != '\0') {
                                sr_warn("Trigger configuration \"%s\" with "
                                        "multiple stages is not supported.",
                                sr_warn("Trigger configuration \"%s\" with "
                                        "multiple stages is not supported.",
-                                       probe->trigger);
+                                       ch->trigger);
                                return SR_ERR_ARG;
                        }
                                return SR_ERR_ARG;
                        }
-                       /* Enable trigger for this probe. */
-                       trigger_mask |= probe_bit;
+                       /* Enable trigger for this channel. */
+                       trigger_mask |= channel_bit;
 
                        /* Configure edge mask and trigger value. */
 
                        /* Configure edge mask and trigger value. */
-                       switch (probe->trigger[0]) {
-                       case '1': trigger_values |= probe_bit;
+                       switch (ch->trigger[0]) {
+                       case '1': trigger_values |= channel_bit;
                        case '0': break;
 
                        case '0': break;
 
-                       case 'r': trigger_values |= probe_bit;
-                       case 'f': trigger_edge_mask |= probe_bit;
+                       case 'r': trigger_values |= channel_bit;
+                       case 'f': trigger_edge_mask |= channel_bit;
                                  break;
                        default:
                                sr_warn("Trigger type '%c' is not supported.",
                                  break;
                        default:
                                sr_warn("Trigger type '%c' is not supported.",
-                                       probe->trigger[0]);
+                                       ch->trigger[0]);
                                return SR_ERR_ARG;
                        }
                }
                                return SR_ERR_ARG;
                        }
                }
index fa3b347cdf07f91b4166dfd5e9f9c49fccab4e11..9ba99129801693fd81373781310a582444e92211 100644 (file)
@@ -49,7 +49,7 @@ static GSList *scan(GSList *options)
        struct dev_context *devc;
        struct sr_serial_dev_inst *serial;
        struct sr_dev_inst *sdi;
        struct dev_context *devc;
        struct sr_serial_dev_inst *serial;
        struct sr_dev_inst *sdi;
-       struct sr_channel *probe;
+       struct sr_channel *ch;
        GSList *devices = NULL, *l;
        const char *conn = NULL, *serialcomm = NULL;
        uint8_t buf[292];
        GSList *devices = NULL, *l;
        const char *conn = NULL, *serialcomm = NULL;
        uint8_t buf[292];
@@ -107,56 +107,56 @@ static GSList *scan(GSList *options)
        sdi->priv = devc;
        sdi->driver = di;
 
        sdi->priv = devc;
        sdi->driver = di;
 
-       if (!(probe = sr_probe_new(0, SR_PROBE_ANALOG, TRUE, "P")))
+       if (!(ch = sr_probe_new(0, SR_PROBE_ANALOG, TRUE, "P")))
                goto scan_cleanup;
                goto scan_cleanup;
-       sdi->probes = g_slist_append(sdi->probes, probe);
+       sdi->channels = g_slist_append(sdi->channels, ch);
 
        if (devc->optarif == OPTARIF_BASE) {
 
        if (devc->optarif == OPTARIF_BASE) {
-               if (!(probe = sr_probe_new(0, SR_PROBE_ANALOG, TRUE, "BASE")))
+               if (!(ch = sr_probe_new(0, SR_PROBE_ANALOG, TRUE, "BASE")))
                        goto scan_cleanup;
                        goto scan_cleanup;
-               sdi->probes = g_slist_append(sdi->probes, probe);
+               sdi->channels = g_slist_append(sdi->channels, ch);
        } else if (devc->optarif == OPTARIF_HC) {
        } else if (devc->optarif == OPTARIF_HC) {
-               if (!(probe = sr_probe_new(0, SR_PROBE_ANALOG, TRUE, "HP")))
+               if (!(ch = sr_probe_new(0, SR_PROBE_ANALOG, TRUE, "HP")))
                        goto scan_cleanup;
                        goto scan_cleanup;
-               sdi->probes = g_slist_append(sdi->probes, probe);
-               if (!(probe = sr_probe_new(0, SR_PROBE_ANALOG, TRUE, "HC")))
+               sdi->channels = g_slist_append(sdi->channels, ch);
+               if (!(ch = sr_probe_new(0, SR_PROBE_ANALOG, TRUE, "HC")))
                        goto scan_cleanup;
                        goto scan_cleanup;
-               sdi->probes = g_slist_append(sdi->probes, probe);
+               sdi->channels = g_slist_append(sdi->channels, ch);
        } else if (devc->optarif == OPTARIF_EJP) {
        } else if (devc->optarif == OPTARIF_EJP) {
-               if (!(probe = sr_probe_new(0, SR_PROBE_ANALOG, TRUE, "HN")))
+               if (!(ch = sr_probe_new(0, SR_PROBE_ANALOG, TRUE, "HN")))
                        goto scan_cleanup;
                        goto scan_cleanup;
-               sdi->probes = g_slist_append(sdi->probes, probe);
-               if (!(probe = sr_probe_new(0, SR_PROBE_ANALOG, TRUE, "HPM")))
+               sdi->channels = g_slist_append(sdi->channels, ch);
+               if (!(ch = sr_probe_new(0, SR_PROBE_ANALOG, TRUE, "HPM")))
                        goto scan_cleanup;
                        goto scan_cleanup;
-               sdi->probes = g_slist_append(sdi->probes, probe);
+               sdi->channels = g_slist_append(sdi->channels, ch);
        } else if (devc->optarif == OPTARIF_BBR) {
        } else if (devc->optarif == OPTARIF_BBR) {
-               if (!(probe = sr_probe_new(0, SR_PROBE_ANALOG, TRUE, "HPJB")))
+               if (!(ch = sr_probe_new(0, SR_PROBE_ANALOG, TRUE, "HPJB")))
                        goto scan_cleanup;
                        goto scan_cleanup;
-               sdi->probes = g_slist_append(sdi->probes, probe);
-               if (!(probe = sr_probe_new(0, SR_PROBE_ANALOG, TRUE, "HPJW")))
+               sdi->channels = g_slist_append(sdi->channels, ch);
+               if (!(ch = sr_probe_new(0, SR_PROBE_ANALOG, TRUE, "HPJW")))
                        goto scan_cleanup;
                        goto scan_cleanup;
-               sdi->probes = g_slist_append(sdi->probes, probe);
-               if (!(probe = sr_probe_new(0, SR_PROBE_ANALOG, TRUE, "HPJR")))
+               sdi->channels = g_slist_append(sdi->channels, ch);
+               if (!(ch = sr_probe_new(0, SR_PROBE_ANALOG, TRUE, "HPJR")))
                        goto scan_cleanup;
                        goto scan_cleanup;
-               sdi->probes = g_slist_append(sdi->probes, probe);
-               if (!(probe = sr_probe_new(0, SR_PROBE_ANALOG, TRUE, "HCJB")))
+               sdi->channels = g_slist_append(sdi->channels, ch);
+               if (!(ch = sr_probe_new(0, SR_PROBE_ANALOG, TRUE, "HCJB")))
                        goto scan_cleanup;
                        goto scan_cleanup;
-               sdi->probes = g_slist_append(sdi->probes, probe);
-               if (!(probe = sr_probe_new(0, SR_PROBE_ANALOG, TRUE, "HCJW")))
+               sdi->channels = g_slist_append(sdi->channels, ch);
+               if (!(ch = sr_probe_new(0, SR_PROBE_ANALOG, TRUE, "HCJW")))
                        goto scan_cleanup;
                        goto scan_cleanup;
-               sdi->probes = g_slist_append(sdi->probes, probe);
-               if (!(probe = sr_probe_new(0, SR_PROBE_ANALOG, TRUE, "HCJR")))
+               sdi->channels = g_slist_append(sdi->channels, ch);
+               if (!(ch = sr_probe_new(0, SR_PROBE_ANALOG, TRUE, "HCJR")))
                        goto scan_cleanup;
                        goto scan_cleanup;
-               sdi->probes = g_slist_append(sdi->probes, probe);
+               sdi->channels = g_slist_append(sdi->channels, ch);
        }
 
        }
 
-       if (!(probe = sr_probe_new(0, SR_PROBE_ANALOG, TRUE, "IINST")))
+       if (!(ch = sr_probe_new(0, SR_PROBE_ANALOG, TRUE, "IINST")))
                goto scan_cleanup;
                goto scan_cleanup;
-       sdi->probes = g_slist_append(sdi->probes, probe);
+       sdi->channels = g_slist_append(sdi->channels, ch);
 
 
-       if (!(probe = sr_probe_new(0, SR_PROBE_ANALOG, TRUE, "PAPP")))
+       if (!(ch = sr_probe_new(0, SR_PROBE_ANALOG, TRUE, "PAPP")))
                goto scan_cleanup;
                goto scan_cleanup;
-       sdi->probes = g_slist_append(sdi->probes, probe);
+       sdi->channels = g_slist_append(sdi->channels, ch);
 
        drvc->instances = g_slist_append(drvc->instances, sdi);
        devices = g_slist_append(devices, sdi);
 
        drvc->instances = g_slist_append(drvc->instances, sdi);
        devices = g_slist_append(devices, sdi);
index 5e0fa5e5a526773ec2b64a1ddb1bc8ed53fcdae5..a610173d1aaaa20421d2716bf44b3e7eaf8f42cd 100644 (file)
@@ -39,37 +39,37 @@ static gboolean teleinfo_control_check(char *label, char *data, char control)
        return ((sum & 0x3F) + ' ') == control;
 }
 
        return ((sum & 0x3F) + ' ') == control;
 }
 
-static gint teleinfo_probe_compare(gconstpointer a, gconstpointer b)
+static gint teleinfo_channel_compare(gconstpointer a, gconstpointer b)
 {
 {
-       const struct sr_channel *probe = a;
+       const struct sr_channel *ch = a;
        const char *name = b;
        const char *name = b;
-       return strcmp(probe->name, name);
+       return strcmp(ch->name, name);
 }
 
 }
 
-static struct sr_channel *teleinfo_find_probe(struct sr_dev_inst *sdi,
+static struct sr_channel *teleinfo_find_channel(struct sr_dev_inst *sdi,
                                             const char *name)
 {
                                             const char *name)
 {
-       GSList *elem = g_slist_find_custom(sdi->probes, name,
-                                          teleinfo_probe_compare);
+       GSList *elem = g_slist_find_custom(sdi->channels, name,
+                                          teleinfo_channel_compare);
        return elem ? elem->data : NULL;
 }
 
        return elem ? elem->data : NULL;
 }
 
-static void teleinfo_send_value(struct sr_dev_inst *sdi, const char *probe_name,
+static void teleinfo_send_value(struct sr_dev_inst *sdi, const char *channel_name,
                                 float value, int mq, int unit)
 {
        struct dev_context *devc;
        struct sr_datafeed_packet packet;
        struct sr_datafeed_analog analog;
                                 float value, int mq, int unit)
 {
        struct dev_context *devc;
        struct sr_datafeed_packet packet;
        struct sr_datafeed_analog analog;
-       struct sr_channel *probe;
+       struct sr_channel *ch;
 
        devc = sdi->priv;
 
        devc = sdi->priv;
-       probe = teleinfo_find_probe(sdi, probe_name);
+       ch = teleinfo_find_channel(sdi, channel_name);
 
 
-       if (!probe || !probe->enabled)
+       if (!ch || !ch->enabled)
                return;
 
        memset(&analog, 0, sizeof(struct sr_datafeed_analog));
                return;
 
        memset(&analog, 0, sizeof(struct sr_datafeed_analog));
-       analog.probes = g_slist_append(analog.probes, probe);
+       analog.channels = g_slist_append(analog.channels, ch);
        analog.num_samples = 1;
        analog.mq = mq;
        analog.unit = unit;
        analog.num_samples = 1;
        analog.mq = mq;
        analog.unit = unit;
@@ -78,7 +78,7 @@ static void teleinfo_send_value(struct sr_dev_inst *sdi, const char *probe_name,
        packet.type = SR_DF_ANALOG;
        packet.payload = &analog;
        sr_session_send(devc->session_cb_data, &packet);
        packet.type = SR_DF_ANALOG;
        packet.payload = &analog;
        sr_session_send(devc->session_cb_data, &packet);
-       g_slist_free(analog.probes);
+       g_slist_free(analog.channels);
 }
 
 static void teleinfo_handle_mesurement(struct sr_dev_inst *sdi,
 }
 
 static void teleinfo_handle_mesurement(struct sr_dev_inst *sdi,
index 613f0945f190916a74056af44d7307a18ca1b862..abe88ba4317629d74a25073b0ce5b727e6e07b88 100644 (file)
@@ -51,7 +51,7 @@ static GSList *scan(GSList *options)
        struct dev_context *devc;
        struct sr_dev_inst *sdi;
        struct sr_config *src;
        struct dev_context *devc;
        struct sr_dev_inst *sdi;
        struct sr_config *src;
-       struct sr_channel *probe;
+       struct sr_channel *ch;
        GSList *devices, *l;
        const char *conn, *serialcomm;
        struct sr_serial_dev_inst *serial;
        GSList *devices, *l;
        const char *conn, *serialcomm;
        struct sr_serial_dev_inst *serial;
@@ -106,12 +106,12 @@ static GSList *scan(GSList *options)
 
        sdi->priv = devc;
        sdi->driver = di;
 
        sdi->priv = devc;
        sdi->driver = di;
-       probe = sr_probe_new(0, SR_PROBE_ANALOG, TRUE, "P1");
-       if (!probe) {
-               sr_err("Failed to create probe.");
+       ch = sr_probe_new(0, SR_PROBE_ANALOG, TRUE, "P1");
+       if (!ch) {
+               sr_err("Failed to create channel.");
                return NULL;
        }
                return NULL;
        }
-       sdi->probes = g_slist_append(sdi->probes, probe);
+       sdi->channels = g_slist_append(sdi->channels, ch);
        drvc->instances = g_slist_append(drvc->instances, sdi);
        devices = g_slist_append(devices, sdi);
 
        drvc->instances = g_slist_append(drvc->instances, sdi);
        devices = g_slist_append(devices, sdi);
 
index b390598f93ebdaddce8c0055994ecb6c97d220fd..feeec69aa559c7f947eacc111952aa991cc9aa2e 100644 (file)
@@ -98,7 +98,7 @@ static void decode_packet(struct sr_dev_inst *sdi)
        parse_packet(devc->buf, &floatval, &analog);
 
        /* Send a sample packet with one analog value. */
        parse_packet(devc->buf, &floatval, &analog);
 
        /* Send a sample packet with one analog value. */
-       analog.probes = sdi->probes;
+       analog.channels = sdi->channels;
        analog.num_samples = 1;
        analog.data = &floatval;
        packet.type = SR_DF_ANALOG;
        analog.num_samples = 1;
        analog.data = &floatval;
        packet.type = SR_DF_ANALOG;
index 40c928c76bd8426522b33e5cbfc038b86799b450..be6c5e2af085b34de3e21e9039b97da3f1b78560 100644 (file)
@@ -181,7 +181,7 @@ static GSList *scan(GSList *options, int dmm)
        struct drv_context *drvc;
        struct sr_usb_dev_inst *usb;
        struct sr_config *src;
        struct drv_context *drvc;
        struct sr_usb_dev_inst *usb;
        struct sr_config *src;
-       struct sr_channel *probe;
+       struct sr_channel *ch;
        const char *conn;
 
        drvc = udmms[dmm].di->priv;
        const char *conn;
 
        drvc = udmms[dmm].di->priv;
@@ -221,9 +221,9 @@ static GSList *scan(GSList *options, int dmm)
                }
                sdi->priv = devc;
                sdi->driver = udmms[dmm].di;
                }
                sdi->priv = devc;
                sdi->driver = udmms[dmm].di;
-               if (!(probe = sr_probe_new(0, SR_PROBE_ANALOG, TRUE, "P1")))
+               if (!(ch = sr_probe_new(0, SR_PROBE_ANALOG, TRUE, "P1")))
                        return NULL;
                        return NULL;
-               sdi->probes = g_slist_append(sdi->probes, probe);
+               sdi->channels = g_slist_append(sdi->channels, ch);
 
                sdi->inst_type = SR_INST_USB;
                sdi->conn = usb;
 
                sdi->inst_type = SR_INST_USB;
                sdi->conn = usb;
index 5843d5e7535b6f66043e532132286e5b62d55e4b..ca2568e8661455274e8afbb7d72d102a1d81a313 100644 (file)
@@ -77,7 +77,7 @@ static void decode_packet(struct sr_dev_inst *sdi, int dmm, const uint8_t *buf,
                udmms[dmm].dmm_details(&analog, info);
 
        /* Send a sample packet with one analog value. */
                udmms[dmm].dmm_details(&analog, info);
 
        /* Send a sample packet with one analog value. */
-       analog.probes = sdi->probes;
+       analog.channels = sdi->channels;
        analog.num_samples = 1;
        analog.data = &floatval;
        packet.type = SR_DF_ANALOG;
        analog.num_samples = 1;
        analog.data = &floatval;
        packet.type = SR_DF_ANALOG;
index 67fecd327ac740ff9d485ad4210a7a8732e55579..352853d8d34cf6efc71c69a70149b1b0eb68bff2 100644 (file)
@@ -28,7 +28,7 @@ static const int32_t hwcaps[] = {
        SR_CONF_DATA_SOURCE,
 };
 
        SR_CONF_DATA_SOURCE,
 };
 
-static char *probes[] = {
+static char *channels[] = {
        "T1",
        "T2",
        "T1-T2",
        "T1",
        "T2",
        "T1-T2",
@@ -53,7 +53,7 @@ static GSList *scan(GSList *options)
        struct drv_context *drvc;
        struct dev_context *devc;
        struct sr_dev_inst *sdi;
        struct drv_context *drvc;
        struct dev_context *devc;
        struct sr_dev_inst *sdi;
-       struct sr_channel *probe;
+       struct sr_channel *ch;
        struct sr_config *src;
        GSList *usb_devices, *devices, *l;
        int i;
        struct sr_config *src;
        GSList *usb_devices, *devices, *l;
        int i;
@@ -86,12 +86,12 @@ static GSList *scan(GSList *options)
                        sdi->inst_type = SR_INST_USB;
                        sdi->conn = l->data;
                        for (i = 0; i < 3; i++) {
                        sdi->inst_type = SR_INST_USB;
                        sdi->conn = l->data;
                        for (i = 0; i < 3; i++) {
-                               if (!(probe = sr_probe_new(i, SR_PROBE_ANALOG, TRUE,
-                                               probes[i]))) {
-                                       sr_dbg("Probe malloc failed.");
+                               if (!(ch = sr_probe_new(i, SR_PROBE_ANALOG, TRUE,
+                                               channels[i]))) {
+                                       sr_dbg("Channel malloc failed.");
                                        return NULL;
                                }
                                        return NULL;
                                }
-                               sdi->probes = g_slist_append(sdi->probes, probe);
+                               sdi->channels = g_slist_append(sdi->channels, ch);
                        }
 
                        if (!(devc = g_try_malloc(sizeof(struct dev_context)))) {
                        }
 
                        if (!(devc = g_try_malloc(sizeof(struct dev_context)))) {
index 52c628922bf5b063642bb607931d36ed015d4d34..95323a67f8c77e9a16008c6d59188fc7213a220e 100644 (file)
@@ -82,7 +82,7 @@ static void process_packet(struct sr_dev_inst *sdi)
        is_valid = TRUE;
        if (devc->packet[1] == 0x3b && devc->packet[2] == 0x3b
                        && devc->packet[3] == 0x3b && devc->packet[4] == 0x3b)
        is_valid = TRUE;
        if (devc->packet[1] == 0x3b && devc->packet[2] == 0x3b
                        && devc->packet[3] == 0x3b && devc->packet[4] == 0x3b)
-               /* No measurement: missing probe, empty storage location, ... */
+               /* No measurement: missing channel, empty storage location, ... */
                is_valid = FALSE;
 
        temp = parse_temperature(devc->packet + 1);
                is_valid = FALSE;
 
        temp = parse_temperature(devc->packet + 1);
@@ -109,21 +109,21 @@ static void process_packet(struct sr_dev_inst *sdi)
                }
                switch (devc->packet[13] - 0x30) {
                case 0:
                }
                switch (devc->packet[13] - 0x30) {
                case 0:
-                       /* Probe T1. */
-                       analog.probes = g_slist_append(NULL, g_slist_nth_data(sdi->probes, 0));
+                       /* Channel T1. */
+                       analog.channels = g_slist_append(NULL, g_slist_nth_data(sdi->channels, 0));
                        break;
                case 1:
                        break;
                case 1:
-                       /* Probe T2. */
-                       analog.probes = g_slist_append(NULL, g_slist_nth_data(sdi->probes, 1));
+                       /* Channel T2. */
+                       analog.channels = g_slist_append(NULL, g_slist_nth_data(sdi->channels, 1));
                        break;
                case 2:
                case 3:
                        break;
                case 2:
                case 3:
-                       /* Probe T1-T2. */
-                       analog.probes = g_slist_append(NULL, g_slist_nth_data(sdi->probes, 2));
+                       /* Channel T1-T2. */
+                       analog.channels = g_slist_append(NULL, g_slist_nth_data(sdi->channels, 2));
                        analog.mqflags |= SR_MQFLAG_RELATIVE;
                        break;
                default:
                        analog.mqflags |= SR_MQFLAG_RELATIVE;
                        break;
                default:
-                       sr_err("Unknown probe 0x%.2x.", devc->packet[13]);
+                       sr_err("Unknown channel 0x%.2x.", devc->packet[13]);
                        is_valid = FALSE;
                }
                if (is_valid) {
                        is_valid = FALSE;
                }
                if (is_valid) {
@@ -132,7 +132,7 @@ static void process_packet(struct sr_dev_inst *sdi)
                        packet.type = SR_DF_ANALOG;
                        packet.payload = &analog;
                        sr_session_send(devc->cb_data, &packet);
                        packet.type = SR_DF_ANALOG;
                        packet.payload = &analog;
                        sr_session_send(devc->cb_data, &packet);
-                       g_slist_free(analog.probes);
+                       g_slist_free(analog.channels);
                }
        }
 
                }
        }
 
index 5d772e89428820a320afc97b26868a06c9a4647a..6da326f635e8edae5708df51b7bc8a038c802146 100644 (file)
@@ -56,7 +56,7 @@ static GSList *scan(GSList *options)
        struct drv_context *drvc;
        struct dev_context *devc;
        struct sr_dev_inst *sdi;
        struct drv_context *drvc;
        struct dev_context *devc;
        struct sr_dev_inst *sdi;
-       struct sr_channel *probe;
+       struct sr_channel *ch;
        struct libusb_device_descriptor des;
        libusb_device **devlist;
        GSList *devices;
        struct libusb_device_descriptor des;
        libusb_device **devlist;
        GSList *devices;
@@ -88,9 +88,9 @@ static GSList *scan(GSList *options)
                        return NULL;
                sdi->priv = devc;
 
                        return NULL;
                sdi->priv = devc;
 
-               if (!(probe = sr_probe_new(0, SR_PROBE_ANALOG, TRUE, "P1")))
+               if (!(ch = sr_probe_new(0, SR_PROBE_ANALOG, TRUE, "P1")))
                        return NULL;
                        return NULL;
-               sdi->probes = g_slist_append(NULL, probe);
+               sdi->channels = g_slist_append(NULL, ch);
 
                if (!(sdi->conn = sr_usb_dev_inst_new(libusb_get_bus_number(devlist[i]),
                                libusb_get_device_address(devlist[i]), NULL)))
 
                if (!(sdi->conn = sr_usb_dev_inst_new(libusb_get_bus_number(devlist[i]),
                                libusb_get_device_address(devlist[i]), NULL)))
index a18f0a5b9922f4fb5a7d21d3998f1df511e2e76b..6af51419326694c6241c349b850bb5c04a70a393 100644 (file)
@@ -252,7 +252,7 @@ static void decode_buf(struct sr_dev_inst *sdi, unsigned char *data)
        if (is_relative)
                analog.mqflags |= SR_MQFLAG_RELATIVE;
 
        if (is_relative)
                analog.mqflags |= SR_MQFLAG_RELATIVE;
 
-       analog.probes = sdi->probes;
+       analog.channels = sdi->channels;
        analog.num_samples = 1;
        analog.data = &fvalue;
        packet.type = SR_DF_ANALOG;
        analog.num_samples = 1;
        analog.data = &fvalue;
        packet.type = SR_DF_ANALOG;
index f30551e828e5287531d1c7e3e9d8508b1c3bec0f..69e1441158ea4428934b27aad13e2a00e735e373 100644 (file)
@@ -62,10 +62,10 @@ static const int32_t hwcaps[] = {
 };
 
 /*
 };
 
 /*
- * ZEROPLUS LAP-C (16032) numbers the 16 probes A0-A7 and B0-B7.
+ * ZEROPLUS LAP-C (16032) numbers the 16 channels A0-A7 and B0-B7.
  * We currently ignore other untested/unsupported devices here.
  */
  * We currently ignore other untested/unsupported devices here.
  */
-static const char *probe_names[] = {
+static const char *channel_names[] = {
        "A0", "A1", "A2", "A3", "A4", "A5", "A6", "A7",
        "B0", "B1", "B2", "B3", "B4", "B5", "B6", "B7",
        "C0", "C1", "C2", "C3", "C4", "C5", "C6", "C7",
        "A0", "A1", "A2", "A3", "A4", "A5", "A6", "A7",
        "B0", "B1", "B2", "B3", "B4", "B5", "B6", "B7",
        "C0", "C1", "C2", "C3", "C4", "C5", "C6", "C7",
@@ -124,37 +124,37 @@ const uint64_t samplerates_200[] = {
 static int dev_close(struct sr_dev_inst *sdi);
 
 #if 0
 static int dev_close(struct sr_dev_inst *sdi);
 
 #if 0
-static int configure_probes(const struct sr_dev_inst *sdi)
+static int configure_channels(const struct sr_dev_inst *sdi)
 {
        struct dev_context *devc;
 {
        struct dev_context *devc;
-       const struct sr_channel *probe;
+       const struct sr_channel *ch;
        const GSList *l;
        const GSList *l;
-       int probe_bit, stage, i;
+       int channel_bit, stage, i;
        char *tc;
 
        /* Note: sdi and sdi->priv are non-NULL, the caller checked this. */
        devc = sdi->priv;
 
        char *tc;
 
        /* Note: sdi and sdi->priv are non-NULL, the caller checked this. */
        devc = sdi->priv;
 
-       devc->probe_mask = 0;
+       devc->channel_mask = 0;
        for (i = 0; i < NUM_TRIGGER_STAGES; i++) {
                devc->trigger_mask[i] = 0;
                devc->trigger_value[i] = 0;
        }
 
        stage = -1;
        for (i = 0; i < NUM_TRIGGER_STAGES; i++) {
                devc->trigger_mask[i] = 0;
                devc->trigger_value[i] = 0;
        }
 
        stage = -1;
-       for (l = sdi->probes; l; l = l->next) {
-               probe = (struct sr_channel *)l->data;
-               if (probe->enabled == FALSE)
+       for (l = sdi->channels; l; l = l->next) {
+               ch = (struct sr_channel *)l->data;
+               if (ch->enabled == FALSE)
                        continue;
                        continue;
-               probe_bit = 1 << (probe->index);
-               devc->probe_mask |= probe_bit;
+               channel_bit = 1 << (ch->index);
+               devc->channel_mask |= channel_bit;
 
 
-               if (probe->trigger) {
+               if (ch->trigger) {
                        stage = 0;
                        stage = 0;
-                       for (tc = probe->trigger; *tc; tc++) {
-                               devc->trigger_mask[stage] |= probe_bit;
+                       for (tc = ch->trigger; *tc; tc++) {
+                               devc->trigger_mask[stage] |= channel_bit;
                                if (*tc == '1')
                                if (*tc == '1')
-                                       devc->trigger_value[stage] |= probe_bit;
+                                       devc->trigger_value[stage] |= channel_bit;
                                stage++;
                                if (stage > NUM_TRIGGER_STAGES)
                                        return SR_ERR;
                                stage++;
                                if (stage > NUM_TRIGGER_STAGES)
                                        return SR_ERR;
@@ -166,23 +166,23 @@ static int configure_probes(const struct sr_dev_inst *sdi)
 }
 #endif
 
 }
 #endif
 
-static int configure_probes(const struct sr_dev_inst *sdi)
+static int configure_channels(const struct sr_dev_inst *sdi)
 {
        struct dev_context *devc;
        const GSList *l;
 {
        struct dev_context *devc;
        const GSList *l;
-       const struct sr_channel *probe;
+       const struct sr_channel *ch;
        char *tc;
        int type;
 
        /* Note: sdi and sdi->priv are non-NULL, the caller checked this. */
        devc = sdi->priv;
 
        char *tc;
        int type;
 
        /* Note: sdi and sdi->priv are non-NULL, the caller checked this. */
        devc = sdi->priv;
 
-       for (l = sdi->probes; l; l = l->next) {
-               probe = (struct sr_channel *)l->data;
-               if (probe->enabled == FALSE)
+       for (l = sdi->channels; l; l = l->next) {
+               ch = (struct sr_channel *)l->data;
+               if (ch->enabled == FALSE)
                        continue;
 
                        continue;
 
-               if ((tc = probe->trigger)) {
+               if ((tc = ch->trigger)) {
                        switch (*tc) {
                        case '1':
                                type = TRIGGER_HIGH;
                        switch (*tc) {
                        case '1':
                                type = TRIGGER_HIGH;
@@ -204,7 +204,7 @@ static int configure_probes(const struct sr_dev_inst *sdi)
                        default:
                                return SR_ERR;
                        }
                        default:
                                return SR_ERR;
                        }
-                       analyzer_add_trigger(probe->index, type);
+                       analyzer_add_trigger(ch->index, type);
                        devc->trigger = 1;
                }
        }
                        devc->trigger = 1;
                }
        }
@@ -247,7 +247,7 @@ static int init(struct sr_context *sr_ctx)
 static GSList *scan(GSList *options)
 {
        struct sr_dev_inst *sdi;
 static GSList *scan(GSList *options)
 {
        struct sr_dev_inst *sdi;
-       struct sr_channel *probe;
+       struct sr_channel *ch;
        struct drv_context *drvc;
        struct dev_context *devc;
        const struct zp_model *prof;
        struct drv_context *drvc;
        struct dev_context *devc;
        const struct zp_model *prof;
@@ -314,12 +314,12 @@ static GSList *scan(GSList *options)
                devc->memory_size = MEMORY_SIZE_8K;
                // memset(devc->trigger_buffer, 0, NUM_TRIGGER_STAGES);
 
                devc->memory_size = MEMORY_SIZE_8K;
                // memset(devc->trigger_buffer, 0, NUM_TRIGGER_STAGES);
 
-               /* Fill in probelist according to this device's profile. */
+               /* Fill in channellist according to this device's profile. */
                for (j = 0; j < devc->num_channels; j++) {
                for (j = 0; j < devc->num_channels; j++) {
-                       if (!(probe = sr_probe_new(j, SR_PROBE_LOGIC, TRUE,
-                                       probe_names[j])))
+                       if (!(ch = sr_probe_new(j, SR_PROBE_LOGIC, TRUE,
+                                       channel_names[j])))
                                return NULL;
                                return NULL;
-                       sdi->probes = g_slist_append(sdi->probes, probe);
+                       sdi->channels = g_slist_append(sdi->channels, ch);
                }
 
                devices = g_slist_append(devices, sdi);
                }
 
                devices = g_slist_append(devices, sdi);
@@ -634,8 +634,8 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi,
                return SR_ERR_ARG;
        }
 
                return SR_ERR_ARG;
        }
 
-       if (configure_probes(sdi) != SR_OK) {
-               sr_err("Failed to configure probes.");
+       if (configure_channels(sdi) != SR_OK) {
+               sr_err("Failed to configure channels.");
                return SR_ERR;
        }
 
                return SR_ERR;
        }
 
index 09f82287bd87db9eddbed913611ce480b5b61460..4b55b332f702128fe7a53e06b742cfe3bdd9401c 100644 (file)
@@ -38,7 +38,7 @@ struct dev_context {
        int num_channels;
        int memory_size;
        unsigned int max_sample_depth;
        int num_channels;
        int memory_size;
        unsigned int max_sample_depth;
-       //uint8_t probe_mask;
+       //uint8_t channel_mask;
        //uint8_t trigger_mask[NUM_TRIGGER_STAGES];
        //uint8_t trigger_value[NUM_TRIGGER_STAGES];
        // uint8_t trigger_buffer[NUM_TRIGGER_STAGES];
        //uint8_t trigger_mask[NUM_TRIGGER_STAGES];
        //uint8_t trigger_value[NUM_TRIGGER_STAGES];
        // uint8_t trigger_buffer[NUM_TRIGGER_STAGES];
index 59b027ee8483031c2954415d61849fec1826501b..3f3f288a81fec43c3670d843f9338d8ec6110f0a 100644 (file)
@@ -45,8 +45,8 @@ static int format_match(const char *filename)
 
 static int init(struct sr_input *in, const char *filename)
 {
 
 static int init(struct sr_input *in, const char *filename)
 {
-       struct sr_channel *probe;
-       int num_probes, i;
+       struct sr_channel *ch;
+       int num_channels, i;
        char name[SR_MAX_PROBENAME_LEN + 1];
        char *param;
        struct context *ctx;
        char name[SR_MAX_PROBENAME_LEN + 1];
        char *param;
        struct context *ctx;
@@ -58,14 +58,14 @@ static int init(struct sr_input *in, const char *filename)
                return SR_ERR_MALLOC;
        }
 
                return SR_ERR_MALLOC;
        }
 
-       num_probes = DEFAULT_NUM_PROBES;
+       num_channels = DEFAULT_NUM_PROBES;
        ctx->samplerate = 0;
 
        if (in->param) {
        ctx->samplerate = 0;
 
        if (in->param) {
-               param = g_hash_table_lookup(in->param, "numprobes");
+               param = g_hash_table_lookup(in->param, "numchannels");
                if (param) {
                if (param) {
-                       num_probes = strtoul(param, NULL, 10);
-                       if (num_probes < 1)
+                       num_channels = strtoul(param, NULL, 10);
+                       if (num_channels < 1)
                                return SR_ERR;
                }
 
                                return SR_ERR;
                }
 
@@ -80,12 +80,12 @@ static int init(struct sr_input *in, const char *filename)
        in->sdi = sr_dev_inst_new(0, SR_ST_ACTIVE, NULL, NULL, NULL);
        in->internal = ctx;
 
        in->sdi = sr_dev_inst_new(0, SR_ST_ACTIVE, NULL, NULL, NULL);
        in->internal = ctx;
 
-       for (i = 0; i < num_probes; i++) {
+       for (i = 0; i < num_channels; i++) {
                snprintf(name, SR_MAX_PROBENAME_LEN, "%d", i);
                /* TODO: Check return value. */
                snprintf(name, SR_MAX_PROBENAME_LEN, "%d", i);
                /* TODO: Check return value. */
-               if (!(probe = sr_probe_new(i, SR_PROBE_LOGIC, TRUE, name)))
+               if (!(ch = sr_probe_new(i, SR_PROBE_LOGIC, TRUE, name)))
                        return SR_ERR;
                        return SR_ERR;
-               in->sdi->probes = g_slist_append(in->sdi->probes, probe);
+               in->sdi->channels = g_slist_append(in->sdi->channels, ch);
        }
 
        return SR_OK;
        }
 
        return SR_OK;
@@ -98,7 +98,7 @@ static int loadfile(struct sr_input *in, const char *filename)
        struct sr_datafeed_logic logic;
        struct sr_config *src;
        unsigned char buffer[CHUNKSIZE];
        struct sr_datafeed_logic logic;
        struct sr_config *src;
        unsigned char buffer[CHUNKSIZE];
-       int fd, size, num_probes;
+       int fd, size, num_channels;
        struct context *ctx;
 
        ctx = in->internal;
        struct context *ctx;
 
        ctx = in->internal;
@@ -106,7 +106,7 @@ static int loadfile(struct sr_input *in, const char *filename)
        if ((fd = open(filename, O_RDONLY)) == -1)
                return SR_ERR;
 
        if ((fd = open(filename, O_RDONLY)) == -1)
                return SR_ERR;
 
-       num_probes = g_slist_length(in->sdi->probes);
+       num_channels = g_slist_length(in->sdi->channels);
 
        /* Send header packet to the session bus. */
        std_session_send_df_header(in->sdi, LOG_PREFIX);
 
        /* Send header packet to the session bus. */
        std_session_send_df_header(in->sdi, LOG_PREFIX);
@@ -124,7 +124,7 @@ static int loadfile(struct sr_input *in, const char *filename)
        /* Chop up the input file into chunks & send it to the session bus. */
        packet.type = SR_DF_LOGIC;
        packet.payload = &logic;
        /* Chop up the input file into chunks & send it to the session bus. */
        packet.type = SR_DF_LOGIC;
        packet.payload = &logic;
-       logic.unitsize = (num_probes + 7) / 8;
+       logic.unitsize = (num_channels + 7) / 8;
        logic.data = buffer;
        while ((size = read(fd, buffer, CHUNKSIZE)) > 0) {
                logic.length = size;
        logic.data = buffer;
        while ((size = read(fd, buffer, CHUNKSIZE)) > 0) {
                logic.length = size;
index 620b5aa3e1301bd841ad7fe0784484cfca803ad3..43004401e697c5a6b2073cc26e0ed1342bd06d30 100644 (file)
@@ -96,20 +96,20 @@ static int format_match(const char *filename)
 
 static int init(struct sr_input *in, const char *filename)
 {
 
 static int init(struct sr_input *in, const char *filename)
 {
-       struct sr_channel *probe;
-       int num_probes, i;
+       struct sr_channel *ch;
+       int num_channels, i;
        char name[SR_MAX_PROBENAME_LEN + 1];
        char *param;
 
        (void)filename;
 
        char name[SR_MAX_PROBENAME_LEN + 1];
        char *param;
 
        (void)filename;
 
-       num_probes = DEFAULT_NUM_PROBES;
+       num_channels = DEFAULT_NUM_PROBES;
 
        if (in->param) {
 
        if (in->param) {
-               param = g_hash_table_lookup(in->param, "numprobes");
+               param = g_hash_table_lookup(in->param, "numchannels");
                if (param) {
                if (param) {
-                       num_probes = strtoul(param, NULL, 10);
-                       if (num_probes < 1) {
+                       num_channels = strtoul(param, NULL, 10);
+                       if (num_channels < 1) {
                                sr_err("%s: strtoul failed", __func__);
                                return SR_ERR;
                        }
                                sr_err("%s: strtoul failed", __func__);
                                return SR_ERR;
                        }
@@ -119,12 +119,12 @@ static int init(struct sr_input *in, const char *filename)
        /* Create a virtual device. */
        in->sdi = sr_dev_inst_new(0, SR_ST_ACTIVE, NULL, NULL, NULL);
 
        /* Create a virtual device. */
        in->sdi = sr_dev_inst_new(0, SR_ST_ACTIVE, NULL, NULL, NULL);
 
-       for (i = 0; i < num_probes; i++) {
+       for (i = 0; i < num_channels; i++) {
                snprintf(name, SR_MAX_PROBENAME_LEN, "%d", i);
                /* TODO: Check return value. */
                snprintf(name, SR_MAX_PROBENAME_LEN, "%d", i);
                /* TODO: Check return value. */
-               if (!(probe = sr_probe_new(i, SR_PROBE_LOGIC, TRUE, name)))
+               if (!(ch = sr_probe_new(i, SR_PROBE_LOGIC, TRUE, name)))
                        return SR_ERR;
                        return SR_ERR;
-               in->sdi->probes = g_slist_append(in->sdi->probes, probe);
+               in->sdi->channels = g_slist_append(in->sdi->channels, ch);
        }
 
        return SR_OK;
        }
 
        return SR_OK;
@@ -137,7 +137,7 @@ static int loadfile(struct sr_input *in, const char *filename)
        struct sr_datafeed_logic logic;
        struct sr_config *src;
        uint8_t buf[PACKET_SIZE], divcount;
        struct sr_datafeed_logic logic;
        struct sr_config *src;
        uint8_t buf[PACKET_SIZE], divcount;
-       int i, fd, size, num_probes;
+       int i, fd, size, num_channels;
        uint64_t samplerate;
 
        /* TODO: Use glib functions! GIOChannel, g_fopen, etc. */
        uint64_t samplerate;
 
        /* TODO: Use glib functions! GIOChannel, g_fopen, etc. */
@@ -146,7 +146,7 @@ static int loadfile(struct sr_input *in, const char *filename)
                return SR_ERR;
        }
 
                return SR_ERR;
        }
 
-       num_probes = g_slist_length(in->sdi->probes);
+       num_channels = g_slist_length(in->sdi->channels);
 
        /* Seek to the end of the file, and read the divcount byte. */
        divcount = 0x00; /* TODO: Don't hardcode! */
 
        /* Seek to the end of the file, and read the divcount byte. */
        divcount = 0x00; /* TODO: Don't hardcode! */
@@ -176,7 +176,7 @@ static int loadfile(struct sr_input *in, const char *filename)
        sr_dbg("%s: sending SR_DF_LOGIC data packets", __func__);
        packet.type = SR_DF_LOGIC;
        packet.payload = &logic;
        sr_dbg("%s: sending SR_DF_LOGIC data packets", __func__);
        packet.type = SR_DF_LOGIC;
        packet.payload = &logic;
-       logic.unitsize = (num_probes + 7) / 8;
+       logic.unitsize = (num_channels + 7) / 8;
        logic.data = buf;
 
        /* Send 8MB of total data to the session bus in small chunks. */
        logic.data = buf;
 
        /* Send 8MB of total data to the session bus in small chunks. */
index 3b394d0b54a91bb12e38a2e29f4d9c1a691d2be9..a7eee4b24ee7eac32069a8ad9ac25ad315da9392 100644 (file)
  *                single column mode and enables single column mode. Multi
  *                column mode is used if this parameter is omitted.
  *
  *                single column mode and enables single column mode. Multi
  *                column mode is used if this parameter is omitted.
  *
- * numprobes:     Specifies the number of probes to use. In multi column mode
- *                the number of probes are the number of columns and in single
+ * numchannels:   Specifies the number of channels to use. In multi column mode
+ *                the number of channels are the number of columns and in single
  *                column mode the number of bits (LSB first) beginning at
  *                column mode the number of bits (LSB first) beginning at
- *                'first-probe'.
+ *                'first-channel'.
  *
  * delimiter:     Specifies the delimiter for columns. Must be at least one
  *                character. Comma is used as default delimiter.
  *
  * delimiter:     Specifies the delimiter for columns. Must be at least one
  *                character. Comma is used as default delimiter.
  * samplerate:    Samplerate which the sample data was captured with. Default
  *                value is 0.
  *
  * samplerate:    Samplerate which the sample data was captured with. Default
  *                value is 0.
  *
- * first-probe:   Column number of the first probe in multi column mode and
- *                position of the bit for the first probe in single column mode.
+ * first-channel: Column number of the first channel in multi column mode and
+ *                position of the bit for the first channel in single column mode.
  *                Default value is 0.
  *
  * header:        Determines if the first line should be treated as header
  *                Default value is 0.
  *
  * header:        Determines if the first line should be treated as header
- *                and used for probe names in multi column mode. Empty header
- *                names will be replaced by the probe number. If enabled in
+ *                and used for channel names in multi column mode. Empty header
+ *                names will be replaced by the channel number. If enabled in
  *                single column mode the first line will be skipped. Usage of
  *                header is disabled by default.
  *
  *                single column mode the first line will be skipped. Usage of
  *                header is disabled by default.
  *
@@ -77,8 +77,8 @@ struct context {
        /* Current selected samplerate. */
        uint64_t samplerate;
 
        /* Current selected samplerate. */
        uint64_t samplerate;
 
-       /* Number of probes. */
-       gsize num_probes;
+       /* Number of channels. */
+       gsize num_channels;
 
        /* Column delimiter character(s). */
        GString *delimiter;
 
        /* Column delimiter character(s). */
        GString *delimiter;
@@ -94,23 +94,23 @@ struct context {
 
        /*
         * Number of the first column to parse. Equivalent to the number of the
 
        /*
         * Number of the first column to parse. Equivalent to the number of the
-        * first probe in multi column mode and the single column number in
+        * first channel in multi column mode and the single column number in
         * single column mode.
         */
        gsize first_column;
 
        /*
         * single column mode.
         */
        gsize first_column;
 
        /*
-        * Column number of the first probe in multi column mode and position of
-        * the bit for the first probe in single column mode.
+        * Column number of the first channel in multi column mode and position of
+        * the bit for the first channel in single column mode.
         */
         */
-       gsize first_probe;
+       gsize first_channel;
 
        /* Line number to start processing. */
        gsize start_line;
 
        /*
         * Determines if the first line should be treated as header and used for
 
        /* Line number to start processing. */
        gsize start_line;
 
        /*
         * Determines if the first line should be treated as header and used for
-        * probe names in multi column mode.
+        * channel names in multi column mode.
         */
        gboolean header;
 
         */
        gboolean header;
 
@@ -203,11 +203,11 @@ static int parse_binstr(const char *str, struct context *ctx)
        }
 
        /* Clear buffer in order to set bits only. */
        }
 
        /* Clear buffer in order to set bits only. */
-       memset(ctx->sample_buffer, 0, (ctx->num_probes + 7) >> 3);
+       memset(ctx->sample_buffer, 0, (ctx->num_channels + 7) >> 3);
 
 
-       i = ctx->first_probe;
+       i = ctx->first_channel;
 
 
-       for (j = 0; i < length && j < ctx->num_probes; i++, j++) {
+       for (j = 0; i < length && j < ctx->num_channels; i++, j++) {
                if (str[length - i - 1] == '1') {
                        ctx->sample_buffer[j / 8] |= (1 << (j % 8));
                } else if (str[length - i - 1] != '0') {
                if (str[length - i - 1] == '1') {
                        ctx->sample_buffer[j / 8] |= (1 << (j % 8));
                } else if (str[length - i - 1] != '0') {
@@ -235,12 +235,12 @@ static int parse_hexstr(const char *str, struct context *ctx)
        }
 
        /* Clear buffer in order to set bits only. */
        }
 
        /* Clear buffer in order to set bits only. */
-       memset(ctx->sample_buffer, 0, (ctx->num_probes + 7) >> 3);
+       memset(ctx->sample_buffer, 0, (ctx->num_channels + 7) >> 3);
 
        /* Calculate the position of the first hexadecimal digit. */
 
        /* Calculate the position of the first hexadecimal digit. */
-       i = ctx->first_probe / 4;
+       i = ctx->first_channel / 4;
 
 
-       for (j = 0; i < length && j < ctx->num_probes; i++) {
+       for (j = 0; i < length && j < ctx->num_channels; i++) {
                c = str[length - i - 1];
 
                if (!g_ascii_isxdigit(c)) {
                c = str[length - i - 1];
 
                if (!g_ascii_isxdigit(c)) {
@@ -251,9 +251,9 @@ static int parse_hexstr(const char *str, struct context *ctx)
 
                value = g_ascii_xdigit_value(c);
 
 
                value = g_ascii_xdigit_value(c);
 
-               k = (ctx->first_probe + j) % 4;
+               k = (ctx->first_channel + j) % 4;
 
 
-               for (; j < ctx->num_probes && k < 4; k++) {
+               for (; j < ctx->num_channels && k < 4; k++) {
                        if (value & (1 << k))
                                ctx->sample_buffer[j / 8] |= (1 << (j % 8));
 
                        if (value & (1 << k))
                                ctx->sample_buffer[j / 8] |= (1 << (j % 8));
 
@@ -279,12 +279,12 @@ static int parse_octstr(const char *str, struct context *ctx)
        }
 
        /* Clear buffer in order to set bits only. */
        }
 
        /* Clear buffer in order to set bits only. */
-       memset(ctx->sample_buffer, 0, (ctx->num_probes + 7) >> 3);
+       memset(ctx->sample_buffer, 0, (ctx->num_channels + 7) >> 3);
 
        /* Calculate the position of the first octal digit. */
 
        /* Calculate the position of the first octal digit. */
-       i = ctx->first_probe / 3;
+       i = ctx->first_channel / 3;
 
 
-       for (j = 0; i < length && j < ctx->num_probes; i++) {
+       for (j = 0; i < length && j < ctx->num_channels; i++) {
                c = str[length - i - 1];
 
                if (c < '0' || c > '7') {
                c = str[length - i - 1];
 
                if (c < '0' || c > '7') {
@@ -295,9 +295,9 @@ static int parse_octstr(const char *str, struct context *ctx)
 
                value = g_ascii_xdigit_value(c);
 
 
                value = g_ascii_xdigit_value(c);
 
-               k = (ctx->first_probe + j) % 3;
+               k = (ctx->first_channel + j) % 3;
 
 
-               for (; j < ctx->num_probes && k < 3; k++) {
+               for (; j < ctx->num_channels && k < 3; k++) {
                        if (value & (1 << k))
                                ctx->sample_buffer[j / 8] |= (1 << (j % 8));
 
                        if (value & (1 << k))
                                ctx->sample_buffer[j / 8] |= (1 << (j % 8));
 
@@ -361,18 +361,18 @@ static int parse_multi_columns(char **columns, struct context *ctx)
        gsize i;
 
        /* Clear buffer in order to set bits only. */
        gsize i;
 
        /* Clear buffer in order to set bits only. */
-       memset(ctx->sample_buffer, 0, (ctx->num_probes + 7) >> 3);
+       memset(ctx->sample_buffer, 0, (ctx->num_channels + 7) >> 3);
 
 
-       for (i = 0; i < ctx->num_probes; i++) {
+       for (i = 0; i < ctx->num_channels; i++) {
                if (columns[i][0] == '1') {
                        ctx->sample_buffer[i / 8] |= (1 << (i % 8));
                } else if (!strlen(columns[i])) {
                        sr_err("Column %zu in line %zu is empty.",
                if (columns[i][0] == '1') {
                        ctx->sample_buffer[i / 8] |= (1 << (i % 8));
                } else if (!strlen(columns[i])) {
                        sr_err("Column %zu in line %zu is empty.",
-                               ctx->first_probe + i, ctx->line_number);
+                               ctx->first_channel + i, ctx->line_number);
                        return SR_ERR;
                } else if (columns[i][0] != '0') {
                        sr_err("Invalid value '%s' in column %zu in line %zu.",
                        return SR_ERR;
                } else if (columns[i][0] != '0') {
                        sr_err("Invalid value '%s' in column %zu in line %zu.",
-                               columns[i], ctx->first_probe + i,
+                               columns[i], ctx->first_channel + i,
                                ctx->line_number);
                        return SR_ERR;
                }
                                ctx->line_number);
                        return SR_ERR;
                }
@@ -431,8 +431,8 @@ static int init(struct sr_input *in, const char *filename)
        const char *param;
        GIOStatus status;
        gsize i, term_pos;
        const char *param;
        GIOStatus status;
        gsize i, term_pos;
-       char probe_name[SR_MAX_PROBENAME_LEN + 1];
-       struct sr_channel *probe;
+       char channel_name[SR_MAX_PROBENAME_LEN + 1];
+       struct sr_channel *ch;
        char **columns;
        gsize num_columns;
        char *ptr;
        char **columns;
        gsize num_columns;
        char *ptr;
@@ -450,11 +450,11 @@ static int init(struct sr_input *in, const char *filename)
        ctx->samplerate = 0;
 
        /*
        ctx->samplerate = 0;
 
        /*
-        * Enable auto-detection of the number of probes in multi column mode
-        * and enforce the specification of the number of probes in single
+        * Enable auto-detection of the number of channels in multi column mode
+        * and enforce the specification of the number of channels in single
         * column mode.
         */
         * column mode.
         */
-       ctx->num_probes = 0;
+       ctx->num_channels = 0;
 
        /* Set default delimiter. */
        if (!(ctx->delimiter = g_string_new(","))) {
 
        /* Set default delimiter. */
        if (!(ctx->delimiter = g_string_new(","))) {
@@ -483,7 +483,7 @@ static int init(struct sr_input *in, const char *filename)
         * In multi column mode start parsing sample data at the first column
         * and in single column mode at the first bit.
         */
         * In multi column mode start parsing sample data at the first column
         * and in single column mode at the first bit.
         */
-       ctx->first_probe = 0;
+       ctx->first_channel = 0;
 
        /* Start at the beginning of the file. */
        ctx->start_line = 1;
 
        /* Start at the beginning of the file. */
        ctx->start_line = 1;
@@ -511,8 +511,8 @@ static int init(struct sr_input *in, const char *filename)
                        }
                }
 
                        }
                }
 
-               if ((param = g_hash_table_lookup(in->param, "numprobes")))
-                       ctx->num_probes = g_ascii_strtoull(param, NULL, 10);
+               if ((param = g_hash_table_lookup(in->param, "numchannels")))
+                       ctx->num_channels = g_ascii_strtoull(param, NULL, 10);
 
                if ((param = g_hash_table_lookup(in->param, "delimiter"))) {
                        if (!strlen(param)) {
 
                if ((param = g_hash_table_lookup(in->param, "delimiter"))) {
                        if (!strlen(param)) {
@@ -542,8 +542,8 @@ static int init(struct sr_input *in, const char *filename)
                        }
                }
 
                        }
                }
 
-               if ((param = g_hash_table_lookup(in->param, "first-probe")))
-                       ctx->first_probe = g_ascii_strtoull(param, NULL, 10);
+               if ((param = g_hash_table_lookup(in->param, "first-channel")))
+                       ctx->first_channel = g_ascii_strtoull(param, NULL, 10);
 
                if ((param = g_hash_table_lookup(in->param, "startline"))) {
                        ctx->start_line = g_ascii_strtoull(param, NULL, 10);
 
                if ((param = g_hash_table_lookup(in->param, "startline"))) {
                        ctx->start_line = g_ascii_strtoull(param, NULL, 10);
@@ -574,12 +574,12 @@ static int init(struct sr_input *in, const char *filename)
        }
 
        if (ctx->multi_column_mode)
        }
 
        if (ctx->multi_column_mode)
-               ctx->first_column = ctx->first_probe;
+               ctx->first_column = ctx->first_channel;
        else
                ctx->first_column = ctx->single_column;
 
        else
                ctx->first_column = ctx->single_column;
 
-       if (!ctx->multi_column_mode && !ctx->num_probes) {
-               sr_err("Number of probes needs to be specified in single column mode.");
+       if (!ctx->multi_column_mode && !ctx->num_channels) {
+               sr_err("Number of channels needs to be specified in single column mode.");
                free_context(ctx);
                return SR_ERR;
        }
                free_context(ctx);
                return SR_ERR;
        }
@@ -653,21 +653,21 @@ static int init(struct sr_input *in, const char *filename)
 
        if (ctx->multi_column_mode) {
                /*
 
        if (ctx->multi_column_mode) {
                /*
-                * Detect the number of probes in multi column mode
+                * Detect the number of channels in multi column mode
                 * automatically if not specified.
                 */
                 * automatically if not specified.
                 */
-               if (!ctx->num_probes) {
-                       ctx->num_probes = num_columns;
-                       sr_info("Number of auto-detected probes: %zu.",
-                               ctx->num_probes);
+               if (!ctx->num_channels) {
+                       ctx->num_channels = num_columns;
+                       sr_info("Number of auto-detected channels: %zu.",
+                               ctx->num_channels);
                }
 
                /*
                }
 
                /*
-                * Ensure that the number of probes does not exceed the number
+                * Ensure that the number of channels does not exceed the number
                 * of columns in multi column mode.
                 */
                 * of columns in multi column mode.
                 */
-               if (num_columns < ctx->num_probes) {
-                       sr_err("Not enough columns for desired number of probes in line %zu.",
+               if (num_columns < ctx->num_channels) {
+                       sr_err("Not enough columns for desired number of channels in line %zu.",
                                ctx->line_number);
                        g_strfreev(columns);
                        free_context(ctx);
                                ctx->line_number);
                        g_strfreev(columns);
                        free_context(ctx);
@@ -675,32 +675,32 @@ static int init(struct sr_input *in, const char *filename)
                }
        }
 
                }
        }
 
-       for (i = 0; i < ctx->num_probes; i++) {
+       for (i = 0; i < ctx->num_channels; i++) {
                if (ctx->header && ctx->multi_column_mode && strlen(columns[i]))
                if (ctx->header && ctx->multi_column_mode && strlen(columns[i]))
-                       snprintf(probe_name, sizeof(probe_name), "%s",
+                       snprintf(channel_name, sizeof(channel_name), "%s",
                                columns[i]);
                else
                                columns[i]);
                else
-                       snprintf(probe_name, sizeof(probe_name), "%zu", i);
+                       snprintf(channel_name, sizeof(channel_name), "%zu", i);
 
 
-               probe = sr_probe_new(i, SR_PROBE_LOGIC, TRUE, probe_name);
+               ch = sr_probe_new(i, SR_PROBE_LOGIC, TRUE, channel_name);
 
 
-               if (!probe) {
-                       sr_err("Probe creation failed.");
+               if (!ch) {
+                       sr_err("Channel creation failed.");
                        free_context(ctx);
                        g_strfreev(columns);
                        return SR_ERR;
                }
 
                        free_context(ctx);
                        g_strfreev(columns);
                        return SR_ERR;
                }
 
-               in->sdi->probes = g_slist_append(in->sdi->probes, probe);
+               in->sdi->channels = g_slist_append(in->sdi->channels, ch);
        }
 
        g_strfreev(columns);
 
        /*
         * Calculate the minimum buffer size to store the sample data of the
        }
 
        g_strfreev(columns);
 
        /*
         * Calculate the minimum buffer size to store the sample data of the
-        * probes.
+        * channels.
         */
         */
-       ctx->sample_buffer_size = (ctx->num_probes + 7) >> 3;
+       ctx->sample_buffer_size = (ctx->num_channels + 7) >> 3;
 
        if (!(ctx->sample_buffer = g_try_malloc(ctx->sample_buffer_size))) {
                sr_err("Sample buffer malloc failed.");
 
        if (!(ctx->sample_buffer = g_try_malloc(ctx->sample_buffer_size))) {
                sr_err("Sample buffer malloc failed.");
@@ -746,7 +746,7 @@ static int loadfile(struct sr_input *in, const char *filename)
 
        /* Limit the number of columns to parse. */
        if (ctx->multi_column_mode)
 
        /* Limit the number of columns to parse. */
        if (ctx->multi_column_mode)
-               max_columns = ctx->num_probes;
+               max_columns = ctx->num_channels;
        else
                max_columns = 1;
 
        else
                max_columns = 1;
 
@@ -810,11 +810,11 @@ static int loadfile(struct sr_input *in, const char *filename)
                }
 
                /*
                }
 
                /*
-                * Ensure that the number of probes does not exceed the number
+                * Ensure that the number of channels does not exceed the number
                 * of columns in multi column mode.
                 */
                 * of columns in multi column mode.
                 */
-               if (ctx->multi_column_mode && num_columns < ctx->num_probes) {
-                       sr_err("Not enough columns for desired number of probes in line %zu.",
+               if (ctx->multi_column_mode && num_columns < ctx->num_channels) {
+                       sr_err("Not enough columns for desired number of channels in line %zu.",
                                ctx->line_number);
                        g_strfreev(columns);
                        free_context(ctx);
                                ctx->line_number);
                        g_strfreev(columns);
                        free_context(ctx);
index 6f947977a08b6d1c941c1b481427620d47d8276f..88bc2ff67f1824e6824991231736329dc1aa0241 100644 (file)
@@ -19,7 +19,7 @@
 
 /* The VCD input module has the following options:
  *
 
 /* The VCD input module has the following options:
  *
- * numprobes:   Maximum number of probes to use. The probes are
+ * numchannels: Maximum number of channels to use. The channels are
  *              detected in the same order as they are listed
  *              in the $var sections of the VCD file.
  *
  *              detected in the same order as they are listed
  *              in the $var sections of the VCD file.
  *
@@ -53,7 +53,7 @@
  * - analog, integer and real number variables
  * - $dumpvars initial value declaration
  * - $scope namespaces
  * - analog, integer and real number variables
  * - $dumpvars initial value declaration
  * - $scope namespaces
- * - more than 64 probes
+ * - more than 64 channels
  */
 
 #include <stdlib.h>
  */
 
 #include <stdlib.h>
 
 struct context {
        uint64_t samplerate;
 
 struct context {
        uint64_t samplerate;
-       int maxprobes;
-       int probecount;
+       int maxchannels;
+       int channelcount;
        int downsample;
        unsigned compress;
        int64_t skip;
        int downsample;
        unsigned compress;
        int64_t skip;
-       GSList *probes;
+       GSList *channels;
 };
 
 };
 
-struct probe {
+struct vcd_channel {
        gchar *name;
        gchar *identifier;
 };
        gchar *name;
        gchar *identifier;
 };
@@ -164,17 +164,17 @@ static gboolean parse_section(FILE *file, gchar **name, gchar **contents)
        return status;
 }
 
        return status;
 }
 
-static void free_probe(void *data)
+static void free_channel(void *data)
 {
 {
-       struct probe *probe = data;
-       g_free(probe->name);
-       g_free(probe->identifier);
-       g_free(probe);
+       struct vcd_channel *vcd_ch = data;
+       g_free(vcd_ch->name);
+       g_free(vcd_ch->identifier);
+       g_free(vcd_ch);
 }
 
 static void release_context(struct context *ctx)
 {
 }
 
 static void release_context(struct context *ctx)
 {
-       g_slist_free_full(ctx->probes, free_probe);
+       g_slist_free_full(ctx->channels, free_channel);
        g_free(ctx);
 }
 
        g_free(ctx);
 }
 
@@ -201,7 +201,7 @@ static gboolean parse_header(FILE *file, struct context *ctx)
        uint64_t p, q;
        gchar *name = NULL, *contents = NULL;
        gboolean status = FALSE;
        uint64_t p, q;
        gchar *name = NULL, *contents = NULL;
        gboolean status = FALSE;
-       struct probe *probe;
+       struct vcd_channel *vcd_ch;
 
        while (parse_section(file, &name, &contents)) {
                sr_dbg("Section '%s', contents '%s'.", name, contents);
 
        while (parse_section(file, &name, &contents)) {
                sr_dbg("Section '%s', contents '%s'.", name, contents);
@@ -237,15 +237,15 @@ static gboolean parse_header(FILE *file, struct context *ctx)
                                sr_info("Unsupported signal type: '%s'", parts[0]);
                        else if (strtol(parts[1], NULL, 10) != 1)
                                sr_info("Unsupported signal size: '%s'", parts[1]);
                                sr_info("Unsupported signal type: '%s'", parts[0]);
                        else if (strtol(parts[1], NULL, 10) != 1)
                                sr_info("Unsupported signal size: '%s'", parts[1]);
-                       else if (ctx->probecount >= ctx->maxprobes)
-                               sr_warn("Skipping '%s' because only %d probes requested.", parts[3], ctx->maxprobes);
+                       else if (ctx->channelcount >= ctx->maxchannels)
+                               sr_warn("Skipping '%s' because only %d channels requested.", parts[3], ctx->maxchannels);
                        else {
                        else {
-                               sr_info("Probe %d is '%s' identified by '%s'.", ctx->probecount, parts[3], parts[2]);
-                               probe = g_malloc(sizeof(struct probe));
-                               probe->identifier = g_strdup(parts[2]);
-                               probe->name = g_strdup(parts[3]);
-                               ctx->probes = g_slist_append(ctx->probes, probe);
-                               ctx->probecount++;
+                               sr_info("Channel %d is '%s' identified by '%s'.", ctx->channelcount, parts[3], parts[2]);
+                               vcd_ch = g_malloc(sizeof(struct vcd_channel));
+                               vcd_ch->identifier = g_strdup(parts[2]);
+                               vcd_ch->name = g_strdup(parts[3]);
+                               ctx->channels = g_slist_append(ctx->channels, vcd_ch);
+                               ctx->channelcount++;
                        }
 
                        g_strfreev(parts);
                        }
 
                        g_strfreev(parts);
@@ -287,8 +287,8 @@ static int format_match(const char *filename)
 
 static int init(struct sr_input *in, const char *filename)
 {
 
 static int init(struct sr_input *in, const char *filename)
 {
-       struct sr_channel *probe;
-       int num_probes, i;
+       struct sr_channel *ch;
+       int num_channels, i;
        char name[SR_MAX_PROBENAME_LEN + 1];
        char *param;
        struct context *ctx;
        char name[SR_MAX_PROBENAME_LEN + 1];
        char *param;
        struct context *ctx;
@@ -300,20 +300,20 @@ static int init(struct sr_input *in, const char *filename)
                return SR_ERR_MALLOC;
        }
 
                return SR_ERR_MALLOC;
        }
 
-       num_probes = DEFAULT_NUM_PROBES;
+       num_channels = DEFAULT_NUM_PROBES;
        ctx->samplerate = 0;
        ctx->downsample = 1;
        ctx->skip = -1;
 
        if (in->param) {
        ctx->samplerate = 0;
        ctx->downsample = 1;
        ctx->skip = -1;
 
        if (in->param) {
-               param = g_hash_table_lookup(in->param, "numprobes");
+               param = g_hash_table_lookup(in->param, "numchannels");
                if (param) {
                if (param) {
-                       num_probes = strtoul(param, NULL, 10);
-                       if (num_probes < 1) {
+                       num_channels = strtoul(param, NULL, 10);
+                       if (num_channels < 1) {
                                release_context(ctx);
                                return SR_ERR;
                                release_context(ctx);
                                return SR_ERR;
-                       } else if (num_probes > 64) {
-                               sr_err("No more than 64 probes supported.");
+                       } else if (num_channels > 64) {
+                               sr_err("No more than 64 channels supported.");
                                return SR_ERR;
                        }
                }
                                return SR_ERR;
                        }
                }
@@ -334,22 +334,22 @@ static int init(struct sr_input *in, const char *filename)
                        ctx->skip = strtoul(param, NULL, 10) / ctx->downsample;
        }
 
                        ctx->skip = strtoul(param, NULL, 10) / ctx->downsample;
        }
 
-       /* Maximum number of probes to parse from the VCD */
-       ctx->maxprobes = num_probes;
+       /* Maximum number of channels to parse from the VCD */
+       ctx->maxchannels = num_channels;
 
        /* Create a virtual device. */
        in->sdi = sr_dev_inst_new(0, SR_ST_ACTIVE, NULL, NULL, NULL);
        in->internal = ctx;
 
 
        /* Create a virtual device. */
        in->sdi = sr_dev_inst_new(0, SR_ST_ACTIVE, NULL, NULL, NULL);
        in->internal = ctx;
 
-       for (i = 0; i < num_probes; i++) {
+       for (i = 0; i < num_channels; i++) {
                snprintf(name, SR_MAX_PROBENAME_LEN, "%d", i);
 
                snprintf(name, SR_MAX_PROBENAME_LEN, "%d", i);
 
-               if (!(probe = sr_probe_new(i, SR_PROBE_LOGIC, TRUE, name))) {
+               if (!(ch = sr_probe_new(i, SR_PROBE_LOGIC, TRUE, name))) {
                        release_context(ctx);
                        return SR_ERR;
                }
 
                        release_context(ctx);
                        return SR_ERR;
                }
 
-               in->sdi->probes = g_slist_append(in->sdi->probes, probe);
+               in->sdi->channels = g_slist_append(in->sdi->channels, ch);
        }
 
        return SR_OK;
        }
 
        return SR_OK;
@@ -452,7 +452,7 @@ static void parse_contents(FILE *file, const struct sr_dev_inst *sdi, struct con
                        /* A new 1-bit sample value */
                        int i, bit;
                        GSList *l;
                        /* A new 1-bit sample value */
                        int i, bit;
                        GSList *l;
-                       struct probe *probe;
+                       struct vcd_channel *vcd_ch;
 
                        bit = (token->str[0] == '1');
 
 
                        bit = (token->str[0] == '1');
 
@@ -465,11 +465,11 @@ static void parse_contents(FILE *file, const struct sr_dev_inst *sdi, struct con
                                read_until(file, token, 'W');
                        }
 
                                read_until(file, token, 'W');
                        }
 
-                       for (i = 0, l = ctx->probes; i < ctx->probecount && l; i++, l = l->next) {
-                               probe = l->data;
+                       for (i = 0, l = ctx->channels; i < ctx->channelcount && l; i++, l = l->next) {
+                               vcd_ch = l->data;
 
 
-                               if (g_strcmp0(token->str, probe->identifier) == 0) {
-                                       /* Found our probe */
+                               if (g_strcmp0(token->str, vcd_ch->identifier) == 0) {
+                                       /* Found our channel */
                                        if (bit)
                                                prev_values |= (uint64_t)1 << i;
                                        else
                                        if (bit)
                                                prev_values |= (uint64_t)1 << i;
                                        else
@@ -479,8 +479,8 @@ static void parse_contents(FILE *file, const struct sr_dev_inst *sdi, struct con
                                }
                        }
 
                                }
                        }
 
-                       if (i == ctx->probecount)
-                               sr_dbg("Did not find probe for identifier '%s'.", token->str);
+                       if (i == ctx->channelcount)
+                               sr_dbg("Did not find channel for identifier '%s'.", token->str);
                } else {
                        sr_warn("Skipping unknown token '%s'.", token->str);
                }
                } else {
                        sr_warn("Skipping unknown token '%s'.", token->str);
                }
index 5b3e3c2a61b2c366b3f9f4e2dfc9892fe8ceba5f..4987fc4afa5d8fd0fad0759125dcabb798ab68c7 100644 (file)
@@ -85,9 +85,9 @@ static int format_match(const char *filename)
 
 static int init(struct sr_input *in, const char *filename)
 {
 
 static int init(struct sr_input *in, const char *filename)
 {
-       struct sr_channel *probe;
+       struct sr_channel *ch;
        struct context *ctx;
        struct context *ctx;
-       char buf[40], probename[8];
+       char buf[40], channelname[8];
        int i;
 
        if (get_wav_header(filename, buf) != SR_OK)
        int i;
 
        if (get_wav_header(filename, buf) != SR_OK)
@@ -113,10 +113,10 @@ static int init(struct sr_input *in, const char *filename)
        }
 
        for (i = 0; i < ctx->num_channels; i++) {
        }
 
        for (i = 0; i < ctx->num_channels; i++) {
-               snprintf(probename, 8, "CH%d", i + 1);
-               if (!(probe = sr_probe_new(0, SR_PROBE_ANALOG, TRUE, probename)))
+               snprintf(channelname, 8, "CH%d", i + 1);
+               if (!(ch = sr_probe_new(0, SR_PROBE_ANALOG, TRUE, channelname)))
                        return SR_ERR;
                        return SR_ERR;
-               in->sdi->probes = g_slist_append(in->sdi->probes, probe);
+               in->sdi->channels = g_slist_append(in->sdi->channels, ch);
        }
 
        return SR_OK;
        }
 
        return SR_OK;
@@ -178,7 +178,7 @@ static int loadfile(struct sr_input *in, const char *filename)
                }
                packet.type = SR_DF_ANALOG;
                packet.payload = &analog;
                }
                packet.type = SR_DF_ANALOG;
                packet.payload = &analog;
-               analog.probes = in->sdi->probes;
+               analog.channels = in->sdi->channels;
                analog.num_samples = chunk_samples;
                analog.mq = 0;
                analog.unit = 0;
                analog.num_samples = chunk_samples;
                analog.mq = 0;
                analog.unit = 0;
index 34c6133464ab6a185ffcdab494bca748ef59bec9..9c69474e3f0f3260811f4a3286eb6cb565b728ae 100644 (file)
@@ -340,8 +340,8 @@ struct sr_datafeed_logic {
 
 /** Analog datafeed payload for type SR_DF_ANALOG. */
 struct sr_datafeed_analog {
 
 /** Analog datafeed payload for type SR_DF_ANALOG. */
 struct sr_datafeed_analog {
-       /** The probes for which data is included in this packet. */
-       GSList *probes;
+       /** The channels for which data is included in this packet. */
+       GSList *channels;
        /** Number of samples in data */
        int num_samples;
        /** Measured quantity (voltage, current, temperature, and so on).
        /** Number of samples in data */
        int num_samples;
        /** Measured quantity (voltage, current, temperature, and so on).
@@ -352,7 +352,7 @@ struct sr_datafeed_analog {
        /** Bitmap with extra information about the MQ. Use SR_MQFLAG_AC, ... */
        uint64_t mqflags;
        /** The analog value(s). The data is interleaved according to
        /** Bitmap with extra information about the MQ. Use SR_MQFLAG_AC, ... */
        uint64_t mqflags;
        /** The analog value(s). The data is interleaved according to
-        * the probes list. */
+        * the channels list. */
        float *data;
 };
 
        float *data;
 };
 
@@ -438,7 +438,7 @@ struct sr_output {
 
        /**
         * The device for which this output module is creating output. This
 
        /**
         * The device for which this output module is creating output. This
-        * can be used by the module to find out probe names and numbers.
+        * can be used by the module to find out channel names and numbers.
         */
        struct sr_dev_inst *sdi;
 
         */
        struct sr_dev_inst *sdi;
 
@@ -919,8 +919,8 @@ struct sr_dev_inst {
        char *model;
        /** Device version. */
        char *version;
        char *model;
        /** Device version. */
        char *version;
-       /** List of probes. */
-       GSList *probes;
+       /** List of channels. */
+       GSList *channels;
        /** List of sr_channel_group structs */
        GSList *channel_groups;
        /** Device instance connection data (used?) */
        /** List of sr_channel_group structs */
        GSList *channel_groups;
        /** Device instance connection data (used?) */
@@ -995,7 +995,7 @@ struct sr_dev_driver {
        /** Probe status change.
         *  @see sr_dev_probe_enable(), sr_dev_trigger_set(). */
        int (*config_probe_set) (const struct sr_dev_inst *sdi,
        /** Probe status change.
         *  @see sr_dev_probe_enable(), sr_dev_trigger_set(). */
        int (*config_probe_set) (const struct sr_dev_inst *sdi,
-                       struct sr_channel *probe, unsigned int changes);
+                       struct sr_channel *ch, unsigned int changes);
        /** Apply configuration settings to the device hardware.
         *  @see sr_config_commit().*/
        int (*config_commit) (const struct sr_dev_inst *sdi);
        /** Apply configuration settings to the device hardware.
         *  @see sr_config_commit().*/
        int (*config_commit) (const struct sr_dev_inst *sdi);
index ca3a2a0b392481e0846f725a2c02036ec7c17fa8..286c50be9768d2c37ae58fddaed081acde25df05 100644 (file)
 #define LOG_PREFIX "output/analog"
 
 struct context {
 #define LOG_PREFIX "output/analog"
 
 struct context {
-       int num_enabled_probes;
-       GPtrArray *probelist;
+       int num_enabled_channels;
+       GPtrArray *channellist;
 };
 
 static int init(struct sr_output *o)
 {
        struct context *ctx;
 };
 
 static int init(struct sr_output *o)
 {
        struct context *ctx;
-       struct sr_channel *probe;
+       struct sr_channel *ch;
        GSList *l;
 
        sr_spew("Initializing output module.");
        GSList *l;
 
        sr_spew("Initializing output module.");
@@ -48,14 +48,14 @@ static int init(struct sr_output *o)
        }
        o->internal = ctx;
 
        }
        o->internal = ctx;
 
-       /* Get the number of probes and their names. */
-       ctx->probelist = g_ptr_array_new();
-       for (l = o->sdi->probes; l; l = l->next) {
-               probe = l->data;
-               if (!probe || !probe->enabled)
+       /* Get the number of channels and their names. */
+       ctx->channellist = g_ptr_array_new();
+       for (l = o->sdi->channels; l; l = l->next) {
+               ch = l->data;
+               if (!ch || !ch->enabled)
                        continue;
                        continue;
-               g_ptr_array_add(ctx->probelist, probe->name);
-               ctx->num_enabled_probes++;
+               g_ptr_array_add(ctx->channellist, ch->name);
+               ctx->num_enabled_channels++;
        }
 
        return SR_OK;
        }
 
        return SR_OK;
@@ -210,7 +210,7 @@ static int receive(struct sr_output *o, const struct sr_dev_inst *sdi,
                const struct sr_datafeed_packet *packet, GString **out)
 {
        const struct sr_datafeed_analog *analog;
                const struct sr_datafeed_packet *packet, GString **out)
 {
        const struct sr_datafeed_analog *analog;
-       struct sr_channel *probe;
+       struct sr_channel *ch;
        GSList *l;
        const float *fdata;
        int i, p;
        GSList *l;
        const float *fdata;
        int i, p;
@@ -233,9 +233,9 @@ static int receive(struct sr_output *o, const struct sr_dev_inst *sdi,
                fdata = (const float *)analog->data;
                *out = g_string_sized_new(512);
                for (i = 0; i < analog->num_samples; i++) {
                fdata = (const float *)analog->data;
                *out = g_string_sized_new(512);
                for (i = 0; i < analog->num_samples; i++) {
-                       for (l = analog->probes, p = 0; l; l = l->next, p++) {
-                               probe = l->data;
-                               g_string_append_printf(*out, "%s: ", probe->name);
+                       for (l = analog->channels, p = 0; l; l = l->next, p++) {
+                               ch = l->data;
+                               g_string_append_printf(*out, "%s: ", ch->name);
                                fancyprint(analog->unit, analog->mqflags,
                                                fdata[i + p], *out);
                        }
                                fancyprint(analog->unit, analog->mqflags,
                                                fdata[i + p], *out);
                        }
@@ -254,7 +254,7 @@ static int cleanup(struct sr_output *o)
                return SR_ERR_ARG;
        ctx = o->internal;
 
                return SR_ERR_ARG;
        ctx = o->internal;
 
-       g_ptr_array_free(ctx->probelist, 1);
+       g_ptr_array_free(ctx->channellist, 1);
        g_free(ctx);
        o->internal = NULL;
 
        g_free(ctx);
        o->internal = NULL;
 
index 0d050fc034e6b92b998ae9072a885a574a96dd4b..b4c6903edbda9f2206ce5f5ad36d88e004315e3d 100644 (file)
@@ -27,7 +27,7 @@
 #define LOG_PREFIX "output/chronovu-la8"
 
 struct context {
 #define LOG_PREFIX "output/chronovu-la8"
 
 struct context {
-       unsigned int num_enabled_probes;
+       unsigned int num_enabled_channels;
        unsigned int unitsize;
        uint64_t trigger_point;
        uint64_t samplerate;
        unsigned int unitsize;
        uint64_t trigger_point;
        uint64_t samplerate;
@@ -84,7 +84,7 @@ static uint8_t samplerate_to_divcount(uint64_t samplerate)
 static int init(struct sr_output *o)
 {
        struct context *ctx;
 static int init(struct sr_output *o)
 {
        struct context *ctx;
-       struct sr_channel *probe;
+       struct sr_channel *ch;
        GSList *l;
        GVariant *gvar;
 
        GSList *l;
        GVariant *gvar;
 
@@ -106,15 +106,15 @@ static int init(struct sr_output *o)
        o->internal = ctx;
 
        /* Get the unitsize. */
        o->internal = ctx;
 
        /* Get the unitsize. */
-       for (l = o->sdi->probes; l; l = l->next) {
-               probe = l->data;
-               if (probe->type != SR_PROBE_LOGIC)
+       for (l = o->sdi->channels; l; l = l->next) {
+               ch = l->data;
+               if (ch->type != SR_PROBE_LOGIC)
                        continue;
                        continue;
-               if (!probe->enabled)
+               if (!ch->enabled)
                        continue;
                        continue;
-               ctx->num_enabled_probes++;
+               ctx->num_enabled_channels++;
        }
        }
-       ctx->unitsize = (ctx->num_enabled_probes + 7) / 8;
+       ctx->unitsize = (ctx->num_enabled_channels + 7) / 8;
 
        if (sr_config_get(o->sdi->driver, o->sdi, NULL, SR_CONF_SAMPLERATE,
                        &gvar) == SR_OK) {
 
        if (sr_config_get(o->sdi->driver, o->sdi, NULL, SR_CONF_SAMPLERATE,
                        &gvar) == SR_OK) {
index ab6217dfe77e6cb400a5819502c70de6e4d94b47..6b3af1c3b12f57a550910651749df3407aade190 100644 (file)
@@ -28,7 +28,7 @@
 #define LOG_PREFIX "output/csv"
 
 struct context {
 #define LOG_PREFIX "output/csv"
 
 struct context {
-       unsigned int num_enabled_probes;
+       unsigned int num_enabled_channels;
        unsigned int unitsize;
        uint64_t samplerate;
        GString *header;
        unsigned int unitsize;
        uint64_t samplerate;
        GString *header;
@@ -43,17 +43,17 @@ struct context {
  *  - Option to (not) print samplenumber / time as extra column.
  *  - Option to "compress" output (only print changed samples, VCD-like).
  *  - Option to print comma-separated bits, or whole bytes/words (for 8/16
  *  - Option to (not) print samplenumber / time as extra column.
  *  - Option to "compress" output (only print changed samples, VCD-like).
  *  - Option to print comma-separated bits, or whole bytes/words (for 8/16
- *    probe LAs) as ASCII/hex etc. etc.
+ *    channel LAs) as ASCII/hex etc. etc.
  *  - Trigger support.
  */
 
 static int init(struct sr_output *o)
 {
        struct context *ctx;
  *  - Trigger support.
  */
 
 static int init(struct sr_output *o)
 {
        struct context *ctx;
-       struct sr_channel *probe;
+       struct sr_channel *ch;
        GSList *l;
        GVariant *gvar;
        GSList *l;
        GVariant *gvar;
-       int num_probes;
+       int num_channels;
        time_t t;
 
        if (!o)
        time_t t;
 
        if (!o)
@@ -65,19 +65,19 @@ static int init(struct sr_output *o)
        ctx = g_try_malloc0(sizeof(struct context));
        o->internal = ctx;
 
        ctx = g_try_malloc0(sizeof(struct context));
        o->internal = ctx;
 
-       /* Get the number of probes, and the unitsize. */
-       for (l = o->sdi->probes; l; l = l->next) {
-               probe = l->data;
-               if (probe->type != SR_PROBE_LOGIC)
+       /* Get the number of channels, and the unitsize. */
+       for (l = o->sdi->channels; l; l = l->next) {
+               ch = l->data;
+               if (ch->type != SR_PROBE_LOGIC)
                        continue;
                        continue;
-               if (!probe->enabled)
+               if (!ch->enabled)
                        continue;
                        continue;
-               ctx->num_enabled_probes++;
+               ctx->num_enabled_channels++;
        }
 
        }
 
-       ctx->unitsize = (ctx->num_enabled_probes + 7) / 8;
+       ctx->unitsize = (ctx->num_enabled_channels + 7) / 8;
 
 
-       num_probes = g_slist_length(o->sdi->probes);
+       num_channels = g_slist_length(o->sdi->channels);
 
        if (sr_config_get(o->sdi->driver, o->sdi, NULL, SR_CONF_SAMPLERATE,
                        &gvar) == SR_OK) {
 
        if (sr_config_get(o->sdi->driver, o->sdi, NULL, SR_CONF_SAMPLERATE,
                        &gvar) == SR_OK) {
@@ -99,16 +99,16 @@ static int init(struct sr_output *o)
 
        /* Columns / channels */
        g_string_append_printf(ctx->header, "; Channels (%d/%d):",
 
        /* Columns / channels */
        g_string_append_printf(ctx->header, "; Channels (%d/%d):",
-                              ctx->num_enabled_probes, num_probes);
-       for (l = o->sdi->probes; l; l = l->next) {
-               probe = l->data;
-               if (probe->type != SR_PROBE_LOGIC)
+                              ctx->num_enabled_channels, num_channels);
+       for (l = o->sdi->channels; l; l = l->next) {
+               ch = l->data;
+               if (ch->type != SR_PROBE_LOGIC)
                        continue;
                        continue;
-               if (!probe->enabled)
+               if (!ch->enabled)
                        continue;
                        continue;
-               g_string_append_printf(ctx->header, " %s,", probe->name);
+               g_string_append_printf(ctx->header, " %s,", ch->name);
        }
        }
-       if (o->sdi->probes)
+       if (o->sdi->channels)
                /* Drop last separator. */
                g_string_truncate(ctx->header, ctx->header->len - 1);
        g_string_append_printf(ctx->header, "\n");
                /* Drop last separator. */
                g_string_truncate(ctx->header, ctx->header->len - 1);
        g_string_append_printf(ctx->header, "\n");
@@ -147,7 +147,7 @@ static int receive(struct sr_output *o, const struct sr_dev_inst *sdi,
                }
 
                for (i = 0; i <= logic->length - ctx->unitsize; i += ctx->unitsize) {
                }
 
                for (i = 0; i <= logic->length - ctx->unitsize; i += ctx->unitsize) {
-                       for (j = 0; j < ctx->num_enabled_probes; j++) {
+                       for (j = 0; j < ctx->num_enabled_channels; j++) {
                                p = logic->data + i + j / 8;
                                c = *p & (1 << (j % 8));
                                g_string_append_c(*out, c ? '1' : '0');
                                p = logic->data + i + j / 8;
                                c = *p & (1 << (j % 8));
                                g_string_append_c(*out, c ? '1' : '0');
index 8976263a37d179a253d837a6fe0466e54fb1e83b..968b5e370f749d353979d2fe19734757e6dff631 100644 (file)
@@ -28,7 +28,7 @@
 #define LOG_PREFIX "output/gnuplot"
 
 struct context {
 #define LOG_PREFIX "output/gnuplot"
 
 struct context {
-       unsigned int num_enabled_probes;
+       unsigned int num_enabled_channels;
        unsigned int unitsize;
        char *header;
        uint8_t *old_sample;
        unsigned int unitsize;
        char *header;
        uint8_t *old_sample;
@@ -40,23 +40,23 @@ static const char *gnuplot_header = "\
 # Generated by: %s on %s%s\
 # Period: %s\n\
 #\n\
 # Generated by: %s on %s%s\
 # Period: %s\n\
 #\n\
-# Column\tProbe\n\
+# Column\tChannel\n\
 # -------------------------------------\
 ----------------------------------------\n\
 # 0\t\tSample counter (for internal gnuplot purposes)\n%s\n";
 
 static const char *gnuplot_header_comment = "\
 # -------------------------------------\
 ----------------------------------------\n\
 # 0\t\tSample counter (for internal gnuplot purposes)\n%s\n";
 
 static const char *gnuplot_header_comment = "\
-# Comment: Acquisition with %d/%d probes at %s\n";
+# Comment: Acquisition with %d/%d channels at %s\n";
 
 static int init(struct sr_output *o)
 {
        struct context *ctx;
 
 static int init(struct sr_output *o)
 {
        struct context *ctx;
-       struct sr_channel *probe;
+       struct sr_channel *ch;
        GSList *l;
        GVariant *gvar;
        uint64_t samplerate;
        unsigned int i;
        GSList *l;
        GVariant *gvar;
        uint64_t samplerate;
        unsigned int i;
-       int num_probes;
+       int num_channels;
        char *c, *frequency_s;
        char wbuf[1000], comment[128];
        time_t t;
        char *c, *frequency_s;
        char wbuf[1000], comment[128];
        time_t t;
@@ -77,23 +77,23 @@ static int init(struct sr_output *o)
        }
 
        o->internal = ctx;
        }
 
        o->internal = ctx;
-       ctx->num_enabled_probes = 0;
-       for (l = o->sdi->probes; l; l = l->next) {
-               probe = l->data;
-               if (probe->type != SR_PROBE_LOGIC)
+       ctx->num_enabled_channels = 0;
+       for (l = o->sdi->channels; l; l = l->next) {
+               ch = l->data;
+               if (ch->type != SR_PROBE_LOGIC)
                        continue;
                        continue;
-               if (!probe->enabled)
+               if (!ch->enabled)
                        continue;
                        continue;
-               ctx->num_enabled_probes++;
+               ctx->num_enabled_channels++;
        }
        }
-       if (ctx->num_enabled_probes <= 0) {
-               sr_err("%s: no logic probe enabled", __func__);
+       if (ctx->num_enabled_channels <= 0) {
+               sr_err("%s: no logic channel enabled", __func__);
                return SR_ERR;
        }
 
                return SR_ERR;
        }
 
-       ctx->unitsize = (ctx->num_enabled_probes + 7) / 8;
+       ctx->unitsize = (ctx->num_enabled_channels + 7) / 8;
 
 
-       num_probes = g_slist_length(o->sdi->probes);
+       num_channels = g_slist_length(o->sdi->channels);
        comment[0] = '\0';
        samplerate = 0;
        if (sr_config_get(o->sdi->driver, o->sdi, NULL, SR_CONF_SAMPLERATE,
        comment[0] = '\0';
        samplerate = 0;
        if (sr_config_get(o->sdi->driver, o->sdi, NULL, SR_CONF_SAMPLERATE,
@@ -106,20 +106,20 @@ static int init(struct sr_output *o)
                        return SR_ERR;
                }
                snprintf(comment, 127, gnuplot_header_comment,
                        return SR_ERR;
                }
                snprintf(comment, 127, gnuplot_header_comment,
-                       ctx->num_enabled_probes, num_probes, frequency_s);
+                       ctx->num_enabled_channels, num_channels, frequency_s);
                g_free(frequency_s);
        }
 
        /* Columns / channels */
        wbuf[0] = '\0';
                g_free(frequency_s);
        }
 
        /* Columns / channels */
        wbuf[0] = '\0';
-       for (i = 0, l = o->sdi->probes; l; l = l->next, i++) {
-               probe = l->data;
-               if (probe->type != SR_PROBE_LOGIC)
+       for (i = 0, l = o->sdi->channels; l; l = l->next, i++) {
+               ch = l->data;
+               if (ch->type != SR_PROBE_LOGIC)
                        continue;
                        continue;
-               if (!probe->enabled)
+               if (!ch->enabled)
                        continue;
                c = (char *)&wbuf + strlen((const char *)&wbuf);
                        continue;
                c = (char *)&wbuf + strlen((const char *)&wbuf);
-               sprintf(c, "# %d\t\t%s\n", i + 1, probe->name);
+               sprintf(c, "# %d\t\t%s\n", i + 1, ch->name);
        }
 
        if (!(frequency_s = sr_period_string(samplerate))) {
        }
 
        if (!(frequency_s = sr_period_string(samplerate))) {
@@ -215,7 +215,7 @@ static int data(struct sr_output *o, const uint8_t *data_in,
        }
 
        ctx = o->internal;
        }
 
        ctx = o->internal;
-       max_linelen = 16 + ctx->num_enabled_probes * 2;
+       max_linelen = 16 + ctx->num_enabled_channels * 2;
        outsize = length_in / ctx->unitsize * max_linelen;
        if (ctx->header)
                outsize += strlen(ctx->header);
        outsize = length_in / ctx->unitsize * max_linelen;
        if (ctx->header)
                outsize += strlen(ctx->header);
@@ -253,7 +253,7 @@ static int data(struct sr_output *o, const uint8_t *data_in,
                sprintf((char *)c, "%" PRIu64 "\t", samplecount++);
 
                /* The next columns are the values of all channels. */
                sprintf((char *)c, "%" PRIu64 "\t", samplecount++);
 
                /* The next columns are the values of all channels. */
-               for (p = 0; p < ctx->num_enabled_probes; p++) {
+               for (p = 0; p < ctx->num_enabled_channels; p++) {
                        curbit = (sample[p / 8] & ((uint8_t) (1 << (p % 8)))) >> (p % 8);
                        c = outbuf + strlen((const char *)outbuf);
                        sprintf((char *)c, "%d ", curbit);
                        curbit = (sample[p / 8] & ((uint8_t) (1 << (p % 8)))) >> (p % 8);
                        c = outbuf + strlen((const char *)outbuf);
                        sprintf((char *)c, "%d ", curbit);
index 19c4d993163e8c62a2295d1e8e9b3927a35c83b8..b59931624921ba0565e88d76cf82eb3d082d237c 100644 (file)
@@ -56,11 +56,11 @@ static int init(struct sr_output *o)
 
 static GString *gen_header(const struct sr_dev_inst *sdi, struct context *ctx)
 {
 
 static GString *gen_header(const struct sr_dev_inst *sdi, struct context *ctx)
 {
-       struct sr_channel *probe;
+       struct sr_channel *ch;
        GSList *l;
        GString *s;
        GVariant *gvar;
        GSList *l;
        GString *s;
        GVariant *gvar;
-       int num_enabled_probes;
+       int num_enabled_channels;
 
        if (!ctx->samplerate && sr_config_get(sdi->driver, sdi, NULL,
                        SR_CONF_SAMPLERATE, &gvar) == SR_OK) {
 
        if (!ctx->samplerate && sr_config_get(sdi->driver, sdi, NULL,
                        SR_CONF_SAMPLERATE, &gvar) == SR_OK) {
@@ -68,19 +68,19 @@ static GString *gen_header(const struct sr_dev_inst *sdi, struct context *ctx)
                g_variant_unref(gvar);
        }
 
                g_variant_unref(gvar);
        }
 
-       num_enabled_probes = 0;
-       for (l = sdi->probes; l; l = l->next) {
-               probe = l->data;
-               if (probe->type != SR_PROBE_LOGIC)
+       num_enabled_channels = 0;
+       for (l = sdi->channels; l; l = l->next) {
+               ch = l->data;
+               if (ch->type != SR_PROBE_LOGIC)
                        continue;
                        continue;
-               if (!probe->enabled)
+               if (!ch->enabled)
                        continue;
                        continue;
-               num_enabled_probes++;
+               num_enabled_channels++;
        }
 
        s = g_string_sized_new(512);
        g_string_append_printf(s, ";Rate: %"PRIu64"\n", ctx->samplerate);
        }
 
        s = g_string_sized_new(512);
        g_string_append_printf(s, ";Rate: %"PRIu64"\n", ctx->samplerate);
-       g_string_append_printf(s, ";Channels: %d\n", num_enabled_probes);
+       g_string_append_printf(s, ";Channels: %d\n", num_enabled_channels);
        g_string_append_printf(s, ";EnabledChannels: -1\n");
        g_string_append_printf(s, ";Compressed: true\n");
        g_string_append_printf(s, ";CursorEnabled: false\n");
        g_string_append_printf(s, ";EnabledChannels: -1\n");
        g_string_append_printf(s, ";Compressed: true\n");
        g_string_append_printf(s, ";CursorEnabled: false\n");
index 61c5a2ad2db863aceb913b3f668b4dec1cb19b03..4a6b4f08a920db9ee0e54fec76a9176f510f3312 100644 (file)
@@ -50,7 +50,7 @@ SR_PRIV int data_ascii(struct sr_output *o, const uint8_t *data_in,
          * extra output, e.g. trigger.
          */
        outsize = 512 + (1 + (length_in / ctx->unitsize) / ctx->samples_per_line)
          * extra output, e.g. trigger.
          */
        outsize = 512 + (1 + (length_in / ctx->unitsize) / ctx->samples_per_line)
-            * (ctx->num_enabled_probes * max_linelen);
+            * (ctx->num_enabled_channels * max_linelen);
 
        if (!(outbuf = g_try_malloc0(outsize + 1))) {
                sr_err("%s: outbuf malloc failed", __func__);
 
        if (!(outbuf = g_try_malloc0(outsize + 1))) {
                sr_err("%s: outbuf malloc failed", __func__);
@@ -70,9 +70,9 @@ SR_PRIV int data_ascii(struct sr_output *o, const uint8_t *data_in,
                     offset += ctx->unitsize) {
                        sample = data_in + offset;
 
                     offset += ctx->unitsize) {
                        sample = data_in + offset;
 
-                       char tmpval[ctx->num_enabled_probes];
+                       char tmpval[ctx->num_enabled_channels];
 
 
-                       for (p = 0; p < ctx->num_enabled_probes; p++) {
+                       for (p = 0; p < ctx->num_enabled_channels; p++) {
                                uint8_t curbit = (sample[p / 8] & ((uint8_t) 1 << (p % 8)));
                                uint8_t prevbit = (ctx->prevsample[p / 8] &
                                                ((uint8_t) 1 << (p % 8)));
                                uint8_t curbit = (sample[p / 8] & ((uint8_t) 1 << (p % 8)));
                                uint8_t prevbit = (ctx->prevsample[p / 8] &
                                                ((uint8_t) 1 << (p % 8)));
@@ -99,7 +99,7 @@ SR_PRIV int data_ascii(struct sr_output *o, const uint8_t *data_in,
                                ctx->mark_trigger = -1;
                        }
 
                                ctx->mark_trigger = -1;
                        }
 
-                       for (p = 0; p < ctx->num_enabled_probes; p++) {
+                       for (p = 0; p < ctx->num_enabled_channels; p++) {
                                ctx->linebuf[p * ctx->linebuf_len +
                                             ctx->line_offset] = tmpval[p];
                        }
                                ctx->linebuf[p * ctx->linebuf_len +
                                             ctx->line_offset] = tmpval[p];
                        }
index ff149650fe9c540789db9a0b5d6c87ef8ddbfadb..af3196925281977a03d734a90e699ecbbffd851e 100644 (file)
@@ -50,7 +50,7 @@ SR_PRIV int data_bits(struct sr_output *o, const uint8_t *data_in,
          * extra output, e.g. trigger.
          */
        outsize = 512 + (1 + (length_in / ctx->unitsize) / ctx->samples_per_line)
          * extra output, e.g. trigger.
          */
        outsize = 512 + (1 + (length_in / ctx->unitsize) / ctx->samples_per_line)
-            * (ctx->num_enabled_probes * max_linelen);
+            * (ctx->num_enabled_channels * max_linelen);
 
        if (!(outbuf = g_try_malloc0(outsize + 1))) {
                sr_err("%s: outbuf malloc failed", __func__);
 
        if (!(outbuf = g_try_malloc0(outsize + 1))) {
                sr_err("%s: outbuf malloc failed", __func__);
@@ -69,7 +69,7 @@ SR_PRIV int data_bits(struct sr_output *o, const uint8_t *data_in,
                for (offset = 0; offset <= length_in - ctx->unitsize;
                     offset += ctx->unitsize) {
                        sample = data_in + offset;
                for (offset = 0; offset <= length_in - ctx->unitsize;
                     offset += ctx->unitsize) {
                        sample = data_in + offset;
-                       for (p = 0; p < ctx->num_enabled_probes; p++) {
+                       for (p = 0; p < ctx->num_enabled_channels; p++) {
                                c = (sample[p / 8] & ((uint8_t) 1 << (p % 8))) ? '1' : '0';
                                ctx->linebuf[p * ctx->linebuf_len +
                                             ctx->line_offset] = c;
                                c = (sample[p / 8] & ((uint8_t) 1 << (p % 8))) ? '1' : '0';
                                ctx->linebuf[p * ctx->linebuf_len +
                                             ctx->line_offset] = c;
@@ -79,7 +79,7 @@ SR_PRIV int data_bits(struct sr_output *o, const uint8_t *data_in,
 
                        /* Add a space every 8th bit. */
                        if ((ctx->spl_cnt & 7) == 0) {
 
                        /* Add a space every 8th bit. */
                        if ((ctx->spl_cnt & 7) == 0) {
-                               for (p = 0; p < ctx->num_enabled_probes; p++)
+                               for (p = 0; p < ctx->num_enabled_channels; p++)
                                        ctx->linebuf[p * ctx->linebuf_len +
                                                     ctx->line_offset] = ' ';
                                ctx->line_offset++;
                                        ctx->linebuf[p * ctx->linebuf_len +
                                                     ctx->line_offset] = ' ';
                                ctx->line_offset++;
index e9102608ffb1bfe29bb09996e784ccb56bc42517..e976e9ba445b0ef639e50824df4a82949ea974f4 100644 (file)
@@ -45,7 +45,7 @@ SR_PRIV int data_hex(struct sr_output *o, const uint8_t *data_in,
        ctx = o->internal;
        max_linelen = SR_MAX_PROBENAME_LEN + 3 + ctx->samples_per_line
                        + ctx->samples_per_line / 2;
        ctx = o->internal;
        max_linelen = SR_MAX_PROBENAME_LEN + 3 + ctx->samples_per_line
                        + ctx->samples_per_line / 2;
-       outsize = length_in / ctx->unitsize * ctx->num_enabled_probes
+       outsize = length_in / ctx->unitsize * ctx->num_enabled_channels
                        / ctx->samples_per_line * max_linelen + 512;
 
        if (!(outbuf = g_try_malloc0(outsize + 1))) {
                        / ctx->samples_per_line * max_linelen + 512;
 
        if (!(outbuf = g_try_malloc0(outsize + 1))) {
@@ -65,7 +65,7 @@ SR_PRIV int data_hex(struct sr_output *o, const uint8_t *data_in,
        for (offset = 0; offset <= length_in - ctx->unitsize;
             offset += ctx->unitsize) {
                sample = data_in + offset;
        for (offset = 0; offset <= length_in - ctx->unitsize;
             offset += ctx->unitsize) {
                sample = data_in + offset;
-               for (p = 0; p < ctx->num_enabled_probes; p++) {
+               for (p = 0; p < ctx->num_enabled_channels; p++) {
                        ctx->linevalues[p] <<= 1;
                        if (sample[p / 8] & ((uint8_t) 1 << (p % 8)))
                                ctx->linevalues[p] |= 1;
                        ctx->linevalues[p] <<= 1;
                        if (sample[p / 8] & ((uint8_t) 1 << (p % 8)))
                                ctx->linevalues[p] |= 1;
@@ -76,7 +76,7 @@ SR_PRIV int data_hex(struct sr_output *o, const uint8_t *data_in,
 
                /* Add a space after every complete hex byte. */
                if ((ctx->spl_cnt & 7) == 0) {
 
                /* Add a space after every complete hex byte. */
                if ((ctx->spl_cnt & 7) == 0) {
-                       for (p = 0; p < ctx->num_enabled_probes; p++)
+                       for (p = 0; p < ctx->num_enabled_channels; p++)
                                ctx->linebuf[p * ctx->linebuf_len +
                                             ctx->line_offset + 2] = ' ';
                        ctx->line_offset += 3;
                                ctx->linebuf[p * ctx->linebuf_len +
                                             ctx->line_offset + 2] = ' ';
                        ctx->line_offset += 3;
index 54350b88ffcc5de394108eb4f56cff824d5b15f3..e32e843d27a8b4d94dd78cc34434345ba0993690 100644 (file)
 
 SR_PRIV void flush_linebufs(struct context *ctx, uint8_t *outbuf)
 {
 
 SR_PRIV void flush_linebufs(struct context *ctx, uint8_t *outbuf)
 {
-       static int max_probename_len = 0;
+       static int max_channelname_len = 0;
        int len, i;
        GSList *l;
        int len, i;
        GSList *l;
-       char *probe_name;
+       char *channel_name;
 
        if (ctx->linebuf[0] == 0)
                return;
 
 
        if (ctx->linebuf[0] == 0)
                return;
 
-       if (max_probename_len == 0) {
+       if (max_channelname_len == 0) {
                /* First time through... */
                /* First time through... */
-               for (l = ctx->probenames; l; l = l->next) {
-                       probe_name = l->data;
-                       len = strlen(probe_name);
-                       if (len > max_probename_len)
-                               max_probename_len = len;
+               for (l = ctx->channelnames; l; l = l->next) {
+                       channel_name = l->data;
+                       len = strlen(channel_name);
+                       if (len > max_channelname_len)
+                               max_channelname_len = len;
                }
        }
 
                }
        }
 
-       for (i = 0, l = ctx->probenames; l; l = l->next, i++) {
-               probe_name = l->data;
+       for (i = 0, l = ctx->channelnames; l; l = l->next, i++) {
+               channel_name = l->data;
                sprintf((char *)outbuf + strlen((const char *)outbuf),
                sprintf((char *)outbuf + strlen((const char *)outbuf),
-                       "%*s:%s\n", max_probename_len,
-                       probe_name, ctx->linebuf + i * ctx->linebuf_len);
+                       "%*s:%s\n", max_channelname_len,
+                       channel_name, ctx->linebuf + i * ctx->linebuf_len);
        }
 
        /* Mark trigger with a ^ character. */
        }
 
        /* Mark trigger with a ^ character. */
@@ -74,11 +74,11 @@ SR_PRIV void flush_linebufs(struct context *ctx, uint8_t *outbuf)
 SR_PRIV int init(struct sr_output *o, int default_spl, enum outputmode mode)
 {
        struct context *ctx;
 SR_PRIV int init(struct sr_output *o, int default_spl, enum outputmode mode)
 {
        struct context *ctx;
-       struct sr_channel *probe;
+       struct sr_channel *ch;
        GSList *l;
        GVariant *gvar;
        uint64_t samplerate;
        GSList *l;
        GVariant *gvar;
        uint64_t samplerate;
-       int num_probes, ret;
+       int num_channels, ret;
        char *samplerate_s;
 
        if (!(ctx = g_try_malloc0(sizeof(struct context)))) {
        char *samplerate_s;
 
        if (!(ctx = g_try_malloc0(sizeof(struct context)))) {
@@ -87,20 +87,20 @@ SR_PRIV int init(struct sr_output *o, int default_spl, enum outputmode mode)
        }
 
        o->internal = ctx;
        }
 
        o->internal = ctx;
-       ctx->num_enabled_probes = 0;
-       ctx->probenames = NULL;
+       ctx->num_enabled_channels = 0;
+       ctx->channelnames = NULL;
 
 
-       for (l = o->sdi->probes; l; l = l->next) {
-               probe = l->data;
-               if (probe->type != SR_PROBE_LOGIC)
+       for (l = o->sdi->channels; l; l = l->next) {
+               ch = l->data;
+               if (ch->type != SR_PROBE_LOGIC)
                        continue;
                        continue;
-               if (!probe->enabled)
+               if (!ch->enabled)
                        continue;
                        continue;
-               ctx->probenames = g_slist_append(ctx->probenames, probe->name);
-               ctx->num_enabled_probes++;
+               ctx->channelnames = g_slist_append(ctx->channelnames, ch->name);
+               ctx->num_enabled_channels++;
        }
 
        }
 
-       ctx->unitsize = (ctx->num_enabled_probes + 7) / 8;
+       ctx->unitsize = (ctx->num_enabled_channels + 7) / 8;
        ctx->line_offset = 0;
        ctx->spl_cnt = 0;
        ctx->mark_trigger = -1;
        ctx->line_offset = 0;
        ctx->spl_cnt = 0;
        ctx->mark_trigger = -1;
@@ -123,7 +123,7 @@ SR_PRIV int init(struct sr_output *o, int default_spl, enum outputmode mode)
        }
 
        snprintf(ctx->header, 511, "%s\n", PACKAGE_STRING);
        }
 
        snprintf(ctx->header, 511, "%s\n", PACKAGE_STRING);
-       num_probes = g_slist_length(o->sdi->probes);
+       num_channels = g_slist_length(o->sdi->channels);
        if (sr_config_get(o->sdi->driver, o->sdi, NULL, SR_CONF_SAMPLERATE,
                        &gvar) == SR_OK) {
                samplerate = g_variant_get_uint64(gvar);
        if (sr_config_get(o->sdi->driver, o->sdi, NULL, SR_CONF_SAMPLERATE,
                        &gvar) == SR_OK) {
                samplerate = g_variant_get_uint64(gvar);
@@ -134,25 +134,25 @@ SR_PRIV int init(struct sr_output *o, int default_spl, enum outputmode mode)
                }
                snprintf(ctx->header + strlen(ctx->header),
                         511 - strlen(ctx->header),
                }
                snprintf(ctx->header + strlen(ctx->header),
                         511 - strlen(ctx->header),
-                        "Acquisition with %d/%d probes at %s\n",
-                        ctx->num_enabled_probes, num_probes, samplerate_s);
+                        "Acquisition with %d/%d channels at %s\n",
+                        ctx->num_enabled_channels, num_channels, samplerate_s);
                g_free(samplerate_s);
        }
 
        ctx->linebuf_len = ctx->samples_per_line * 2 + 4;
                g_free(samplerate_s);
        }
 
        ctx->linebuf_len = ctx->samples_per_line * 2 + 4;
-       if (!(ctx->linebuf = g_try_malloc0(num_probes * ctx->linebuf_len))) {
+       if (!(ctx->linebuf = g_try_malloc0(num_channels * ctx->linebuf_len))) {
                sr_err("%s: ctx->linebuf malloc failed", __func__);
                ret = SR_ERR_MALLOC;
                goto err;
        }
 
                sr_err("%s: ctx->linebuf malloc failed", __func__);
                ret = SR_ERR_MALLOC;
                goto err;
        }
 
-       if (!(ctx->linevalues = g_try_malloc0(num_probes))) {
+       if (!(ctx->linevalues = g_try_malloc0(num_channels))) {
                sr_err("%s: ctx->linevalues malloc failed", __func__);
                ret = SR_ERR_MALLOC;
        }
 
        if (mode == MODE_ASCII &&
                sr_err("%s: ctx->linevalues malloc failed", __func__);
                ret = SR_ERR_MALLOC;
        }
 
        if (mode == MODE_ASCII &&
-                       !(ctx->prevsample = g_try_malloc0(num_probes / 8))) {
+                       !(ctx->prevsample = g_try_malloc0(num_channels / 8))) {
                sr_err("%s: ctx->prevsample malloc failed", __func__);
                ret = SR_ERR_MALLOC;
        }
                sr_err("%s: ctx->prevsample malloc failed", __func__);
                ret = SR_ERR_MALLOC;
        }
@@ -182,7 +182,7 @@ SR_PRIV int text_cleanup(struct sr_output *o)
        if (ctx->prevsample)
                g_free(ctx->prevsample);
 
        if (ctx->prevsample)
                g_free(ctx->prevsample);
 
-       g_slist_free(ctx->probenames);
+       g_slist_free(ctx->channelnames);
 
        g_free(ctx);
 
 
        g_free(ctx);
 
@@ -206,7 +206,7 @@ SR_PRIV int event(struct sr_output *o, int event_type, uint8_t **data_out,
                *length_out = 0;
                break;
        case SR_DF_END:
                *length_out = 0;
                break;
        case SR_DF_END:
-               outsize = ctx->num_enabled_probes
+               outsize = ctx->num_enabled_channels
                                * (ctx->samples_per_line + 20) + 512;
                if (!(outbuf = g_try_malloc0(outsize))) {
                        sr_err("%s: outbuf malloc failed", __func__);
                                * (ctx->samples_per_line + 20) + 512;
                if (!(outbuf = g_try_malloc0(outsize))) {
                        sr_err("%s: outbuf malloc failed", __func__);
index 8e96318d5481356c92667ec093157c513b94ca6f..a7414db39c8eb36069f08569f826ce4e1d6152cd 100644 (file)
@@ -31,12 +31,12 @@ enum outputmode {
 };
 
 struct context {
 };
 
 struct context {
-       unsigned int num_enabled_probes;
+       unsigned int num_enabled_channels;
        int samples_per_line;
        unsigned int unitsize;
        int line_offset;
        int linebuf_len;
        int samples_per_line;
        unsigned int unitsize;
        int line_offset;
        int linebuf_len;
-       GSList *probenames;
+       GSList *channelnames;
        uint8_t *linebuf;
        int spl_cnt;
        uint8_t *linevalues;
        uint8_t *linebuf;
        int spl_cnt;
        uint8_t *linevalues;
index 7df345213250f2bc407d3821ba28c45aa0a6ea3d..59198357dfa204663ec03aa8faea7c1818495e4d 100644 (file)
@@ -29,8 +29,8 @@
 #define LOG_PREFIX "output/vcd"
 
 struct context {
 #define LOG_PREFIX "output/vcd"
 
 struct context {
-       int num_enabled_probes;
-       GArray *probeindices;
+       int num_enabled_channels;
+       GArray *channelindices;
        GString *header;
        uint8_t *prevsample;
        int period;
        GString *header;
        uint8_t *prevsample;
        int period;
@@ -40,15 +40,15 @@ struct context {
 };
 
 static const char *const vcd_header_comment =
 };
 
 static const char *const vcd_header_comment =
-       "$comment\n  Acquisition with %d/%d probes at %s\n$end\n";
+       "$comment\n  Acquisition with %d/%d channels at %s\n$end\n";
 
 static int init(struct sr_output *o)
 {
        struct context *ctx;
 
 static int init(struct sr_output *o)
 {
        struct context *ctx;
-       struct sr_channel *probe;
+       struct sr_channel *ch;
        GSList *l;
        GVariant *gvar;
        GSList *l;
        GVariant *gvar;
-       int num_probes, i;
+       int num_channels, i;
        char *samplerate_s, *frequency_s, *timestamp;
        time_t t;
 
        char *samplerate_s, *frequency_s, *timestamp;
        time_t t;
 
@@ -58,27 +58,27 @@ static int init(struct sr_output *o)
        }
 
        o->internal = ctx;
        }
 
        o->internal = ctx;
-       ctx->num_enabled_probes = 0;
-       ctx->probeindices = g_array_new(FALSE, FALSE, sizeof(int));
+       ctx->num_enabled_channels = 0;
+       ctx->channelindices = g_array_new(FALSE, FALSE, sizeof(int));
 
 
-       for (l = o->sdi->probes; l; l = l->next) {
-               probe = l->data;
-               if (probe->type != SR_PROBE_LOGIC)
+       for (l = o->sdi->channels; l; l = l->next) {
+               ch = l->data;
+               if (ch->type != SR_PROBE_LOGIC)
                        continue;
                        continue;
-               if (!probe->enabled)
+               if (!ch->enabled)
                        continue;
                        continue;
-               ctx->probeindices = g_array_append_val(
-                               ctx->probeindices, probe->index);
-               ctx->num_enabled_probes++;
+               ctx->channelindices = g_array_append_val(
+                               ctx->channelindices, ch->index);
+               ctx->num_enabled_channels++;
        }
        }
-       if (ctx->num_enabled_probes > 94) {
-               sr_err("VCD only supports 94 probes.");
+       if (ctx->num_enabled_channels > 94) {
+               sr_err("VCD only supports 94 channels.");
                return SR_ERR;
        }
 
                return SR_ERR;
        }
 
-       ctx->unitsize = (ctx->num_enabled_probes + 7) / 8;
+       ctx->unitsize = (ctx->num_enabled_channels + 7) / 8;
        ctx->header = g_string_sized_new(512);
        ctx->header = g_string_sized_new(512);
-       num_probes = g_slist_length(o->sdi->probes);
+       num_channels = g_slist_length(o->sdi->channels);
 
        /* timestamp */
        t = time(NULL);
 
        /* timestamp */
        t = time(NULL);
@@ -101,7 +101,7 @@ static int init(struct sr_output *o)
                        return SR_ERR;
                }
                g_string_append_printf(ctx->header, vcd_header_comment,
                        return SR_ERR;
                }
                g_string_append_printf(ctx->header, vcd_header_comment,
-                                ctx->num_enabled_probes, num_probes, samplerate_s);
+                                ctx->num_enabled_channels, num_channels, samplerate_s);
                g_free(samplerate_s);
        }
 
                g_free(samplerate_s);
        }
 
@@ -125,14 +125,14 @@ static int init(struct sr_output *o)
        g_string_append_printf(ctx->header, "$scope module %s $end\n", PACKAGE);
 
        /* Wires / channels */
        g_string_append_printf(ctx->header, "$scope module %s $end\n", PACKAGE);
 
        /* Wires / channels */
-       for (i = 0, l = o->sdi->probes; l; l = l->next, i++) {
-               probe = l->data;
-               if (probe->type != SR_PROBE_LOGIC)
+       for (i = 0, l = o->sdi->channels; l; l = l->next, i++) {
+               ch = l->data;
+               if (ch->type != SR_PROBE_LOGIC)
                        continue;
                        continue;
-               if (!probe->enabled)
+               if (!ch->enabled)
                        continue;
                g_string_append_printf(ctx->header, "$var wire 1 %c %s $end\n",
                        continue;
                g_string_append_printf(ctx->header, "$var wire 1 %c %s $end\n",
-                               (char)('!' + i), probe->name);
+                               (char)('!' + i), ch->name);
        }
 
        g_string_append(ctx->header, "$upscope $end\n"
        }
 
        g_string_append(ctx->header, "$upscope $end\n"
@@ -188,8 +188,8 @@ static int receive(struct sr_output *o, const struct sr_dev_inst *sdi,
                sample = logic->data + i;
                timestamp_written = FALSE;
 
                sample = logic->data + i;
                timestamp_written = FALSE;
 
-               for (p = 0; p < ctx->num_enabled_probes; p++) {
-                       index = g_array_index(ctx->probeindices, int, p);
+               for (p = 0; p < ctx->num_enabled_channels; p++) {
+                       index = g_array_index(ctx->channelindices, int, p);
 
                        curbit = ((unsigned)sample[index / 8]
                                        >> (index % 8)) & 1;
 
                        curbit = ((unsigned)sample[index / 8]
                                        >> (index % 8)) & 1;
index 84163a30e65dfd38b1610a08b708c434dbc11725..da11321c09ceba009afd9e00cbc87efd2b14c882 100644 (file)
@@ -113,11 +113,11 @@ SR_API int sr_session_load(const char *filename)
        struct zip_file *zf;
        struct zip_stat zs;
        struct sr_dev_inst *sdi;
        struct zip_file *zf;
        struct zip_stat zs;
        struct sr_dev_inst *sdi;
-       struct sr_channel *probe;
-       int ret, probenum, devcnt, i, j;
-       uint64_t tmp_u64, total_probes, enabled_probes, p;
+       struct sr_channel *ch;
+       int ret, channelnum, devcnt, i, j;
+       uint64_t tmp_u64, total_channels, enabled_channels, p;
        char **sections, **keys, *metafile, *val;
        char **sections, **keys, *metafile, *val;
-       char probename[SR_MAX_PROBENAME_LEN + 1];
+       char channelname[SR_MAX_PROBENAME_LEN + 1];
 
        if ((ret = sr_sessionfile_check(filename)) != SR_OK)
                return ret;
 
        if ((ret = sr_sessionfile_check(filename)) != SR_OK)
                return ret;
@@ -155,7 +155,7 @@ SR_API int sr_session_load(const char *filename)
                if (!strncmp(sections[i], "device ", 7)) {
                        /* device section */
                        sdi = NULL;
                if (!strncmp(sections[i], "device ", 7)) {
                        /* device section */
                        sdi = NULL;
-                       enabled_probes = total_probes = 0;
+                       enabled_channels = total_channels = 0;
                        keys = g_key_file_get_keys(kf, sections[i], NULL, NULL);
                        for (j = 0; keys[j]; j++) {
                                val = g_key_file_get_string(kf, sections[i], keys[j], NULL);
                        keys = g_key_file_get_keys(kf, sections[i], NULL, NULL);
                        for (j = 0; keys[j]; j++) {
                                val = g_key_file_get_string(kf, sections[i], keys[j], NULL);
@@ -181,32 +181,32 @@ SR_API int sr_session_load(const char *filename)
                                        sdi->driver->config_set(SR_CONF_CAPTURE_UNITSIZE,
                                                        g_variant_new_uint64(tmp_u64), sdi, NULL);
                                } else if (!strcmp(keys[j], "total probes")) {
                                        sdi->driver->config_set(SR_CONF_CAPTURE_UNITSIZE,
                                                        g_variant_new_uint64(tmp_u64), sdi, NULL);
                                } else if (!strcmp(keys[j], "total probes")) {
-                                       total_probes = strtoull(val, NULL, 10);
+                                       total_channels = strtoull(val, NULL, 10);
                                        sdi->driver->config_set(SR_CONF_NUM_LOGIC_PROBES,
                                        sdi->driver->config_set(SR_CONF_NUM_LOGIC_PROBES,
-                                                       g_variant_new_uint64(total_probes), sdi, NULL);
-                                       for (p = 0; p < total_probes; p++) {
-                                               snprintf(probename, SR_MAX_PROBENAME_LEN, "%" PRIu64, p);
-                                               if (!(probe = sr_probe_new(p, SR_PROBE_LOGIC, TRUE,
-                                                               probename)))
+                                                       g_variant_new_uint64(total_channels), sdi, NULL);
+                                       for (p = 0; p < total_channels; p++) {
+                                               snprintf(channelname, SR_MAX_PROBENAME_LEN, "%" PRIu64, p);
+                                               if (!(ch = sr_probe_new(p, SR_PROBE_LOGIC, TRUE,
+                                                               channelname)))
                                                        return SR_ERR;
                                                        return SR_ERR;
-                                               sdi->probes = g_slist_append(sdi->probes, probe);
+                                               sdi->channels = g_slist_append(sdi->channels, ch);
                                        }
                                } else if (!strncmp(keys[j], "probe", 5)) {
                                        if (!sdi)
                                                continue;
                                        }
                                } else if (!strncmp(keys[j], "probe", 5)) {
                                        if (!sdi)
                                                continue;
-                                       enabled_probes++;
+                                       enabled_channels++;
                                        tmp_u64 = strtoul(keys[j]+5, NULL, 10);
                                        /* sr_session_save() */
                                        sr_dev_probe_name_set(sdi, tmp_u64 - 1, val);
                                } else if (!strncmp(keys[j], "trigger", 7)) {
                                        tmp_u64 = strtoul(keys[j]+5, NULL, 10);
                                        /* sr_session_save() */
                                        sr_dev_probe_name_set(sdi, tmp_u64 - 1, val);
                                } else if (!strncmp(keys[j], "trigger", 7)) {
-                                       probenum = strtoul(keys[j]+7, NULL, 10);
-                                       sr_dev_trigger_set(sdi, probenum, val);
+                                       channelnum = strtoul(keys[j]+7, NULL, 10);
+                                       sr_dev_trigger_set(sdi, channelnum, val);
                                }
                        }
                        g_strfreev(keys);
                                }
                        }
                        g_strfreev(keys);
-                       /* Disable probes not specifically listed. */
-                       if (total_probes)
-                               for (p = enabled_probes; p < total_probes; p++)
+                       /* Disable channels not specifically listed. */
+                       if (total_channels)
+                               for (p = enabled_channels; p < total_channels; p++)
                                        sr_dev_probe_enable(sdi, p, FALSE);
                }
                devcnt++;
                                        sr_dev_probe_enable(sdi, p, FALSE);
                }
                devcnt++;
@@ -234,12 +234,12 @@ SR_API int sr_session_load(const char *filename)
 SR_API int sr_session_save(const char *filename, const struct sr_dev_inst *sdi,
                unsigned char *buf, int unitsize, int units)
 {
 SR_API int sr_session_save(const char *filename, const struct sr_dev_inst *sdi,
                unsigned char *buf, int unitsize, int units)
 {
-       struct sr_channel *probe;
+       struct sr_channel *ch;
        GSList *l;
        GVariant *gvar;
        uint64_t samplerate;
        int cnt, ret;
        GSList *l;
        GVariant *gvar;
        uint64_t samplerate;
        int cnt, ret;
-       char **probe_names;
+       char **channel_names;
 
        samplerate = 0;
        if (sr_dev_has_option(sdi, SR_CONF_SAMPLERATE)) {
 
        samplerate = 0;
        if (sr_dev_has_option(sdi, SR_CONF_SAMPLERATE)) {
@@ -250,21 +250,21 @@ SR_API int sr_session_save(const char *filename, const struct sr_dev_inst *sdi,
                }
        }
 
                }
        }
 
-       probe_names = g_malloc0(sizeof(char *) * (g_slist_length(sdi->probes) + 1));
+       channel_names = g_malloc0(sizeof(char *) * (g_slist_length(sdi->channels) + 1));
        cnt = 0;
        cnt = 0;
-       for (l = sdi->probes; l; l = l->next) {
-               probe = l->data;
-               if (probe->type != SR_PROBE_LOGIC)
+       for (l = sdi->channels; l; l = l->next) {
+               ch = l->data;
+               if (ch->type != SR_PROBE_LOGIC)
                        continue;
                        continue;
-               if (probe->enabled != TRUE)
+               if (ch->enabled != TRUE)
                        continue;
                        continue;
-               if (!probe->name)
+               if (!ch->name)
                        continue;
                /* Just borrowing the ptr. */
                        continue;
                /* Just borrowing the ptr. */
-               probe_names[cnt++] = probe->name;
+               channel_names[cnt++] = ch->name;
        }
 
        }
 
-       if ((ret = sr_session_save_init(filename, samplerate, probe_names)) != SR_OK)
+       if ((ret = sr_session_save_init(filename, samplerate, channel_names)) != SR_OK)
                return ret;
 
        ret = sr_session_append(filename, buf, unitsize, units);
                return ret;
 
        ret = sr_session_append(filename, buf, unitsize, units);
@@ -278,15 +278,15 @@ SR_API int sr_session_save(const char *filename, const struct sr_dev_inst *sdi,
  * @param filename The name of the filename to save the current session as.
  *                 Must not be NULL.
  * @param samplerate The samplerate to store for this session.
  * @param filename The name of the filename to save the current session as.
  *                 Must not be NULL.
  * @param samplerate The samplerate to store for this session.
- * @param probes A NULL-terminated array of strings containing the names
- * of all the probes active in this session.
+ * @param channels A NULL-terminated array of strings containing the names
+ * of all the channels active in this session.
  *
  * @retval SR_OK Success
  * @retval SR_ERR_ARG Invalid arguments
  * @retval SR_ERR Other errors
  */
 SR_API int sr_session_save_init(const char *filename, uint64_t samplerate,
  *
  * @retval SR_OK Success
  * @retval SR_ERR_ARG Invalid arguments
  * @retval SR_ERR Other errors
  */
 SR_API int sr_session_save_init(const char *filename, uint64_t samplerate,
-               char **probes)
+               char **channels)
 {
        FILE *meta;
        struct zip *zipfile;
 {
        FILE *meta;
        struct zip *zipfile;
@@ -329,15 +329,15 @@ SR_API int sr_session_save_init(const char *filename, uint64_t samplerate,
        /* metadata */
        fprintf(meta, "capturefile = logic-1\n");
        cnt = 0;
        /* metadata */
        fprintf(meta, "capturefile = logic-1\n");
        cnt = 0;
-       for (i = 0; probes[i]; i++)
+       for (i = 0; channels[i]; i++)
                cnt++;
        fprintf(meta, "total probes = %d\n", cnt);
        s = sr_samplerate_string(samplerate);
        fprintf(meta, "samplerate = %s\n", s);
        g_free(s);
 
                cnt++;
        fprintf(meta, "total probes = %d\n", cnt);
        s = sr_samplerate_string(samplerate);
        fprintf(meta, "samplerate = %s\n", s);
        g_free(s);
 
-       for (i = 0; probes[i]; i++)
-               fprintf(meta, "probe%d = %s\n", i + 1, probes[i]);
+       for (i = 0; channels[i]; i++)
+               fprintf(meta, "probe%d = %s\n", i + 1, channels[i]);
 
        fclose(meta);
 
 
        fclose(meta);
 
index 356f6f8384efcdf7a8303c153bf482fff9009705..1acbf3de98236345d9bd0a9ad27e45e1bf7d75ed 100644 (file)
--- a/strutil.c
+++ b/strutil.c
@@ -360,9 +360,9 @@ SR_API char *sr_voltage_string(uint64_t v_p, uint64_t v_q)
  *            intended. Must not be NULL. Also, sdi->driver and
  *            sdi->driver->info_get must not be NULL.
  * @param triggerstring The string containing the trigger specification for
  *            intended. Must not be NULL. Also, sdi->driver and
  *            sdi->driver->info_get must not be NULL.
  * @param triggerstring The string containing the trigger specification for
- *        one or more probes of this device. Entries for multiple probes are
+ *        one or more channels of this device. Entries for multiple channels are
  *        comma-separated. Triggers are specified in the form key=value,
  *        comma-separated. Triggers are specified in the form key=value,
- *        where the key is a probe number (or probe name) and the value is
+ *        where the key is a channel number (or channel name) and the value is
  *        the requested trigger type. Valid trigger types currently
  *        include 'r' (rising edge), 'f' (falling edge), 'c' (any pin value
  *        change), '0' (low value), or '1' (high value).
  *        the requested trigger type. Valid trigger types currently
  *        include 'r' (rising edge), 'f' (falling edge), 'c' (any pin value
  *        change), '0' (low value), or '1' (high value).
@@ -370,27 +370,27 @@ SR_API char *sr_voltage_string(uint64_t v_p, uint64_t v_q)
  *
  * @return Pointer to a list of trigger types (strings), or NULL upon errors.
  *         The pointer list (if non-NULL) has as many entries as the
  *
  * @return Pointer to a list of trigger types (strings), or NULL upon errors.
  *         The pointer list (if non-NULL) has as many entries as the
- *         respective device has probes (all physically available probes,
+ *         respective device has channels (all physically available channels,
  *         not just enabled ones). Entries of the list which don't have
  *         a trigger value set in 'triggerstring' are NULL, the other entries
  *         contain the respective trigger type which is requested for the
  *         not just enabled ones). Entries of the list which don't have
  *         a trigger value set in 'triggerstring' are NULL, the other entries
  *         contain the respective trigger type which is requested for the
- *         respective probe (e.g. "r", "c", and so on).
+ *         respective channel (e.g. "r", "c", and so on).
  */
 SR_API char **sr_parse_triggerstring(const struct sr_dev_inst *sdi,
                                     const char *triggerstring)
 {
        GSList *l;
        GVariant *gvar;
  */
 SR_API char **sr_parse_triggerstring(const struct sr_dev_inst *sdi,
                                     const char *triggerstring)
 {
        GSList *l;
        GVariant *gvar;
-       struct sr_channel *probe;
-       int max_probes, probenum, i;
+       struct sr_channel *ch;
+       int max_channels, channelnum, i;
        char **tokens, **triggerlist, *trigger, *tc;
        const char *trigger_types;
        gboolean error;
 
        char **tokens, **triggerlist, *trigger, *tc;
        const char *trigger_types;
        gboolean error;
 
-       max_probes = g_slist_length(sdi->probes);
+       max_channels = g_slist_length(sdi->channels);
        error = FALSE;
 
        error = FALSE;
 
-       if (!(triggerlist = g_try_malloc0(max_probes * sizeof(char *)))) {
+       if (!(triggerlist = g_try_malloc0(max_channels * sizeof(char *)))) {
                sr_err("%s: triggerlist malloc failed", __func__);
                return NULL;
        }
                sr_err("%s: triggerlist malloc failed", __func__);
                return NULL;
        }
@@ -402,21 +402,21 @@ SR_API char **sr_parse_triggerstring(const struct sr_dev_inst *sdi,
        }
        trigger_types = g_variant_get_string(gvar, NULL);
 
        }
        trigger_types = g_variant_get_string(gvar, NULL);
 
-       tokens = g_strsplit(triggerstring, ",", max_probes);
+       tokens = g_strsplit(triggerstring, ",", max_channels);
        for (i = 0; tokens[i]; i++) {
        for (i = 0; tokens[i]; i++) {
-               probenum = -1;
-               for (l = sdi->probes; l; l = l->next) {
-                       probe = (struct sr_channel *)l->data;
-                       if (probe->enabled
-                               && !strncmp(probe->name, tokens[i],
-                                       strlen(probe->name))) {
-                               probenum = probe->index;
+               channelnum = -1;
+               for (l = sdi->channels; l; l = l->next) {
+                       ch = (struct sr_channel *)l->data;
+                       if (ch->enabled
+                               && !strncmp(ch->name, tokens[i],
+                                       strlen(ch->name))) {
+                               channelnum = ch->index;
                                break;
                        }
                }
 
                                break;
                        }
                }
 
-               if (probenum < 0 || probenum >= max_probes) {
-                       sr_err("Invalid probe.");
+               if (channelnum < 0 || channelnum >= max_channels) {
+                       sr_err("Invalid channel.");
                        error = TRUE;
                        break;
                }
                        error = TRUE;
                        break;
                }
@@ -431,14 +431,14 @@ SR_API char **sr_parse_triggerstring(const struct sr_dev_inst *sdi,
                                }
                        }
                        if (!error)
                                }
                        }
                        if (!error)
-                               triggerlist[probenum] = g_strdup(trigger);
+                               triggerlist[channelnum] = g_strdup(trigger);
                }
        }
        g_strfreev(tokens);
        g_variant_unref(gvar);
 
        if (error) {
                }
        }
        g_strfreev(tokens);
        g_variant_unref(gvar);
 
        if (error) {
-               for (i = 0; i < max_probes; i++)
+               for (i = 0; i < max_channels; i++)
                        g_free(triggerlist[i]);
                g_free(triggerlist);
                triggerlist = NULL;
                        g_free(triggerlist[i]);
                g_free(triggerlist);
                triggerlist = NULL;
index 09b697e817024d8e4c28cadf0acb353f9c27338b..b3dc819090d094a22059ef472b39214197873f49 100644 (file)
@@ -213,7 +213,7 @@ void srtest_buf_to_file(const char *filename, const uint8_t *buf, uint64_t len)
 
 GArray *srtest_get_enabled_logic_probes(const struct sr_dev_inst *sdi)
 {
 
 GArray *srtest_get_enabled_logic_probes(const struct sr_dev_inst *sdi)
 {
-       struct sr_channel *probe;
+       struct sr_channel *ch;
        GArray *probes;
        GSList *l;
 
        GArray *probes;
        GSList *l;