]> sigrok.org Git - libsigrok.git/commitdiff
Rename various *PROBE* macros to *CHANNEL*.
authorUwe Hermann <redacted>
Mon, 24 Mar 2014 21:39:42 +0000 (22:39 +0100)
committerUwe Hermann <redacted>
Tue, 25 Mar 2014 19:58:54 +0000 (20:58 +0100)
This fixes parts of bug #259.

72 files changed:
bindings/python/sigrok/core/classes.py
device.c
hardware/agilent-dmm/api.c
hardware/alsa/protocol.c
hardware/appa-55ii/api.c
hardware/appa-55ii/protocol.c
hardware/appa-55ii/protocol.h
hardware/asix-sigma/asix-sigma.c
hardware/atten-pps3xxx/api.c
hardware/brymen-bm86x/api.c
hardware/brymen-dmm/api.c
hardware/cem-dt-885x/api.c
hardware/center-3xx/api.c
hardware/chronovu-la8/api.c
hardware/chronovu-la8/protocol.c
hardware/chronovu-la8/protocol.h
hardware/colead-slm/api.c
hardware/conrad-digi-35-cpu/api.c
hardware/demo/demo.c
hardware/fluke-dmm/api.c
hardware/fx2lafw/api.c
hardware/gmc-mh-1x-2x/api.c
hardware/hameg-hmo/api.c
hardware/hameg-hmo/protocol.c
hardware/hantek-dso/api.c
hardware/ikalogic-scanalogic2/api.c
hardware/ikalogic-scanalogic2/protocol.c
hardware/ikalogic-scanalogic2/protocol.h
hardware/ikalogic-scanaplus/api.c
hardware/kecheng-kc-330b/api.c
hardware/lascar-el-usb/protocol.c
hardware/link-mso19/api.c
hardware/link-mso19/protocol.h
hardware/mic-985xx/api.c
hardware/norma-dmm/api.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/sysclk-lwla/api.c
hardware/sysclk-lwla/protocol.c
hardware/sysclk-lwla/protocol.h
hardware/teleinfo/api.c
hardware/tondaj-sl-814/api.c
hardware/uni-t-dmm/api.c
hardware/uni-t-ut32x/api.c
hardware/victor-dmm/api.c
hardware/zeroplus-logic-cube/api.c
hwdriver.c
input/binary.c
input/chronovu_la8.c
input/csv.c
input/vcd.c
input/wav.c
libsigrok-internal.h
libsigrok.h
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/vcd.c
session_driver.c
session_file.c
tests/lib.c

index d5038a0c20762e7ffe5e85f27383df332744f496..d4e209f3890ee9c32c2c1e161d108f288ab009b7 100644 (file)
@@ -26,7 +26,7 @@ import itertools
 
 __all__ = ['Error', 'Context', 'Driver', 'Device', 'Session', 'Packet', 'Log',
     'LogLevel', 'PacketType', 'Quantity', 'Unit', 'QuantityFlag', 'ConfigKey',
-    'ProbeType', 'Probe', 'ChannelGroup', 'InputFormat', 'OutputFormat',
+    'ChannelType', 'Channel', 'ChannelGroup', 'InputFormat', 'OutputFormat',
     'InputFile', 'Output']
 
 class Error(Exception):
@@ -173,7 +173,7 @@ class Device(object):
             device = super(Device, cls).__new__(cls)
             device.struct = struct
             device.context = context
-            device._probes = None
+            device._channels = None
             device._channel_groups = None
             context._devices[address] = device
         return context._devices[address]
@@ -191,15 +191,15 @@ class Device(object):
         return self.struct.version
 
     @property
-    def probes(self):
-        if self._probes is None:
-            self._probes = {}
-            probe_list = self.struct.probes
-            while (probe_list):
-                probe_ptr = void_ptr_to_sr_channel_ptr(probe_list.data)
-                self._probes[probe_ptr.name] = Probe(self, probe_ptr)
-                probe_list = probe_list.next
-        return self._probes
+    def channels(self):
+        if self._channels is None:
+            self._channels = {}
+            channel_list = self.struct.channels
+            while (channel_list):
+                channel_ptr = void_ptr_to_sr_channel_ptr(channel_list.data)
+                self._channels[channel_ptr.name] = Channel(self, channel_ptr)
+                channel_list = channel_list.next
+        return self._channels
 
     @property
     def channel_groups(self):
@@ -244,7 +244,7 @@ class HardwareDevice(Device):
             return
         check(sr_config_set(self.struct, None, key.id, python_to_gvariant(value)))
 
-class Probe(object):
+class Channel(object):
 
     def __init__(self, device, struct):
         self.device = device
@@ -252,7 +252,7 @@ class Probe(object):
 
     @property
     def type(self):
-        return ProbeType(self.struct.type)
+        return ChannelType(self.struct.type)
 
     @property
     def enabled(self):
@@ -307,7 +307,7 @@ class ChannelGroup(object):
             channel_list = self.struct.channels
             while (channel_list):
                 channel_ptr = void_ptr_to_sr_channel_ptr(channel_list.data)
-                self._channels.append(Probe(self, probe_ptr))
+                self._channels.append(Channel(self, channel_ptr))
                 channel_list = channel_list.next
         return self._channels
 
@@ -606,7 +606,7 @@ class ConfigKey(EnumValue):
 class DataType(EnumValue):
     pass
 
-class ProbeType(EnumValue):
+class ChannelType(EnumValue):
     pass
 
 for symbol_name in dir(lowlevel):
@@ -618,7 +618,7 @@ for symbol_name in dir(lowlevel):
         ('SR_MQFLAG_', QuantityFlag),
         ('SR_CONF_', ConfigKey),
         ('SR_T_', DataType),
-        ('SR_PROBE_', ProbeType)]:
+        ('SR_CHANNEL_', ChannelType)]:
         if symbol_name.startswith(prefix):
             name = symbol_name[len(prefix):]
             value = getattr(lowlevel, symbol_name)
index 04adcccf081d768f45d6cd9ecfafbd09b8ddbb65..4cdae580076c0c51fcce8d3edee2c1b70b594a51 100644 (file)
--- a/device.c
+++ b/device.c
@@ -143,7 +143,7 @@ SR_API int sr_dev_probe_enable(const struct sr_dev_inst *sdi, int channelnum,
                        if (!state != !was_enabled && sdi->driver
                                        && sdi->driver->config_probe_set) {
                                ret = sdi->driver->config_probe_set(
-                                       sdi, ch, SR_PROBE_SET_ENABLED);
+                                       sdi, ch, SR_CHANNEL_SET_ENABLED);
                                /* Roll back change if it wasn't applicable. */
                                if (ret == SR_ERR_ARG)
                                        ch->enabled = was_enabled;
@@ -195,7 +195,7 @@ SR_API int sr_dev_trigger_set(const struct sr_dev_inst *sdi, int channelnum,
 
                        if (sdi->driver && sdi->driver->config_probe_set) {
                                ret = sdi->driver->config_probe_set(
-                                       sdi, ch, SR_PROBE_SET_TRIGGER);
+                                       sdi, ch, SR_CHANNEL_SET_TRIGGER);
                                /* Roll back change if it wasn't applicable. */
                                if (ret == SR_ERR_ARG) {
                                        g_free(ch->trigger);
index bbe4c71f08b4f06616c00ae0014f3231846a8946..ccc2f65cd5ccaaa893c42e0f507aa6d531b0ed3d 100644 (file)
@@ -141,7 +141,7 @@ static GSList *scan(GSList *options)
                        sdi->conn = serial;
                        sdi->priv = devc;
                        sdi->driver = di;
-                       if (!(ch = sr_channel_new(0, SR_PROBE_ANALOG, TRUE, "P1")))
+                       if (!(ch = sr_channel_new(0, SR_CHANNEL_ANALOG, TRUE, "P1")))
                                return NULL;
                        sdi->channels = g_slist_append(sdi->channels, ch);
                        drvc->instances = g_slist_append(drvc->instances, sdi);
index 987e7a7e68bf510ee7006f7069388ba1b6774e08..6975d2fb8843df6415af96cf61fd8b34b6346f51 100644 (file)
@@ -159,7 +159,7 @@ static void alsa_scan_handle_dev(GSList **devices,
 
        for (i = 0; i < devc->num_channels; i++) {
                snprintf(p_name, sizeof(p_name), "Ch_%d", i);
-               if (!(ch = sr_channel_new(i, SR_PROBE_ANALOG, TRUE, p_name)))
+               if (!(ch = sr_channel_new(i, SR_CHANNEL_ANALOG, TRUE, p_name)))
                        goto scan_error_cleanup;
                sdi->channels = g_slist_append(sdi->channels, ch);
        }
index 8bbe45a0872c64e670ecefbf454fb1b28fb23759..764607837cc945305f1a3d5ed9e86b1095c5b5d8 100644 (file)
@@ -111,10 +111,10 @@ static GSList *scan(GSList *options)
        sdi->priv = devc;
        sdi->driver = di;
 
-       if (!(ch = sr_channel_new(0, SR_PROBE_ANALOG, TRUE, "T1")))
+       if (!(ch = sr_channel_new(0, SR_CHANNEL_ANALOG, TRUE, "T1")))
                goto scan_cleanup;
        sdi->channels = g_slist_append(sdi->channels, ch);
-       if (!(ch = sr_channel_new(0, SR_PROBE_ANALOG, TRUE, "T2")))
+       if (!(ch = sr_channel_new(0, SR_CHANNEL_ANALOG, TRUE, "T2")))
                goto scan_cleanup;
        sdi->channels = g_slist_append(sdi->channels, ch);
 
index aa77a9610d01617ca28e56b0bd0a80ebea0f1f1e..708262bd779403fd1cfd65f7c20afd7a3a89a8fa 100644 (file)
@@ -93,7 +93,7 @@ static void appa_55ii_live_data(struct sr_dev_inst *sdi, const uint8_t *buf)
        struct sr_datafeed_packet packet;
        struct sr_datafeed_analog analog;
        struct sr_channel *ch;
-       float values[APPA_55II_NUM_PROBES], *val_ptr;
+       float values[APPA_55II_NUM_CHANNELS], *val_ptr;
        int i;
 
        devc = sdi->priv;
@@ -109,7 +109,7 @@ static void appa_55ii_live_data(struct sr_dev_inst *sdi, const uint8_t *buf)
        analog.mqflags = appa_55ii_flags(buf);
        analog.data = values;
 
-       for (i = 0; i < APPA_55II_NUM_PROBES; i++) {
+       for (i = 0; i < APPA_55II_NUM_CHANNELS; i++) {
                ch = g_slist_nth_data(sdi->channels, i);
                if (!ch->enabled)
                        continue;
@@ -139,7 +139,7 @@ static void appa_55ii_log_data_parse(struct sr_dev_inst *sdi)
        struct sr_datafeed_packet packet;
        struct sr_datafeed_analog analog;
        struct sr_channel *ch;
-       float values[APPA_55II_NUM_PROBES], *val_ptr;
+       float values[APPA_55II_NUM_CHANNELS], *val_ptr;
        const uint8_t *buf;
        int16_t temp;
        int offset, i;
@@ -160,7 +160,7 @@ static void appa_55ii_log_data_parse(struct sr_dev_inst *sdi)
                analog.unit = SR_UNIT_CELSIUS;
                analog.data = values;
 
-               for (i = 0; i < APPA_55II_NUM_PROBES; i++) {
+               for (i = 0; i < APPA_55II_NUM_CHANNELS; i++) {
                        temp = RL16(buf + 12 + 2 * i);
                        ch = g_slist_nth_data(sdi->channels, i);
                        if (!ch->enabled)
index 38a35564c6051af618fe041b234c90846fbe5481..fa3c247694a4c2b9b680b18e84c2fbc4c250fdca 100644 (file)
@@ -27,7 +27,7 @@
 
 #define LOG_PREFIX "appa-55ii"
 
-#define APPA_55II_NUM_PROBES  2
+#define APPA_55II_NUM_CHANNELS  2
 #define APPA_55II_BUF_SIZE    (4 + 32 + 1)
 #define DEFAULT_DATA_SOURCE   DATA_SOURCE_LIVE
 
index d32e91287e24447f89def9e6cb1c0d8887072b58..5ec308374c54b4bf0b352c0941f0f7c0e82982c3 100644 (file)
@@ -38,7 +38,7 @@
 #define USB_MODEL_NAME                 "SIGMA"
 #define USB_MODEL_VERSION              ""
 #define TRIGGER_TYPE                   "rf10"
-#define NUM_PROBES                     16
+#define NUM_CHANNELS                   16
 
 SR_PRIV struct sr_dev_driver asix_sigma_driver_info;
 static struct sr_dev_driver *di = &asix_sigma_driver_info;
@@ -62,7 +62,7 @@ static const uint64_t samplerates[] = {
  * 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 *channel_names[NUM_PROBES + 1] = {
+static const char *channel_names[NUM_CHANNELS + 1] = {
        "1", "2", "3", "4", "5", "6", "7", "8",
        "9", "10", "11", "12", "13", "14", "15", "16",
        NULL,
@@ -464,7 +464,7 @@ static GSList *scan(GSList *options)
        sdi->driver = di;
 
        for (i = 0; channel_names[i]; i++) {
-               if (!(ch = sr_channel_new(i, SR_PROBE_LOGIC, TRUE,
+               if (!(ch = sr_channel_new(i, SR_CHANNEL_LOGIC, TRUE,
                                channel_names[i])))
                        return NULL;
                sdi->channels = g_slist_append(sdi->channels, ch);
index e74c40de179dd3acdb9a19d6d5667ce6c7c43228..3b9f002569a0706a389f09a1081cc178ce218dc9 100644 (file)
@@ -167,7 +167,7 @@ static GSList *scan(GSList *options, int modelid)
        sdi->conn = serial;
        for (i = 0; i < MAX_CHANNELS; i++) {
                snprintf(channel, 10, "CH%d", i + 1);
-               ch = sr_channel_new(i, SR_PROBE_ANALOG, TRUE, channel);
+               ch = sr_channel_new(i, SR_CHANNEL_ANALOG, TRUE, channel);
                sdi->channels = g_slist_append(sdi->channels, ch);
                cg = g_malloc(sizeof(struct sr_channel_group));
                cg->name = g_strdup(channel);
index 1c7aaa2f13321ee5b3c133efb8ebfd39d0c0b5e3..169721d4dfa6a4d13a2c4d26189489c35315e2a4 100644 (file)
@@ -86,10 +86,10 @@ static GSList *scan(GSList *options)
 
                sdi->priv = devc;
                sdi->driver = di;
-               if (!(ch = sr_channel_new(0, SR_PROBE_ANALOG, TRUE, "P1")))
+               if (!(ch = sr_channel_new(0, SR_CHANNEL_ANALOG, TRUE, "P1")))
                        return NULL;
                sdi->channels = g_slist_append(sdi->channels, ch);
-               if (!(ch = sr_channel_new(0, SR_PROBE_ANALOG, TRUE, "P2")))
+               if (!(ch = sr_channel_new(0, SR_CHANNEL_ANALOG, TRUE, "P2")))
                        return NULL;
                sdi->channels = g_slist_append(sdi->channels, ch);
 
index 52b49a18a55888cf5d4ed6ad4558cf8053022a08..ca4a742c3ed36337273943dfd1dfcb432a886cf2 100644 (file)
@@ -89,7 +89,7 @@ static GSList *brymen_scan(const char *conn, const char *serialcomm)
        sdi->priv = devc;
        sdi->driver = di;
 
-       if (!(ch = sr_channel_new(0, SR_PROBE_ANALOG, TRUE, "P1")))
+       if (!(ch = sr_channel_new(0, SR_CHANNEL_ANALOG, TRUE, "P1")))
                goto scan_cleanup;
 
        sdi->channels = g_slist_append(sdi->channels, ch);
index 7170c6f7f168da8dccbaddd64b389437c816fad5..1b56227e2358b848fdfda8f2cdf334c750cbdab1 100644 (file)
@@ -126,7 +126,7 @@ static GSList *scan(GSList *options)
                        sdi->inst_type = SR_INST_SERIAL;
                        sdi->priv = devc;
                        sdi->driver = di;
-                       if (!(ch = sr_channel_new(0, SR_PROBE_ANALOG, TRUE, "SPL")))
+                       if (!(ch = sr_channel_new(0, SR_CHANNEL_ANALOG, TRUE, "SPL")))
                                return NULL;
                        sdi->channels = g_slist_append(sdi->channels, ch);
                        drvc->instances = g_slist_append(drvc->instances, sdi);
index 68fa1d5509632e363c063041091f86d0c3af8e93..ddac1540bd4cfa62c8f14cd293d56d3f4752880e 100644 (file)
@@ -103,7 +103,7 @@ 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++) {
-               if (!(ch = sr_channel_new(i, SR_PROBE_ANALOG,
+               if (!(ch = sr_channel_new(i, SR_CHANNEL_ANALOG,
                                           TRUE, channel_names[i])))
                        goto scan_cleanup;
                sdi->channels = g_slist_append(sdi->channels, ch);
index 75757c24d41cd2046c71dfda8a6928d142fc8ad3..896ee74ae51f746a7b89c59c8ed3c43cbb7afe78 100644 (file)
@@ -154,7 +154,7 @@ static GSList *scan(GSList *options)
        sdi->priv = devc;
 
        for (i = 0; chronovu_la8_channel_names[i]; i++) {
-               if (!(ch = sr_channel_new(i, SR_PROBE_LOGIC, TRUE,
+               if (!(ch = sr_channel_new(i, SR_CHANNEL_LOGIC, TRUE,
                                           chronovu_la8_channel_names[i])))
                        return NULL;
                sdi->channels = g_slist_append(sdi->channels, ch);
index 85d21d992f385e4ff3987bdad680014ad5095d6b..587849e96983e7d37d4049335d660f3863d2d803 100644 (file)
@@ -25,7 +25,7 @@
 #include "protocol.h"
 
 /* Probes are numbered 0-7. */
-SR_PRIV const char *chronovu_la8_channel_names[NUM_PROBES + 1] = {
+SR_PRIV const char *chronovu_la8_channel_names[NUM_CHANNELS + 1] = {
        "0", "1", "2", "3", "4", "5", "6", "7",
        NULL,
 };
index 2887ba03cd65ef73ac4c22708295a3e0532a504f..5136b770f2efa0c8a9a6565d5e8fb98d5e224ff2 100644 (file)
@@ -35,7 +35,7 @@
 #define USB_MODEL_NAME                 "LA8"
 #define USB_MODEL_VERSION              ""
 
-#define NUM_PROBES                     8
+#define NUM_CHANNELS                   8
 #define TRIGGER_TYPE                   "01"
 #define SDRAM_SIZE                     (8 * 1024 * 1024)
 #define MIN_NUM_SAMPLES                        1
index cd3b8ce88ba997308a18e4ee3063e9222c298fd3..f65882723cb1a37f06ebec8afeb27d9a2176b135 100644 (file)
@@ -97,7 +97,7 @@ static GSList *scan(GSList *options)
        sdi->inst_type = SR_INST_SERIAL;
        sdi->priv = devc;
        sdi->driver = di;
-       if (!(ch = sr_channel_new(0, SR_PROBE_ANALOG, TRUE, "P1")))
+       if (!(ch = sr_channel_new(0, SR_CHANNEL_ANALOG, TRUE, "P1")))
                return NULL;
        sdi->channels = g_slist_append(sdi->channels, ch);
        drvc->instances = g_slist_append(drvc->instances, sdi);
index 7a21fb7752bb7f86142fa13977816461c81e21d3..2f24d189718c34916c5706eec9c5037a4f2acd9f 100644 (file)
@@ -101,7 +101,7 @@ static GSList *scan(GSList *options)
        sdi->conn = serial;
        sdi->priv = NULL;
        sdi->driver = di;
-       if (!(ch = sr_channel_new(0, SR_PROBE_ANALOG, TRUE, "CH1")))
+       if (!(ch = sr_channel_new(0, SR_CHANNEL_ANALOG, TRUE, "CH1")))
                return NULL;
        sdi->channels = g_slist_append(sdi->channels, ch);
 
index 3573d50e2afd392f8c6fd6b7f38da0a86800960f..07ae253aa40f189e391029bc00ee70290ad379e0 100644 (file)
@@ -34,8 +34,8 @@
 
 #define LOG_PREFIX "demo"
 
-#define DEFAULT_NUM_LOGIC_PROBES     8
-#define DEFAULT_NUM_ANALOG_PROBES    4
+#define DEFAULT_NUM_LOGIC_CHANNELS     8
+#define DEFAULT_NUM_ANALOG_CHANNELS    4
 
 /* The size in bytes of chunks to send through the session bus. */
 #define LOGIC_BUFSIZE        4096
@@ -127,8 +127,8 @@ struct dev_context {
 };
 
 static const int32_t scanopts[] = {
-       SR_CONF_NUM_LOGIC_PROBES,
-       SR_CONF_NUM_ANALOG_PROBES,
+       SR_CONF_NUM_LOGIC_CHANNELS,
+       SR_CONF_NUM_ANALOG_CHANNELS,
 };
 
 static const int devopts[] = {
@@ -265,15 +265,15 @@ static GSList *scan(GSList *options)
 
        drvc = di->priv;
 
-       num_logic_channels = DEFAULT_NUM_LOGIC_PROBES;
-       num_analog_channels = DEFAULT_NUM_ANALOG_PROBES;
+       num_logic_channels = DEFAULT_NUM_LOGIC_CHANNELS;
+       num_analog_channels = DEFAULT_NUM_ANALOG_CHANNELS;
        for (l = options; l; l = l->next) {
                src = l->data;
                switch (src->key) {
-               case SR_CONF_NUM_LOGIC_PROBES:
+               case SR_CONF_NUM_LOGIC_CHANNELS:
                        num_logic_channels = g_variant_get_int32(src->data);
                        break;
-               case SR_CONF_NUM_ANALOG_PROBES:
+               case SR_CONF_NUM_ANALOG_CHANNELS:
                        num_analog_channels = g_variant_get_int32(src->data);
                        break;
                }
@@ -309,7 +309,7 @@ static GSList *scan(GSList *options)
        cg->priv = NULL;
        for (i = 0; i < num_logic_channels; i++) {
                sprintf(channel_name, "D%d", i);
-               if (!(ch = sr_channel_new(i, SR_PROBE_LOGIC, TRUE, channel_name)))
+               if (!(ch = sr_channel_new(i, SR_CHANNEL_LOGIC, TRUE, channel_name)))
                        return NULL;
                sdi->channels = g_slist_append(sdi->channels, ch);
                cg->channels = g_slist_append(cg->channels, ch);
@@ -322,7 +322,7 @@ static GSList *scan(GSList *options)
        for (i = 0; i < num_analog_channels; i++) {
                sprintf(channel_name, "A%d", i);
                if (!(ch = sr_channel_new(i + num_logic_channels,
-                               SR_PROBE_ANALOG, TRUE, channel_name)))
+                               SR_CHANNEL_ANALOG, TRUE, channel_name)))
                        return NULL;
                sdi->channels = g_slist_append(sdi->channels, ch);
 
@@ -407,20 +407,20 @@ static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi,
                if (!cg)
                        return SR_ERR_CHANNEL_GROUP;
                ch = cg->channels->data;
-               if (ch->type == SR_PROBE_LOGIC) {
+               if (ch->type == SR_CHANNEL_LOGIC) {
                        pattern = devc->logic_pattern;
                        *data = g_variant_new_string(logic_pattern_str[pattern]);
-               } else if (ch->type == SR_PROBE_ANALOG) {
+               } else if (ch->type == SR_CHANNEL_ANALOG) {
                        ag = cg->priv;
                        pattern = ag->pattern;
                        *data = g_variant_new_string(analog_pattern_str[pattern]);
                } else
                        return SR_ERR_BUG;
                break;
-       case SR_CONF_NUM_LOGIC_PROBES:
+       case SR_CONF_NUM_LOGIC_CHANNELS:
                *data = g_variant_new_int32(devc->num_logic_channels);
                break;
-       case SR_CONF_NUM_ANALOG_PROBES:
+       case SR_CONF_NUM_ANALOG_CHANNELS:
                *data = g_variant_new_int32(devc->num_analog_channels);
                break;
        default:
@@ -467,7 +467,7 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
                stropt = g_variant_get_string(data, NULL);
                ch = cg->channels->data;
                pattern = -1;
-               if (ch->type == SR_PROBE_LOGIC) {
+               if (ch->type == SR_CHANNEL_LOGIC) {
                        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]);
-               } else if (ch->type == SR_PROBE_ANALOG) {
+               } else if (ch->type == SR_CHANNEL_ANALOG) {
                        for (i = 0; i < ARRAY_SIZE(analog_pattern_str); i++) {
                                if (!strcmp(stropt, analog_pattern_str[i])) {
                                        pattern = i;
@@ -550,10 +550,10 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
                                        devopts_cg, ARRAY_SIZE(devopts_cg), sizeof(int32_t));
                        break;
                case SR_CONF_PATTERN_MODE:
-                       if (ch->type == SR_PROBE_LOGIC)
+                       if (ch->type == SR_CHANNEL_LOGIC)
                                *data = g_variant_new_strv(logic_pattern_str,
                                                ARRAY_SIZE(logic_pattern_str));
-                       else if (ch->type == SR_PROBE_ANALOG)
+                       else if (ch->type == SR_CHANNEL_ANALOG)
                                *data = g_variant_new_strv(analog_pattern_str,
                                                ARRAY_SIZE(analog_pattern_str));
                        else
index f2453aa2bf4439dcd3f9cb5ee7d0b256d1ccb27a..e0dee04b8ec907e704b535566b9a385fb76eabd6 100644 (file)
@@ -135,7 +135,7 @@ static GSList *fluke_scan(const char *conn, const char *serialcomm)
                                sdi->conn = serial;
                                sdi->priv = devc;
                                sdi->driver = di;
-                               if (!(ch = sr_channel_new(0, SR_PROBE_ANALOG, TRUE, "P1")))
+                               if (!(ch = sr_channel_new(0, SR_CHANNEL_ANALOG, TRUE, "P1")))
                                        return NULL;
                                sdi->channels = g_slist_append(sdi->channels, ch);
                                drvc->instances = g_slist_append(drvc->instances, sdi);
index eabf6bd7cd0334322c4c683a342cd19f4d6d8127..b1b338f7bdfe7b6f7b977e2a510ad42f23b02861 100644 (file)
@@ -197,7 +197,7 @@ static GSList *scan(GSList *options)
                /* 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_channel_new(j, SR_PROBE_LOGIC, TRUE,
+                       if (!(ch = sr_channel_new(j, SR_CHANNEL_LOGIC, TRUE,
                                        channel_names[j])))
                                return NULL;
                        sdi->channels = g_slist_append(sdi->channels, ch);
index 2f05993e3a01aacd8321c53d74e86533e5245f49..ec12ab2fa06128e83d88494281e3db6e632af74f 100644 (file)
@@ -240,7 +240,7 @@ static GSList *scan_1x_2x_rs232(GSList *options)
                sdi->conn = serial;
                sdi->priv = devc;
                sdi->driver = &gmc_mh_1x_2x_rs232_driver_info;
-               if (!(ch = sr_channel_new(0, SR_PROBE_ANALOG, TRUE, "P1")))
+               if (!(ch = sr_channel_new(0, SR_CHANNEL_ANALOG, TRUE, "P1")))
                        return NULL;
                sdi->channels = g_slist_append(sdi->channels, ch);
                drvc->instances = g_slist_append(drvc->instances, sdi);
@@ -343,7 +343,7 @@ static GSList *scan_2x_bd232(GSList *options)
                        sdi->conn = serial;
                        sdi->priv = devc;
                        sdi->driver = &gmc_mh_2x_bd232_driver_info;
-                       if (!(ch = sr_channel_new(0, SR_PROBE_ANALOG, TRUE, "P1")))
+                       if (!(ch = sr_channel_new(0, SR_CHANNEL_ANALOG, TRUE, "P1")))
                                goto exit_err;
                        sdi->channels = g_slist_append(sdi->channels, ch);
                        drvc->instances = g_slist_append(drvc->instances, sdi);
index bfc0f62aa6e5b68c4f766d2213308fa95980ce5e..f348f87ada3624640d1e9fe9020318bfe6991400 100644 (file)
@@ -575,12 +575,12 @@ SR_PRIV int hmo_request_data(const struct sr_dev_inst *sdi)
        ch = devc->current_channel->data;
 
        switch (ch->type) {
-       case SR_PROBE_ANALOG:
+       case SR_CHANNEL_ANALOG:
                g_snprintf(command, sizeof(command),
                           (*model->scpi_dialect)[SCPI_CMD_GET_ANALOG_DATA],
                           ch->index + 1);
                break;
-       case SR_PROBE_LOGIC:
+       case SR_CHANNEL_LOGIC:
                g_snprintf(command, sizeof(command),
                           (*model->scpi_dialect)[SCPI_CMD_GET_DIG_DATA],
                           ch->index < 8 ? 1 : 2);
@@ -604,13 +604,13 @@ static int hmo_check_channels(GSList *channels)
        for (l = channels; l; l = l->next) {
                ch = l->data;
                switch (ch->type) {
-               case SR_PROBE_ANALOG:
+               case SR_CHANNEL_ANALOG:
                        if (ch->index == 2)
                                enabled_chan3 = TRUE;
                        else if (ch->index == 3)
                                enabled_chan4 = TRUE;
                        break;
-               case SR_PROBE_LOGIC:
+               case SR_CHANNEL_LOGIC:
                        if (ch->index < 8)
                                enabled_pod1 = TRUE;
                        else
@@ -651,7 +651,7 @@ static int hmo_setup_channels(const struct sr_dev_inst *sdi)
        for (l = sdi->channels; l; l = l->next) {
                ch = l->data;
                switch (ch->type) {
-               case SR_PROBE_ANALOG:
+               case SR_CHANNEL_ANALOG:
                        if (ch->enabled == state->analog_channels[ch->index].state)
                                break;
                        g_snprintf(command, sizeof(command),
@@ -663,7 +663,7 @@ static int hmo_setup_channels(const struct sr_dev_inst *sdi)
                        state->analog_channels[ch->index].state = ch->enabled;
                        setup_changed = TRUE;
                        break;
-               case SR_PROBE_LOGIC:
+               case SR_CHANNEL_LOGIC:
                        /*
                         * A digital POD needs to be enabled for every group of
                         * 8 channels.
@@ -728,10 +728,10 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi, void *cb_data)
                if (!ch->enabled)
                        continue;
                /* Only add a single digital channel. */
-               if (ch->type != SR_PROBE_LOGIC || !digital_added) {
+               if (ch->type != SR_CHANNEL_LOGIC || !digital_added) {
                        devc->enabled_channels = g_slist_append(
                                        devc->enabled_channels, ch);
-                       if (ch->type == SR_PROBE_LOGIC)
+                       if (ch->type == SR_CHANNEL_LOGIC)
                                digital_added = TRUE;
                }
        }
index 6348da18a520f10d56af2a03743efd3aa81be961..afa6efe375673b3ac9a9935d73d9c4ba1616b58a 100644 (file)
@@ -614,7 +614,7 @@ 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++) {
-               if (!(ch = sr_channel_new(i, SR_PROBE_ANALOG, TRUE,
+               if (!(ch = sr_channel_new(i, SR_CHANNEL_ANALOG, TRUE,
                           (*scope_models[model_index].analog_names)[i])))
                        return SR_ERR_MALLOC;
                sdi->channels = g_slist_append(sdi->channels, ch);
@@ -637,7 +637,7 @@ 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++) {
-               if (!(ch = sr_channel_new(i, SR_PROBE_LOGIC, TRUE,
+               if (!(ch = sr_channel_new(i, SR_CHANNEL_LOGIC, TRUE,
                           (*scope_models[model_index].digital_names)[i])))
                        return SR_ERR_MALLOC;
                sdi->channels = g_slist_append(sdi->channels, ch);
@@ -677,7 +677,7 @@ SR_PRIV int hmo_receive_data(int fd, int revents, void *cb_data)
                ch = devc->current_channel->data;
 
                switch (ch->type) {
-               case SR_PROBE_ANALOG:
+               case SR_CHANNEL_ANALOG:
                        if (sr_scpi_get_floatv(sdi->conn, NULL, &data) != SR_OK) {
                                if (data)
                                        g_array_free(data, TRUE);
@@ -700,7 +700,7 @@ SR_PRIV int hmo_receive_data(int fd, int revents, void *cb_data)
                        g_slist_free(analog.channels);
                        g_array_free(data, TRUE);
                        break;
-               case SR_PROBE_LOGIC:
+               case SR_CHANNEL_LOGIC:
                        if (sr_scpi_get_uint8v(sdi->conn, NULL, &data) != SR_OK) {
                                if (data)
                                        g_free(data);
index 924516056ea865c561e1e550891c8d23ecbd08ed..76696d57525e3b17dd75a15e41a0348985d0c482 100644 (file)
@@ -176,7 +176,7 @@ static struct sr_dev_inst *dso_dev_new(int index, const struct dso_profile *prof
         * a trigger source internal to the device.
         */
        for (i = 0; channel_names[i]; i++) {
-               if (!(ch = sr_channel_new(i, SR_PROBE_ANALOG, TRUE,
+               if (!(ch = sr_channel_new(i, SR_CHANNEL_ANALOG, TRUE,
                                channel_names[i])))
                        return NULL;
                sdi->channels = g_slist_append(sdi->channels, ch);
index 9ff4a2857bcdb1935129a9c5e6300649bc3fee62..e586011ebd149e98b90c57bbe3cc150b2c204480 100644 (file)
@@ -41,7 +41,7 @@ SR_PRIV const uint64_t sl2_samplerates[NUM_SAMPLERATES] = {
        SR_MHZ(20),
 };
 
-static const char *channel_names[NUM_PROBES + 1] = {
+static const char *channel_names[NUM_CHANNELS + 1] = {
        "0", "1", "2", "3",
        NULL,
 };
@@ -137,7 +137,7 @@ static GSList *scan(GSList *options)
                sdi->conn = usb;
 
                for (i = 0; channel_names[i]; i++) {
-                       ch = sr_channel_new(i, SR_PROBE_LOGIC, TRUE,
+                       ch = sr_channel_new(i, SR_CHANNEL_LOGIC, TRUE,
                                channel_names[i]);
                        sdi->channels = g_slist_append(sdi->channels, ch);
                        devc->channels[i] = ch;
@@ -449,7 +449,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi, void *cb_data)
         * Count the number of enabled channels and number them for a sequential
         * access.
         */
-       for (i = 0, j = 0; i < NUM_PROBES; i++) {
+       for (i = 0, j = 0; i < NUM_CHANNELS; i++) {
                if (devc->channels[i]->enabled) {
                        devc->num_enabled_channels++;
                        devc->channel_map[j] = i;
index dd460d42d0f6fecab04455b880b214ac15ef9fd2..b99709c636b314388fc45ef0d6fee50de58a0c66 100644 (file)
@@ -89,7 +89,7 @@ static void process_sample_data(const struct sr_dev_inst *sdi)
        struct dev_context *devc;
        struct sr_datafeed_packet packet;
        struct sr_datafeed_logic logic;
-       uint8_t i, j, tmp, buffer[PACKET_NUM_SAMPLES], *ptr[NUM_PROBES];
+       uint8_t i, j, tmp, buffer[PACKET_NUM_SAMPLES], *ptr[NUM_CHANNELS];
        uint16_t offset, n = 0;
        int8_t k;
 
@@ -526,7 +526,7 @@ SR_PRIV void sl2_configure_trigger(const struct sr_dev_inst *sdi)
         * Set trigger to any edge on all channels if the trigger for each
         * channel is set to any edge.
         */
-       if (num_triggers_anyedge == NUM_PROBES) {
+       if (num_triggers_anyedge == NUM_CHANNELS) {
                devc->trigger_channel = TRIGGER_CHANNEL_ALL;
                devc->trigger_type = TRIGGER_TYPE_ANYEDGE;
        }
index 26adeedb5efffd3516bcb231db307aeaa4319e45..3b411e69362de7d3258a845d163d392ad441a933 100644 (file)
@@ -47,7 +47,7 @@
 #define USB_HID_REPORT_TYPE_FEATURE    0x300
 
 #define NUM_SAMPLERATES                        11
-#define NUM_PROBES                     4
+#define NUM_CHANNELS                   4
 
 #define TRIGGER_TYPES                  "rfc"
 
@@ -152,7 +152,7 @@ struct dev_context {
        void *cb_data;
 
        /* Array to provide an index based access to all channels. */
-       const struct sr_channel *channels[NUM_PROBES];
+       const struct sr_channel *channels[NUM_CHANNELS];
 
        struct libusb_transfer *xfer_in, *xfer_out;
 
@@ -194,7 +194,7 @@ struct dev_context {
         * channel except the last one. The samples of the last channel will be
         * processed directly after they will be received.
         */
-       uint8_t sample_buffer[NUM_PROBES - 1][MAX_DEV_SAMPLE_BYTES];
+       uint8_t sample_buffer[NUM_CHANNELS - 1][MAX_DEV_SAMPLE_BYTES];
 
        /* Expected number of sample packets for each channel. */
        uint16_t num_sample_packets;
@@ -212,7 +212,7 @@ struct dev_context {
        unsigned int num_enabled_channels;
 
        /* Array to provide a sequential access to all enabled channel indices. */
-       uint8_t channel_map[NUM_PROBES];
+       uint8_t channel_map[NUM_CHANNELS];
 
        /* Indicates whether a transfer failed. */
        gboolean transfer_error;
index 369aed470b11c475a7366b4bd7347c7d631331a9..e855097730aa51515bfb857652fbab212e1fbaab 100644 (file)
@@ -133,7 +133,7 @@ static GSList *scan(GSList *options)
        sdi->priv = devc;
 
        for (i = 0; channel_names[i]; i++) {
-               if (!(ch = sr_channel_new(i, SR_PROBE_LOGIC, TRUE,
+               if (!(ch = sr_channel_new(i, SR_CHANNEL_LOGIC, TRUE,
                                           channel_names[i])))
                        return NULL;
                sdi->channels = g_slist_append(sdi->channels, ch);
index 21d202f56e690e9943efe5e1f153ab322baf3933..57dafdfc6d6df4d4d8f7228a8c2bee1f6dae3d36 100644 (file)
@@ -135,7 +135,7 @@ static GSList *scan(GSList *options)
                        sdi->driver = di;
                        sdi->inst_type = SR_INST_USB;
                        sdi->conn = l->data;
-                       if (!(ch = sr_channel_new(0, SR_PROBE_ANALOG, TRUE, "SPL")))
+                       if (!(ch = sr_channel_new(0, SR_CHANNEL_ANALOG, TRUE, "SPL")))
                                return NULL;
                        sdi->channels = g_slist_append(sdi->channels, ch);
 
index 5347e1eb8604c9c7315f9ae66a267274a061891c..050b42bb1eb8494655f9072beac43272511769e0 100644 (file)
@@ -330,18 +330,18 @@ static struct sr_dev_inst *lascar_identify(unsigned char *config)
 
                if (profile->logformat == LOG_TEMP_RH) {
                        /* Model this as two channels: temperature and humidity. */
-                       if (!(ch = sr_channel_new(0, SR_PROBE_ANALOG, TRUE, "Temp")))
+                       if (!(ch = sr_channel_new(0, SR_CHANNEL_ANALOG, TRUE, "Temp")))
                                return NULL;
                        sdi->channels = g_slist_append(NULL, ch);
-                       if (!(ch = sr_channel_new(0, SR_PROBE_ANALOG, TRUE, "Hum")))
+                       if (!(ch = sr_channel_new(0, SR_CHANNEL_ANALOG, TRUE, "Hum")))
                                return NULL;
                        sdi->channels = g_slist_append(sdi->channels, ch);
                } else if (profile->logformat == LOG_CO) {
-                       if (!(ch = sr_channel_new(0, SR_PROBE_ANALOG, TRUE, "CO")))
+                       if (!(ch = sr_channel_new(0, SR_CHANNEL_ANALOG, TRUE, "CO")))
                                return NULL;
                        sdi->channels = g_slist_append(NULL, ch);
                } else {
-                       if (!(ch = sr_channel_new(0, SR_PROBE_ANALOG, TRUE, "P1")))
+                       if (!(ch = sr_channel_new(0, SR_CHANNEL_ANALOG, TRUE, "P1")))
                                return NULL;
                        sdi->channels = g_slist_append(NULL, ch);
                }
index 9e0273aec6b0e80b4aa17c3fa8156016137f93f6..384b52c4660f126722b6484f4ad499248957bed3 100644 (file)
@@ -37,7 +37,7 @@ static const int32_t hwcaps[] = {
  *
  * See also: http://www.linkinstruments.com/images/mso19_1113.gif
  */
-SR_PRIV const char *mso19_channel_names[NUM_PROBES + 1] = {
+SR_PRIV const char *mso19_channel_names[NUM_CHANNELS + 1] = {
        /* Note: DSO needs to be first. */
        "DSO", "0", "1", "2", "3", "4", "5", "6", "7", NULL,
 };
@@ -216,9 +216,9 @@ static GSList *scan(GSList *options)
                sdi->driver = di;
                sdi->priv = devc;
 
-               for (i = 0; i < NUM_PROBES; i++) {
+               for (i = 0; i < NUM_CHANNELS; i++) {
                        struct sr_channel *ch;
-                       ptype = (i == 0) ? SR_PROBE_ANALOG : SR_PROBE_LOGIC;
+                       ptype = (i == 0) ? SR_CHANNEL_ANALOG : SR_CHANNEL_LOGIC;
                        if (!(ch = sr_channel_new(i, ptype, TRUE,
                                                   mso19_channel_names[i])))
                                return 0;
index 48502c5aca28648cef856b602ae258bfa0cc5263..809d7f87177648b5756f57b20a03a30a410639b6 100644 (file)
@@ -34,7 +34,7 @@
 #define USB_VENDOR             "3195"
 #define USB_PRODUCT            "f190"
 
-#define NUM_PROBES             (1 + 8)
+#define NUM_CHANNELS           (1 + 8)
 #define NUM_TRIGGER_STAGES     4
 #define TRIGGER_TYPE           "01"    //the first r/f is used for the whole group
 #define SERIALCOMM             "460800/8n1/flow=2"
index 09cd7d60de0e3b38e159d4b2f41c89c98549063b..2709c530ea6a03622f3ff340bf0e2ae382334e7f 100644 (file)
@@ -101,12 +101,12 @@ static GSList *mic_scan(const char *conn, const char *serialcomm, int idx)
        sdi->priv = devc;
        sdi->driver = mic_devs[idx].di;
 
-       if (!(ch = sr_channel_new(0, SR_PROBE_ANALOG, TRUE, "Temperature")))
+       if (!(ch = sr_channel_new(0, SR_CHANNEL_ANALOG, TRUE, "Temperature")))
                goto scan_cleanup;
        sdi->channels = g_slist_append(sdi->channels, ch);
 
        if (mic_devs[idx].has_humidity) {
-               if (!(ch = sr_channel_new(1, SR_PROBE_ANALOG, TRUE, "Humidity")))
+               if (!(ch = sr_channel_new(1, SR_CHANNEL_ANALOG, TRUE, "Humidity")))
                        goto scan_cleanup;
                sdi->channels = g_slist_append(sdi->channels, ch);
        }
index 7a98f9589f39eeade446246481375468fedad4d9..13a40512ba120008c323d6b917224ba0fe0c7c6c 100644 (file)
@@ -128,7 +128,7 @@ static GSList *scan(GSList *options)
                        sdi->conn = serial;
                        sdi->priv = devc;
                        sdi->driver = di;
-                       if (!(ch = sr_channel_new(0, SR_PROBE_ANALOG, TRUE,
+                       if (!(ch = sr_channel_new(0, SR_CHANNEL_ANALOG, TRUE,
                                "P1")))
                                return NULL;
                        sdi->channels = g_slist_append(sdi->channels, ch);
index 8284db1530765c1467b680de8fd7f3f3a530949a..bcc41ed2522d200b7516c943844336f4b8c7c437 100644 (file)
@@ -62,7 +62,7 @@ static const char *patterns[] = {
 };
 
 /* Channels are numbered 0-31 (on the PCB silkscreen). */
-SR_PRIV const char *ols_channel_names[NUM_PROBES + 1] = {
+SR_PRIV const char *ols_channel_names[NUM_CHANNELS + 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",
@@ -177,7 +177,7 @@ static GSList *scan(GSList *options)
                                "Sump", "Logic Analyzer", "v1.0");
                sdi->driver = di;
                for (i = 0; i < 32; i++) {
-                       if (!(ch = sr_channel_new(i, SR_PROBE_LOGIC, TRUE,
+                       if (!(ch = sr_channel_new(i, SR_CHANNEL_LOGIC, TRUE,
                                        ols_channel_names[i])))
                                return 0;
                        sdi->channels = g_slist_append(sdi->channels, ch);
@@ -323,10 +323,10 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
        case SR_CONF_SWAP:
                if (g_variant_get_boolean(data)) {
                        sr_info("Enabling channel swapping.");
-                       devc->flag_reg |= FLAG_SWAP_PROBES;
+                       devc->flag_reg |= FLAG_SWAP_CHANNELS;
                } else {
                        sr_info("Disabling channel swapping.");
-                       devc->flag_reg &= ~FLAG_SWAP_PROBES;
+                       devc->flag_reg &= ~FLAG_SWAP_CHANNELS;
                }
                ret = SR_OK;
                break;
index 89f68429e2afb1624206bc0bfb7db3beaa089d80..45304473a1ccd7b5a2027e609f799fbd48107373 100644 (file)
@@ -203,7 +203,7 @@ SR_PRIV struct sr_dev_inst *get_metadata(struct sr_serial_dev_inst *serial)
                        case 0x00:
                                /* Number of usable channels */
                                for (ui = 0; ui < tmp_int; ui++) {
-                                       if (!(ch = sr_channel_new(ui, SR_PROBE_LOGIC, TRUE,
+                                       if (!(ch = sr_channel_new(ui, SR_CHANNEL_LOGIC, TRUE,
                                                        ols_channel_names[ui])))
                                                return 0;
                                        sdi->channels = g_slist_append(sdi->channels, ch);
@@ -241,7 +241,7 @@ SR_PRIV struct sr_dev_inst *get_metadata(struct sr_serial_dev_inst *serial)
                        case 0x00:
                                /* Number of usable channels */
                                for (ui = 0; ui < tmp_c; ui++) {
-                                       if (!(ch = sr_channel_new(ui, SR_PROBE_LOGIC, TRUE,
+                                       if (!(ch = sr_channel_new(ui, SR_CHANNEL_LOGIC, TRUE,
                                                        ols_channel_names[ui])))
                                                return 0;
                                        sdi->channels = g_slist_append(sdi->channels, ch);
@@ -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;
-               devc->max_channels = NUM_PROBES / 2;
+               devc->max_channels = NUM_CHANNELS / 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->max_channels = NUM_PROBES;
+               devc->max_channels = NUM_CHANNELS;
                devc->cur_samplerate_divider = (CLOCK_RATE / samplerate) - 1;
        }
 
@@ -357,7 +357,7 @@ SR_PRIV int ols_receive_data(int fd, int revents, void *cb_data)
        }
 
        num_channels = 0;
-       for (i = NUM_PROBES; i > 0x02; i /= 2) {
+       for (i = NUM_CHANNELS; i > 0x02; i /= 2) {
                if ((devc->flag_reg & i) == 0) {
                        num_channels++;
                }
index 111ac69f2dfd3987b8f7a5811df14c3a7d1e5988..98831b586ef7ce4a16e6172fe63cfa7cb236ffa5 100644 (file)
@@ -28,7 +28,7 @@
 
 #define LOG_PREFIX "ols"
 
-#define NUM_PROBES             32
+#define NUM_CHANNELS             32
 #define NUM_TRIGGER_STAGES     4
 #define TRIGGER_TYPE           "01"
 #define SERIAL_SPEED           B115200
@@ -56,7 +56,7 @@
 /* 12-13 unused, 14-15 RLE mode (we hardcode mode 0). */
 #define FLAG_INTERNAL_TEST_MODE    (1 << 11)
 #define FLAG_EXTERNAL_TEST_MODE    (1 << 10)
-#define FLAG_SWAP_PROBES           (1 << 9)
+#define FLAG_SWAP_CHANNELS           (1 << 9)
 #define FLAG_RLE                   (1 << 8)
 #define FLAG_SLOPE_FALLING         (1 << 7)
 #define FLAG_CLOCK_EXTERNAL        (1 << 6)
@@ -103,7 +103,7 @@ struct dev_context {
 };
 
 
-SR_PRIV extern const char *ols_channel_names[NUM_PROBES + 1];
+SR_PRIV extern const char *ols_channel_names[NUM_CHANNELS + 1];
 
 SR_PRIV int send_shortcommand(struct sr_serial_dev_inst *serial,
                uint8_t command);
index 0ed76e52ec377a789fb13d3753f969a707716bb0..57bfd033a8587a34dc286cb94521d83502aedc46 100644 (file)
@@ -335,7 +335,7 @@ 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;
-               ch = sr_channel_new(i, SR_PROBE_ANALOG, TRUE, channel_name);
+               ch = sr_channel_new(i, SR_CHANNEL_ANALOG, TRUE, channel_name);
                sdi->channels = g_slist_append(sdi->channels, ch);
                devc->analog_groups[i].name = channel_name;
                devc->analog_groups[i].channels = g_slist_append(NULL, ch);
@@ -347,7 +347,7 @@ 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;
-                       ch = sr_channel_new(i, SR_PROBE_LOGIC, TRUE, channel_name);
+                       ch = sr_channel_new(i, SR_CHANNEL_LOGIC, TRUE, channel_name);
                        g_free(channel_name);
                        if (!ch)
                                return NULL;
@@ -445,7 +445,7 @@ static int analog_frame_size(const struct sr_dev_inst *sdi)
 
        for (l = sdi->channels; l; l = l->next) {
                ch = l->data;
-               if (ch->type == SR_PROBE_ANALOG && ch->enabled)
+               if (ch->type == SR_CHANNEL_ANALOG && ch->enabled)
                        analog_channels++;
        }
 
@@ -501,7 +501,7 @@ static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi,
                ch = g_slist_nth_data(cg->channels, 0);
                if (!ch)
                        return SR_ERR;
-               if (ch->type == SR_PROBE_ANALOG) {
+               if (ch->type == SR_CHANNEL_ANALOG) {
                        if (ch->name[2] < '1' || ch->name[2] > '4')
                                return SR_ERR;
                        analog_channel = ch->name[2] - '1';
@@ -880,7 +880,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi, void *cb_data)
        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->type == SR_CHANNEL_ANALOG) {
                        if (ch->enabled)
                                devc->enabled_analog_channels = g_slist_append(
                                                devc->enabled_analog_channels, ch);
@@ -891,7 +891,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi, void *cb_data)
                                        return SR_ERR;
                                devc->analog_channels[ch->index] = ch->enabled;
                        }
-               } else if (ch->type == SR_PROBE_LOGIC) {
+               } else if (ch->type == SR_CHANNEL_LOGIC) {
                        if (ch->enabled) {
                                devc->enabled_digital_channels = g_slist_append(
                                                devc->enabled_digital_channels, ch);
index ac177f149a07a4832bc0fe7d4a9fe97965bd19f6..97cb353c6ca597d1b9fe19b7e94396a0c043d7e8 100644 (file)
@@ -386,7 +386,7 @@ SR_PRIV int rigol_ds_channel_start(const struct sr_dev_inst *sdi)
        sr_dbg("Starting reading data from channel %d", ch->index + 1);
 
        if (devc->model->series->protocol <= PROTOCOL_V2) {
-               if (ch->type == SR_PROBE_LOGIC) {
+               if (ch->type == SR_CHANNEL_LOGIC) {
                        if (sr_scpi_send(sdi->conn, ":WAV:DATA? DIG") != SR_OK)
                                return SR_ERR;
                } else {
@@ -524,7 +524,7 @@ SR_PRIV int rigol_ds_receive(int fd, int revents, void *cb_data)
 
                ch = devc->channel_entry->data;
 
-               expected_data_bytes = ch->type == SR_PROBE_ANALOG ?
+               expected_data_bytes = ch->type == SR_CHANNEL_ANALOG ?
                                devc->analog_frame_size : devc->digital_frame_size;
 
                if (devc->num_block_bytes == 0) {
@@ -586,7 +586,7 @@ SR_PRIV int rigol_ds_receive(int fd, int revents, void *cb_data)
 
                devc->num_block_read += len;
 
-               if (ch->type == SR_PROBE_ANALOG) {
+               if (ch->type == SR_CHANNEL_ANALOG) {
                        vref = devc->vert_reference[ch->index];
                        vdiv = devc->vdiv[ch->index] / 25.6;
                        offset = devc->vert_offset[ch->index];
@@ -658,7 +658,7 @@ SR_PRIV int rigol_ds_receive(int fd, int revents, void *cb_data)
                                rigol_ds_config_set(sdi, ":WAV:END");
                }
 
-               if (ch->type == SR_PROBE_ANALOG
+               if (ch->type == SR_CHANNEL_ANALOG
                                && devc->channel_entry->next != NULL) {
                        /* We got the frame for this analog channel, but
                         * there's another analog channel. */
index 458ae3be73041a77fe8af2590f31ab78dedcf82a..0117628ca04e72e6451d4b5680c670889db19497 100644 (file)
@@ -31,8 +31,8 @@
 /* Size of acquisition buffers */
 #define ACQ_BUFFER_SIZE 32768
 
-#define MAX_ANALOG_PROBES 4
-#define MAX_DIGITAL_PROBES 16
+#define MAX_ANALOG_CHANNELS 4
+#define MAX_DIGITAL_CHANNELS 16
 
 enum protocol_version {
        PROTOCOL_V1, /* VS5000 */
@@ -98,7 +98,7 @@ struct dev_context {
        uint64_t num_vdivs;
 
        /* Channel groups */
-       struct sr_channel_group analog_groups[MAX_ANALOG_PROBES];
+       struct sr_channel_group analog_groups[MAX_ANALOG_CHANNELS];
        struct sr_channel_group digital_group;
 
        /* Acquisition settings */
@@ -111,17 +111,17 @@ struct dev_context {
        uint64_t digital_frame_size;
 
        /* Device settings */
-       gboolean analog_channels[MAX_ANALOG_PROBES];
-       gboolean digital_channels[MAX_DIGITAL_PROBES];
+       gboolean analog_channels[MAX_ANALOG_CHANNELS];
+       gboolean digital_channels[MAX_DIGITAL_CHANNELS];
        gboolean la_enabled;
        float timebase;
-       float vdiv[MAX_ANALOG_PROBES];
-       int vert_reference[MAX_ANALOG_PROBES];
-       float vert_offset[MAX_ANALOG_PROBES];
+       float vdiv[MAX_ANALOG_CHANNELS];
+       int vert_reference[MAX_ANALOG_CHANNELS];
+       float vert_offset[MAX_ANALOG_CHANNELS];
        char *trigger_source;
        float horiz_triggerpos;
        char *trigger_slope;
-       char *coupling[MAX_ANALOG_PROBES];
+       char *coupling[MAX_ANALOG_CHANNELS];
 
        /* Operational state */
 
index 3759b8251e216def8ecafc381fb06e09b8af82d9..cfd5022552402cac04c5e1e079f5f433b83736bf 100644 (file)
@@ -195,7 +195,7 @@ static GSList *scan(GSList *options)
                sdi->driver = di;
 
                for (j = 0; channel_names[j]; j++) {
-                       if (!(ch = sr_channel_new(j, SR_PROBE_LOGIC, TRUE,
+                       if (!(ch = sr_channel_new(j, SR_CHANNEL_LOGIC, TRUE,
                                                   channel_names[j])))
                                return NULL;
                        sdi->channels = g_slist_append(sdi->channels, ch);
index f69fe4be79f2388050cdc3f40b71e67fbf74779d..96138743e85e473c664afd7b800eafcbf8835930 100644 (file)
@@ -405,7 +405,7 @@ static GSList *sdmm_scan(const char *conn, const char *serialcomm, int dmm)
 
        sdi->priv = devc;
        sdi->driver = dmms[dmm].di;
-       if (!(ch = sr_channel_new(0, SR_PROBE_ANALOG, TRUE, "P1")))
+       if (!(ch = sr_channel_new(0, SR_CHANNEL_ANALOG, TRUE, "P1")))
                goto scan_cleanup;
        sdi->channels = g_slist_append(sdi->channels, ch);
        drvc->instances = g_slist_append(drvc->instances, sdi);
index ac1932a4d11d7e5d788657e296e9391417a9030d..de5929fe14c42a3cadda08a541b663be12c97737 100644 (file)
@@ -85,7 +85,7 @@ static GSList *gen_channel_list(int num_channels)
                /* The LWLA series simply number channels from CH1 to CHxx. */
                g_snprintf(name, sizeof(name), "CH%d", i);
 
-               ch = sr_channel_new(i - 1, SR_PROBE_LOGIC, TRUE, name);
+               ch = sr_channel_new(i - 1, SR_CHANNEL_LOGIC, TRUE, name);
                list = g_slist_prepend(list, ch);
        }
 
@@ -118,7 +118,7 @@ static struct sr_dev_inst *dev_inst_new(int device_index)
        devc->samplerate = DEFAULT_SAMPLERATE;
 
        sdi->priv = devc;
-       sdi->channels = gen_channel_list(NUM_PROBES);
+       sdi->channels = gen_channel_list(NUM_CHANNELS);
 
        return sdi;
 }
@@ -414,13 +414,13 @@ static int config_probe_set(const struct sr_dev_inst *sdi,
        if (!devc)
                return SR_ERR_DEV_CLOSED;
 
-       if (ch->index < 0 || ch->index >= NUM_PROBES) {
+       if (ch->index < 0 || ch->index >= NUM_CHANNELS) {
                sr_err("Channel index %d out of range.", ch->index);
                return SR_ERR_BUG;
        }
        channel_bit = (uint64_t)1 << ch->index;
 
-       if ((changes & SR_PROBE_SET_ENABLED) != 0) {
+       if ((changes & SR_CHANNEL_SET_ENABLED) != 0) {
                /* Enable or disable input channel for this channel. */
                if (ch->enabled)
                        devc->channel_mask |= channel_bit;
@@ -428,7 +428,7 @@ static int config_probe_set(const struct sr_dev_inst *sdi,
                        devc->channel_mask &= ~channel_bit;
        }
 
-       if ((changes & SR_PROBE_SET_TRIGGER) != 0) {
+       if ((changes & SR_CHANNEL_SET_TRIGGER) != 0) {
                trigger_mask = devc->trigger_mask & ~channel_bit;
                trigger_values = devc->trigger_values & ~channel_bit;
                trigger_edge_mask = devc->trigger_edge_mask & ~channel_bit;
index 75b3806362c573ef2d5535b43416d9fe71e5f287..7bb1948d030c9b7a0bf60bbac1742a5eec65eeda 100644 (file)
@@ -545,7 +545,7 @@ static int process_sample_data(const struct sr_dev_inst *sdi)
 
                if (acq->rle == RLE_STATE_DATA) {
                        acq->sample = word & ALL_CHANNELS_MASK;
-                       acq->run_len = ((word >> NUM_PROBES) & 1) + 1;
+                       acq->run_len = ((word >> NUM_CHANNELS) & 1) + 1;
                        if (word & RLE_FLAG_LEN_FOLLOWS)
                                acq->rle = RLE_STATE_LEN;
                } else {
index 309a5977f73a48eed7bd2f4004d2a48f0f703717..d77db0f7c4cd83164e487dd99ac921d537b4d3bb 100644 (file)
 #define USB_INTERFACE  0
 #define USB_TIMEOUT    3000 /* ms */
 
-#define NUM_PROBES     34
+#define NUM_CHANNELS   34
 #define TRIGGER_TYPES  "01fr"
 
 /* Bit mask covering all 34 channels.
  */
-#define ALL_CHANNELS_MASK (((uint64_t)1 << NUM_PROBES) - 1)
+#define ALL_CHANNELS_MASK (((uint64_t)1 << NUM_CHANNELS) - 1)
 
 /** Unit and packet size for the sigrok logic datafeed.
  */
-#define UNIT_SIZE      ((NUM_PROBES + 7) / 8)
+#define UNIT_SIZE      ((NUM_CHANNELS + 7) / 8)
 #define PACKET_LENGTH  10000   /* units */
 
 /** Size of the acquisition buffer in device memory units.
index a81af6e929a8394f9d4f7744bb53536f6b3bd88c..0a490729e85cc4ef95e82fb26125789a4790b00e 100644 (file)
@@ -107,54 +107,54 @@ static GSList *scan(GSList *options)
        sdi->priv = devc;
        sdi->driver = di;
 
-       if (!(ch = sr_channel_new(0, SR_PROBE_ANALOG, TRUE, "P")))
+       if (!(ch = sr_channel_new(0, SR_CHANNEL_ANALOG, TRUE, "P")))
                goto scan_cleanup;
        sdi->channels = g_slist_append(sdi->channels, ch);
 
        if (devc->optarif == OPTARIF_BASE) {
-               if (!(ch = sr_channel_new(0, SR_PROBE_ANALOG, TRUE, "BASE")))
+               if (!(ch = sr_channel_new(0, SR_CHANNEL_ANALOG, TRUE, "BASE")))
                        goto scan_cleanup;
                sdi->channels = g_slist_append(sdi->channels, ch);
        } else if (devc->optarif == OPTARIF_HC) {
-               if (!(ch = sr_channel_new(0, SR_PROBE_ANALOG, TRUE, "HP")))
+               if (!(ch = sr_channel_new(0, SR_CHANNEL_ANALOG, TRUE, "HP")))
                        goto scan_cleanup;
                sdi->channels = g_slist_append(sdi->channels, ch);
-               if (!(ch = sr_channel_new(0, SR_PROBE_ANALOG, TRUE, "HC")))
+               if (!(ch = sr_channel_new(0, SR_CHANNEL_ANALOG, TRUE, "HC")))
                        goto scan_cleanup;
                sdi->channels = g_slist_append(sdi->channels, ch);
        } else if (devc->optarif == OPTARIF_EJP) {
-               if (!(ch = sr_channel_new(0, SR_PROBE_ANALOG, TRUE, "HN")))
+               if (!(ch = sr_channel_new(0, SR_CHANNEL_ANALOG, TRUE, "HN")))
                        goto scan_cleanup;
                sdi->channels = g_slist_append(sdi->channels, ch);
-               if (!(ch = sr_channel_new(0, SR_PROBE_ANALOG, TRUE, "HPM")))
+               if (!(ch = sr_channel_new(0, SR_CHANNEL_ANALOG, TRUE, "HPM")))
                        goto scan_cleanup;
                sdi->channels = g_slist_append(sdi->channels, ch);
        } else if (devc->optarif == OPTARIF_BBR) {
-               if (!(ch = sr_channel_new(0, SR_PROBE_ANALOG, TRUE, "HPJB")))
+               if (!(ch = sr_channel_new(0, SR_CHANNEL_ANALOG, TRUE, "HPJB")))
                        goto scan_cleanup;
                sdi->channels = g_slist_append(sdi->channels, ch);
-               if (!(ch = sr_channel_new(0, SR_PROBE_ANALOG, TRUE, "HPJW")))
+               if (!(ch = sr_channel_new(0, SR_CHANNEL_ANALOG, TRUE, "HPJW")))
                        goto scan_cleanup;
                sdi->channels = g_slist_append(sdi->channels, ch);
-               if (!(ch = sr_channel_new(0, SR_PROBE_ANALOG, TRUE, "HPJR")))
+               if (!(ch = sr_channel_new(0, SR_CHANNEL_ANALOG, TRUE, "HPJR")))
                        goto scan_cleanup;
                sdi->channels = g_slist_append(sdi->channels, ch);
-               if (!(ch = sr_channel_new(0, SR_PROBE_ANALOG, TRUE, "HCJB")))
+               if (!(ch = sr_channel_new(0, SR_CHANNEL_ANALOG, TRUE, "HCJB")))
                        goto scan_cleanup;
                sdi->channels = g_slist_append(sdi->channels, ch);
-               if (!(ch = sr_channel_new(0, SR_PROBE_ANALOG, TRUE, "HCJW")))
+               if (!(ch = sr_channel_new(0, SR_CHANNEL_ANALOG, TRUE, "HCJW")))
                        goto scan_cleanup;
                sdi->channels = g_slist_append(sdi->channels, ch);
-               if (!(ch = sr_channel_new(0, SR_PROBE_ANALOG, TRUE, "HCJR")))
+               if (!(ch = sr_channel_new(0, SR_CHANNEL_ANALOG, TRUE, "HCJR")))
                        goto scan_cleanup;
                sdi->channels = g_slist_append(sdi->channels, ch);
        }
 
-       if (!(ch = sr_channel_new(0, SR_PROBE_ANALOG, TRUE, "IINST")))
+       if (!(ch = sr_channel_new(0, SR_CHANNEL_ANALOG, TRUE, "IINST")))
                goto scan_cleanup;
        sdi->channels = g_slist_append(sdi->channels, ch);
 
-       if (!(ch = sr_channel_new(0, SR_PROBE_ANALOG, TRUE, "PAPP")))
+       if (!(ch = sr_channel_new(0, SR_CHANNEL_ANALOG, TRUE, "PAPP")))
                goto scan_cleanup;
        sdi->channels = g_slist_append(sdi->channels, ch);
 
index d2f6ccebf6c05c68d40bbadfb106638c82839a03..d112b19598b7c3d5b4f8ac3dd4ae9e0f03ecbdbd 100644 (file)
@@ -106,7 +106,7 @@ static GSList *scan(GSList *options)
 
        sdi->priv = devc;
        sdi->driver = di;
-       ch = sr_channel_new(0, SR_PROBE_ANALOG, TRUE, "P1");
+       ch = sr_channel_new(0, SR_CHANNEL_ANALOG, TRUE, "P1");
        if (!ch) {
                sr_err("Failed to create channel.");
                return NULL;
index 7aed4e1386d94e9b98dcba4766e07e26bdf95d2f..0ab3152b725d320a2eae73675409e6be08d406c9 100644 (file)
@@ -221,7 +221,7 @@ static GSList *scan(GSList *options, int dmm)
                }
                sdi->priv = devc;
                sdi->driver = udmms[dmm].di;
-               if (!(ch = sr_channel_new(0, SR_PROBE_ANALOG, TRUE, "P1")))
+               if (!(ch = sr_channel_new(0, SR_CHANNEL_ANALOG, TRUE, "P1")))
                        return NULL;
                sdi->channels = g_slist_append(sdi->channels, ch);
 
index cc09a4bcc002eb0695f5a1ae5d20776b8f84bccc..b38d2fb0d52a42c77f4bc486730c366750787d60 100644 (file)
@@ -86,7 +86,7 @@ static GSList *scan(GSList *options)
                        sdi->inst_type = SR_INST_USB;
                        sdi->conn = l->data;
                        for (i = 0; i < 3; i++) {
-                               if (!(ch = sr_channel_new(i, SR_PROBE_ANALOG, TRUE,
+                               if (!(ch = sr_channel_new(i, SR_CHANNEL_ANALOG, TRUE,
                                                channels[i]))) {
                                        sr_dbg("Channel malloc failed.");
                                        return NULL;
index 55c074d9c55f80dec21e0f9607a88e446097dd6d..74523ed7aabbfd4cef6e0baab92a0f917e3f4ce2 100644 (file)
@@ -88,7 +88,7 @@ static GSList *scan(GSList *options)
                        return NULL;
                sdi->priv = devc;
 
-               if (!(ch = sr_channel_new(0, SR_PROBE_ANALOG, TRUE, "P1")))
+               if (!(ch = sr_channel_new(0, SR_CHANNEL_ANALOG, TRUE, "P1")))
                        return NULL;
                sdi->channels = g_slist_append(NULL, ch);
 
index 4bc25a977e4b644b62fb9f38f024180f49e95c0a..a7fdc8f3785b068ace3f8e4047c2c097c66b638f 100644 (file)
@@ -316,7 +316,7 @@ static GSList *scan(GSList *options)
 
                /* Fill in channellist according to this device's profile. */
                for (j = 0; j < devc->num_channels; j++) {
-                       if (!(ch = sr_channel_new(j, SR_PROBE_LOGIC, TRUE,
+                       if (!(ch = sr_channel_new(j, SR_CHANNEL_LOGIC, TRUE,
                                        channel_names[j])))
                                return NULL;
                        sdi->channels = g_slist_append(sdi->channels, ch);
index f198e86325d8a581236255216e25a6d9c9ff2271..ee13d6e5816fd9404f2caa9e705380e52d535468 100644 (file)
@@ -96,9 +96,9 @@ static struct sr_config_info sr_config_info_data[] = {
                "Power off", NULL},
        {SR_CONF_DATA_SOURCE, SR_T_CHAR, "data_source",
                "Data source", NULL},
-       {SR_CONF_NUM_LOGIC_PROBES, SR_T_INT32, "logic_probes",
+       {SR_CONF_NUM_LOGIC_CHANNELS, SR_T_INT32, "logic_probes",
                "Number of logic probes", NULL},
-       {SR_CONF_NUM_ANALOG_PROBES, SR_T_INT32, "analog_probes",
+       {SR_CONF_NUM_ANALOG_CHANNELS, SR_T_INT32, "analog_probes",
                "Number of analog probes", NULL},
        {SR_CONF_OUTPUT_VOLTAGE, SR_T_FLOAT, "output_voltage",
                "Current output voltage", NULL},
index 50d1f9588264c6f44bad9c2de73126051a13a0cf..e0d4c1dd43576e195addacfe400eab3f6e681ee8 100644 (file)
@@ -29,7 +29,7 @@
 #define LOG_PREFIX "input/binary"
 
 #define CHUNKSIZE             (512 * 1024)
-#define DEFAULT_NUM_PROBES    8
+#define DEFAULT_NUM_CHANNELS  8
 
 struct context {
        uint64_t samplerate;
@@ -47,7 +47,7 @@ static int init(struct sr_input *in, const char *filename)
 {
        struct sr_channel *ch;
        int num_channels, i;
-       char name[SR_MAX_PROBENAME_LEN + 1];
+       char name[SR_MAX_CHANNELNAME_LEN + 1];
        char *param;
        struct context *ctx;
 
@@ -58,7 +58,7 @@ static int init(struct sr_input *in, const char *filename)
                return SR_ERR_MALLOC;
        }
 
-       num_channels = DEFAULT_NUM_PROBES;
+       num_channels = DEFAULT_NUM_CHANNELS;
        ctx->samplerate = 0;
 
        if (in->param) {
@@ -81,9 +81,9 @@ static int init(struct sr_input *in, const char *filename)
        in->internal = ctx;
 
        for (i = 0; i < num_channels; i++) {
-               snprintf(name, SR_MAX_PROBENAME_LEN, "%d", i);
+               snprintf(name, SR_MAX_CHANNELNAME_LEN, "%d", i);
                /* TODO: Check return value. */
-               if (!(ch = sr_channel_new(i, SR_PROBE_LOGIC, TRUE, name)))
+               if (!(ch = sr_channel_new(i, SR_CHANNEL_LOGIC, TRUE, name)))
                        return SR_ERR;
                in->sdi->channels = g_slist_append(in->sdi->channels, ch);
        }
index d340ece8d578b2f501536dfeffd119096df2e12e..dcedcf8cf11592641ceaef92e875cdeb0a4c2aa0 100644 (file)
@@ -29,7 +29,7 @@
 
 #define NUM_PACKETS            2048
 #define PACKET_SIZE            4096
-#define DEFAULT_NUM_PROBES     8
+#define DEFAULT_NUM_CHANNELS   8
 
 /**
  * Convert the LA8 'divcount' value to the respective samplerate (in Hz).
@@ -98,12 +98,12 @@ static int init(struct sr_input *in, const char *filename)
 {
        struct sr_channel *ch;
        int num_channels, i;
-       char name[SR_MAX_PROBENAME_LEN + 1];
+       char name[SR_MAX_CHANNELNAME_LEN + 1];
        char *param;
 
        (void)filename;
 
-       num_channels = DEFAULT_NUM_PROBES;
+       num_channels = DEFAULT_NUM_CHANNELS;
 
        if (in->param) {
                param = g_hash_table_lookup(in->param, "numchannels");
@@ -120,9 +120,9 @@ static int init(struct sr_input *in, const char *filename)
        in->sdi = sr_dev_inst_new(0, SR_ST_ACTIVE, NULL, NULL, NULL);
 
        for (i = 0; i < num_channels; i++) {
-               snprintf(name, SR_MAX_PROBENAME_LEN, "%d", i);
+               snprintf(name, SR_MAX_CHANNELNAME_LEN, "%d", i);
                /* TODO: Check return value. */
-               if (!(ch = sr_channel_new(i, SR_PROBE_LOGIC, TRUE, name)))
+               if (!(ch = sr_channel_new(i, SR_CHANNEL_LOGIC, TRUE, name)))
                        return SR_ERR;
                in->sdi->channels = g_slist_append(in->sdi->channels, ch);
        }
index 2af4eeb158bf5066bb7da0a933eb5146cef1562c..6dd06f4877ccbc4e4f592c4bdca4e807a77a858e 100644 (file)
@@ -431,7 +431,7 @@ static int init(struct sr_input *in, const char *filename)
        const char *param;
        GIOStatus status;
        gsize i, term_pos;
-       char channel_name[SR_MAX_PROBENAME_LEN + 1];
+       char channel_name[SR_MAX_CHANNELNAME_LEN + 1];
        struct sr_channel *ch;
        char **columns;
        gsize num_columns;
@@ -682,7 +682,7 @@ static int init(struct sr_input *in, const char *filename)
                else
                        snprintf(channel_name, sizeof(channel_name), "%zu", i);
 
-               ch = sr_channel_new(i, SR_PROBE_LOGIC, TRUE, channel_name);
+               ch = sr_channel_new(i, SR_CHANNEL_LOGIC, TRUE, channel_name);
 
                if (!ch) {
                        sr_err("Channel creation failed.");
index 2b68fc507af038f66668eccb26d6a62a883cf1e5..6759d73ef32fa4d8742bbf17b13e39b792a1afde 100644 (file)
@@ -65,7 +65,7 @@
 
 #define LOG_PREFIX "input/vcd"
 
-#define DEFAULT_NUM_PROBES 8
+#define DEFAULT_NUM_CHANNELS 8
 #define CHUNKSIZE 1024
 
 struct context {
@@ -289,7 +289,7 @@ static int init(struct sr_input *in, const char *filename)
 {
        struct sr_channel *ch;
        int num_channels, i;
-       char name[SR_MAX_PROBENAME_LEN + 1];
+       char name[SR_MAX_CHANNELNAME_LEN + 1];
        char *param;
        struct context *ctx;
 
@@ -300,7 +300,7 @@ static int init(struct sr_input *in, const char *filename)
                return SR_ERR_MALLOC;
        }
 
-       num_channels = DEFAULT_NUM_PROBES;
+       num_channels = DEFAULT_NUM_CHANNELS;
        ctx->samplerate = 0;
        ctx->downsample = 1;
        ctx->skip = -1;
@@ -342,9 +342,9 @@ static int init(struct sr_input *in, const char *filename)
        in->internal = ctx;
 
        for (i = 0; i < num_channels; i++) {
-               snprintf(name, SR_MAX_PROBENAME_LEN, "%d", i);
+               snprintf(name, SR_MAX_CHANNELNAME_LEN, "%d", i);
 
-               if (!(ch = sr_channel_new(i, SR_PROBE_LOGIC, TRUE, name))) {
+               if (!(ch = sr_channel_new(i, SR_CHANNEL_LOGIC, TRUE, name))) {
                        release_context(ctx);
                        return SR_ERR;
                }
index 7f5f97bf1ea1ad075d9b3543f66838a8ca153e48..1c3f050a050434ea040f64b7b1c974d520377bc1 100644 (file)
@@ -114,7 +114,7 @@ static int init(struct sr_input *in, const char *filename)
 
        for (i = 0; i < ctx->num_channels; i++) {
                snprintf(channelname, 8, "CH%d", i + 1);
-               if (!(ch = sr_channel_new(0, SR_PROBE_ANALOG, TRUE, channelname)))
+               if (!(ch = sr_channel_new(0, SR_CHANNEL_ANALOG, TRUE, channelname)))
                        return SR_ERR;
                in->sdi->channels = g_slist_append(in->sdi->channels, ch);
        }
index 123a23f78bb8d6a6cd3bb5d5255211048bd6ee4e..4d508c5b11ca64343b8c3947e85bde73897523a4 100644 (file)
@@ -227,9 +227,9 @@ SR_PRIV int sr_err(const char *format, ...);
 /** Values for the changes argument of sr_dev_driver.config_probe_set. */
 enum {
        /** The enabled state of the probe has been changed. */
-       SR_PROBE_SET_ENABLED = 1 << 0,
+       SR_CHANNEL_SET_ENABLED = 1 << 0,
        /** The trigger setup of the probe has been changed. */
-       SR_PROBE_SET_TRIGGER = 1 << 1,
+       SR_CHANNEL_SET_TRIGGER = 1 << 1,
 };
 
 SR_PRIV struct sr_channel *sr_channel_new(int index, int type,
index 9c69474e3f0f3260811f4a3286eb6cb565b728ae..bd2202ed51e05c9589531e9bb5148f97fda9bbd6 100644 (file)
@@ -81,7 +81,7 @@ enum {
         */
 };
 
-#define SR_MAX_PROBENAME_LEN 32
+#define SR_MAX_CHANNELNAME_LEN 32
 
 /* Handy little macros */
 #define SR_HZ(n)  (n)
@@ -600,16 +600,16 @@ struct sr_output_format {
 /** Constants for probe type. */
 enum {
        /** Probe type is logic probe. */
-    SR_PROBE_LOGIC = 10000,
+    SR_CHANNEL_LOGIC = 10000,
        /** Probe type is analog probe. */
-    SR_PROBE_ANALOG,
+    SR_CHANNEL_ANALOG,
 };
 
 /** Information on single channel. */
 struct sr_channel {
        /** Number of channels, starting at 0. */
        int index;
-       /** Channel type (SR_PROBE_LOGIC, ...) */
+       /** Channel type (SR_CHANNEL_LOGIC, ...) */
        int type;
        /** Is this channel enabled? */
        gboolean enabled;
@@ -804,10 +804,10 @@ enum {
        SR_CONF_CENTER_FREQUENCY,
 
        /** The device supports setting the number of logic probes. */
-       SR_CONF_NUM_LOGIC_PROBES,
+       SR_CONF_NUM_LOGIC_CHANNELS,
 
        /** The device supports setting the number of analog probes. */
-       SR_CONF_NUM_ANALOG_PROBES,
+       SR_CONF_NUM_ANALOG_CHANNELS,
 
        /** Output voltage. */
        SR_CONF_OUTPUT_VOLTAGE,
index b4c6903edbda9f2206ce5f5ad36d88e004315e3d..32065fd09283e23f95fbbb4eebdfd088b58e90d5 100644 (file)
@@ -108,7 +108,7 @@ static int init(struct sr_output *o)
        /* Get the unitsize. */
        for (l = o->sdi->channels; l; l = l->next) {
                ch = l->data;
-               if (ch->type != SR_PROBE_LOGIC)
+               if (ch->type != SR_CHANNEL_LOGIC)
                        continue;
                if (!ch->enabled)
                        continue;
index 6b3af1c3b12f57a550910651749df3407aade190..2c82b928c96a018b3e2da707fcdc95ce86893d3f 100644 (file)
@@ -68,7 +68,7 @@ static int init(struct sr_output *o)
        /* 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)
+               if (ch->type != SR_CHANNEL_LOGIC)
                        continue;
                if (!ch->enabled)
                        continue;
@@ -102,7 +102,7 @@ static int init(struct sr_output *o)
                               ctx->num_enabled_channels, num_channels);
        for (l = o->sdi->channels; l; l = l->next) {
                ch = l->data;
-               if (ch->type != SR_PROBE_LOGIC)
+               if (ch->type != SR_CHANNEL_LOGIC)
                        continue;
                if (!ch->enabled)
                        continue;
index 968b5e370f749d353979d2fe19734757e6dff631..2800d55aeb92d2261736b535ea5b7808d2659df3 100644 (file)
@@ -80,7 +80,7 @@ static int init(struct sr_output *o)
        ctx->num_enabled_channels = 0;
        for (l = o->sdi->channels; l; l = l->next) {
                ch = l->data;
-               if (ch->type != SR_PROBE_LOGIC)
+               if (ch->type != SR_CHANNEL_LOGIC)
                        continue;
                if (!ch->enabled)
                        continue;
@@ -114,7 +114,7 @@ static int init(struct sr_output *o)
        wbuf[0] = '\0';
        for (i = 0, l = o->sdi->channels; l; l = l->next, i++) {
                ch = l->data;
-               if (ch->type != SR_PROBE_LOGIC)
+               if (ch->type != SR_CHANNEL_LOGIC)
                        continue;
                if (!ch->enabled)
                        continue;
index b59931624921ba0565e88d76cf82eb3d082d237c..28c01338cfedcc9972a2db7a6897d3d4b1fd1204 100644 (file)
@@ -71,7 +71,7 @@ static GString *gen_header(const struct sr_dev_inst *sdi, struct context *ctx)
        num_enabled_channels = 0;
        for (l = sdi->channels; l; l = l->next) {
                ch = l->data;
-               if (ch->type != SR_PROBE_LOGIC)
+               if (ch->type != SR_CHANNEL_LOGIC)
                        continue;
                if (!ch->enabled)
                        continue;
index 4a6b4f08a920db9ee0e54fec76a9176f510f3312..7ad3fec335c45e1697ee716aa92532929c0c9998 100644 (file)
@@ -43,7 +43,7 @@ SR_PRIV int data_ascii(struct sr_output *o, const uint8_t *data_in,
        uint8_t *outbuf;
 
        ctx = o->internal;
-       max_linelen = SR_MAX_PROBENAME_LEN + 3 + ctx->samples_per_line
+       max_linelen = SR_MAX_CHANNELNAME_LEN + 3 + ctx->samples_per_line
                        + ctx->samples_per_line / 8;
         /*
          * Calculate space needed for probes. Set aside 512 bytes for
index af3196925281977a03d734a90e699ecbbffd851e..7eafecdf3e99e0ecef13240d1cd136c5cefaa685 100644 (file)
@@ -43,7 +43,7 @@ SR_PRIV int data_bits(struct sr_output *o, const uint8_t *data_in,
        uint8_t *outbuf, c;
 
        ctx = o->internal;
-       max_linelen = SR_MAX_PROBENAME_LEN + 3 + ctx->samples_per_line
+       max_linelen = SR_MAX_CHANNELNAME_LEN + 3 + ctx->samples_per_line
                        + ctx->samples_per_line / 8;
         /*
          * Calculate space needed for probes. Set aside 512 bytes for
index e976e9ba445b0ef639e50824df4a82949ea974f4..14fc6d1a57fcd18de0ceee5381d448733e4ebb67 100644 (file)
@@ -43,7 +43,7 @@ SR_PRIV int data_hex(struct sr_output *o, const uint8_t *data_in,
        uint8_t *outbuf;
 
        ctx = o->internal;
-       max_linelen = SR_MAX_PROBENAME_LEN + 3 + ctx->samples_per_line
+       max_linelen = SR_MAX_CHANNELNAME_LEN + 3 + ctx->samples_per_line
                        + ctx->samples_per_line / 2;
        outsize = length_in / ctx->unitsize * ctx->num_enabled_channels
                        / ctx->samples_per_line * max_linelen + 512;
index e32e843d27a8b4d94dd78cc34434345ba0993690..fad68a5da888761fc0a00232bfea377d9d9be2b2 100644 (file)
@@ -92,7 +92,7 @@ SR_PRIV int init(struct sr_output *o, int default_spl, enum outputmode mode)
 
        for (l = o->sdi->channels; l; l = l->next) {
                ch = l->data;
-               if (ch->type != SR_PROBE_LOGIC)
+               if (ch->type != SR_CHANNEL_LOGIC)
                        continue;
                if (!ch->enabled)
                        continue;
index 59198357dfa204663ec03aa8faea7c1818495e4d..a9d51f83a53fd41a1eae3105140ce12a0511d77f 100644 (file)
@@ -63,7 +63,7 @@ static int init(struct sr_output *o)
 
        for (l = o->sdi->channels; l; l = l->next) {
                ch = l->data;
-               if (ch->type != SR_PROBE_LOGIC)
+               if (ch->type != SR_CHANNEL_LOGIC)
                        continue;
                if (!ch->enabled)
                        continue;
@@ -127,7 +127,7 @@ static int init(struct sr_output *o)
        /* Wires / channels */
        for (i = 0, l = o->sdi->channels; l; l = l->next, i++) {
                ch = l->data;
-               if (ch->type != SR_PROBE_LOGIC)
+               if (ch->type != SR_CHANNEL_LOGIC)
                        continue;
                if (!ch->enabled)
                        continue;
index 5018298da8e38ee730c02f3c5d24faea6842a36d..36e5c0c2b67bff96d97f5fafcd8cd30d561afb8a 100644 (file)
@@ -259,7 +259,7 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
        case SR_CONF_CAPTURE_UNITSIZE:
                vdev->unitsize = g_variant_get_uint64(data);
                break;
-       case SR_CONF_NUM_LOGIC_PROBES:
+       case SR_CONF_NUM_LOGIC_CHANNELS:
                vdev->num_probes = g_variant_get_uint64(data);
                break;
        default:
index 8413d509b7ab7798979212833897acef1c076a8b..8ff74cbd2054721af67289601481a8ebd59d75a2 100644 (file)
@@ -117,7 +117,7 @@ SR_API int sr_session_load(const char *filename)
        int ret, channelnum, devcnt, i, j;
        uint64_t tmp_u64, total_channels, enabled_channels, p;
        char **sections, **keys, *metafile, *val;
-       char channelname[SR_MAX_PROBENAME_LEN + 1];
+       char channelname[SR_MAX_CHANNELNAME_LEN + 1];
 
        if ((ret = sr_sessionfile_check(filename)) != SR_OK)
                return ret;
@@ -182,11 +182,11 @@ SR_API int sr_session_load(const char *filename)
                                                        g_variant_new_uint64(tmp_u64), sdi, NULL);
                                } else if (!strcmp(keys[j], "total probes")) {
                                        total_channels = strtoull(val, NULL, 10);
-                                       sdi->driver->config_set(SR_CONF_NUM_LOGIC_PROBES,
+                                       sdi->driver->config_set(SR_CONF_NUM_LOGIC_CHANNELS,
                                                        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_channel_new(p, SR_PROBE_LOGIC, TRUE,
+                                               snprintf(channelname, SR_MAX_CHANNELNAME_LEN, "%" PRIu64, p);
+                                               if (!(ch = sr_channel_new(p, SR_CHANNEL_LOGIC, TRUE,
                                                                channelname)))
                                                        return SR_ERR;
                                                sdi->channels = g_slist_append(sdi->channels, ch);
@@ -254,7 +254,7 @@ SR_API int sr_session_save(const char *filename, const struct sr_dev_inst *sdi,
        cnt = 0;
        for (l = sdi->channels; l; l = l->next) {
                ch = l->data;
-               if (ch->type != SR_PROBE_LOGIC)
+               if (ch->type != SR_CHANNEL_LOGIC)
                        continue;
                if (ch->enabled != TRUE)
                        continue;
index b3dc819090d094a22059ef472b39214197873f49..fa823c7aca8985680aa36704951a77fd89ea6806 100644 (file)
@@ -220,7 +220,7 @@ GArray *srtest_get_enabled_logic_probes(const struct sr_dev_inst *sdi)
        probes = g_array_new(FALSE, FALSE, sizeof(int));
        for (l = sdi->probes; l; l = l->next) {
                probe = l->data;
-               if (probe->type != SR_PROBE_LOGIC)
+               if (probe->type != SR_CHANNEL_LOGIC)
                        continue;
                if (probe->enabled != TRUE)
                        continue;