]> sigrok.org Git - libsigrok.git/commitdiff
Rename SR_HWOPT_* and SR_HWCAP_* to SR_CONF_*
authorBert Vermeulen <redacted>
Mon, 21 Jan 2013 22:22:47 +0000 (23:22 +0100)
committerBert Vermeulen <redacted>
Mon, 21 Jan 2013 22:32:50 +0000 (23:32 +0100)
34 files changed:
hardware/agilent-dmm/api.c
hardware/alsa/api.c
hardware/asix-sigma/asix-sigma.c
hardware/chronovu-la8/api.c
hardware/chronovu-la8/protocol.c
hardware/colead-slm/api.c
hardware/common/usb.c
hardware/demo/demo.c
hardware/fluke-dmm/api.c
hardware/fx2lafw/fx2lafw.c
hardware/hantek-dso/api.c
hardware/lascar-el-usb/api.c
hardware/link-mso19/api.c
hardware/nexus-osciprime/api.c
hardware/openbench-logic-sniffer/api.c
hardware/rigol-ds1xx2/api.c
hardware/serial-dmm/api.c
hardware/tondaj-sl-814/api.c
hardware/uni-t-dmm/api.c
hardware/victor-dmm/api.c
hardware/zeroplus-logic-cube/zeroplus.c
hwdriver.c
input/binary.c
input/chronovu_la8.c
input/vcd.c
libsigrok.h
output/chronovu_la8.c
output/csv.c
output/gnuplot.c
output/ols.c
output/text/text.c
output/vcd.c
session_driver.c
session_file.c

index 9bcca5887e29e9208ffcd25ebc143a91d6adf691..9d401c7e51734f9a8c10bf659dffe7fb32f08704 100644 (file)
 #include "agilent-dmm.h"
 
 static const int hwopts[] = {
-       SR_HWOPT_CONN,
-       SR_HWOPT_SERIALCOMM,
+       SR_CONF_CONN,
+       SR_CONF_SERIALCOMM,
        0,
 };
 
 static const int hwcaps[] = {
-       SR_HWCAP_MULTIMETER,
-       SR_HWCAP_LIMIT_SAMPLES,
-       SR_HWCAP_LIMIT_MSEC,
-       SR_HWCAP_CONTINUOUS,
+       SR_CONF_MULTIMETER,
+       SR_CONF_LIMIT_SAMPLES,
+       SR_CONF_LIMIT_MSEC,
+       SR_CONF_CONTINUOUS,
        0,
 };
 
@@ -125,10 +125,10 @@ static GSList *hw_scan(GSList *options)
        for (l = options; l; l = l->next) {
                src = l->data;
                switch (src->key) {
-               case SR_HWOPT_CONN:
+               case SR_CONF_CONN:
                        conn = src->value;
                        break;
-               case SR_HWOPT_SERIALCOMM:
+               case SR_CONF_SERIALCOMM:
                        serialcomm = src->value;
                        break;
                }
@@ -280,7 +280,7 @@ static int hw_dev_config_set(const struct sr_dev_inst *sdi, int hwcap,
        }
 
        switch (hwcap) {
-       case SR_HWCAP_LIMIT_MSEC:
+       case SR_CONF_LIMIT_MSEC:
                /* TODO: not yet implemented */
                if (*(const uint64_t *)value == 0) {
                        sr_err("LIMIT_MSEC can't be 0.");
@@ -290,7 +290,7 @@ static int hw_dev_config_set(const struct sr_dev_inst *sdi, int hwcap,
                sr_dbg("Setting time limit to %" PRIu64 "ms.",
                       devc->limit_msec);
                break;
-       case SR_HWCAP_LIMIT_SAMPLES:
+       case SR_CONF_LIMIT_SAMPLES:
                devc->limit_samples = *(const uint64_t *)value;
                sr_dbg("Setting sample limit to %" PRIu64 ".",
                       devc->limit_samples);
index f3948458144ca8725b0dc34ad0fdf533bdc3e98b..227132474ae79ea8c473858131b327f2abf43ea1 100644 (file)
@@ -28,9 +28,9 @@
 #include "protocol.h"
 
 static const int hwcaps[] = {
-       SR_HWCAP_SAMPLERATE,
-       SR_HWCAP_LIMIT_SAMPLES,
-       SR_HWCAP_CONTINUOUS,
+       SR_CONF_SAMPLERATE,
+       SR_CONF_LIMIT_SAMPLES,
+       SR_CONF_CONTINUOUS,
        0,
 };
 
@@ -177,10 +177,10 @@ static int hw_dev_config_set(const struct sr_dev_inst *sdi, int hwcap,
        devc = sdi->priv;
 
        switch (hwcap) {
-       case SR_HWCAP_SAMPLERATE:
+       case SR_CONF_SAMPLERATE:
                alsa_set_samplerate(sdi, *(const uint64_t *)value);
                break;
-       case SR_HWCAP_LIMIT_SAMPLES:
+       case SR_CONF_LIMIT_SAMPLES:
                devc->limit_samples = *(const uint64_t *)value;
                break;
        default:
index dd7457748d7859c1d8a610dfcd87c9516006414c..828121ae121bb6614aaa813904e79ce15e462f06 100644 (file)
@@ -77,11 +77,11 @@ static const struct sr_samplerates samplerates = {
 };
 
 static const int hwcaps[] = {
-       SR_HWCAP_LOGIC_ANALYZER,
-       SR_HWCAP_SAMPLERATE,
-       SR_HWCAP_CAPTURE_RATIO,
+       SR_CONF_LOGIC_ANALYZER,
+       SR_CONF_SAMPLERATE,
+       SR_CONF_CAPTURE_RATIO,
 
-       SR_HWCAP_LIMIT_MSEC,
+       SR_CONF_LIMIT_MSEC,
        0,
 };
 
@@ -824,15 +824,15 @@ static int hw_dev_config_set(const struct sr_dev_inst *sdi, int hwcap,
 
        devc = sdi->priv;
 
-       if (hwcap == SR_HWCAP_SAMPLERATE) {
+       if (hwcap == SR_CONF_SAMPLERATE) {
                ret = set_samplerate(sdi, *(const uint64_t *)value);
-       } else if (hwcap == SR_HWCAP_LIMIT_MSEC) {
+       } else if (hwcap == SR_CONF_LIMIT_MSEC) {
                devc->limit_msec = *(const uint64_t *)value;
                if (devc->limit_msec > 0)
                        ret = SR_OK;
                else
                        ret = SR_ERR;
-       } else if (hwcap == SR_HWCAP_CAPTURE_RATIO) {
+       } else if (hwcap == SR_CONF_CAPTURE_RATIO) {
                devc->capture_ratio = *(const uint64_t *)value;
                if (devc->capture_ratio < 0 || devc->capture_ratio > 100)
                        ret = SR_ERR;
index 9267ca7b7c32f0446e4019fc90bd655a5ce2009e..08dec08e388dda7bc96c4d52bf07170e20df8e36 100644 (file)
@@ -334,14 +334,14 @@ static int hw_dev_config_set(const struct sr_dev_inst *sdi, int hwcap,
        }
 
        switch (hwcap) {
-       case SR_HWCAP_SAMPLERATE:
+       case SR_CONF_SAMPLERATE:
                if (set_samplerate(sdi, *(const uint64_t *)value) == SR_ERR) {
                        sr_err("%s: setting samplerate failed.", __func__);
                        return SR_ERR;
                }
                sr_dbg("SAMPLERATE = %" PRIu64, devc->cur_samplerate);
                break;
-       case SR_HWCAP_LIMIT_MSEC:
+       case SR_CONF_LIMIT_MSEC:
                if (*(const uint64_t *)value == 0) {
                        sr_err("%s: LIMIT_MSEC can't be 0.", __func__);
                        return SR_ERR;
@@ -349,7 +349,7 @@ static int hw_dev_config_set(const struct sr_dev_inst *sdi, int hwcap,
                devc->limit_msec = *(const uint64_t *)value;
                sr_dbg("LIMIT_MSEC = %" PRIu64, devc->limit_msec);
                break;
-       case SR_HWCAP_LIMIT_SAMPLES:
+       case SR_CONF_LIMIT_SAMPLES:
                if (*(const uint64_t *)value < MIN_NUM_SAMPLES) {
                        sr_err("%s: LIMIT_SAMPLES too small.", __func__);
                        return SR_ERR;
index 5eb781e1dfdacde8648116d36d2cdd9875f3b320..7a450cf478d20a7da06a726b67f37c09cc9c4e40 100644 (file)
@@ -46,10 +46,10 @@ const struct sr_samplerates samplerates = {
 
 /* Note: Continuous sampling is not supported by the hardware. */
 SR_PRIV const int hwcaps[] = {
-       SR_HWCAP_LOGIC_ANALYZER,
-       SR_HWCAP_SAMPLERATE,
-       SR_HWCAP_LIMIT_MSEC, /* TODO: Not yet implemented. */
-       SR_HWCAP_LIMIT_SAMPLES, /* TODO: Not yet implemented. */
+       SR_CONF_LOGIC_ANALYZER,
+       SR_CONF_SAMPLERATE,
+       SR_CONF_LIMIT_MSEC, /* TODO: Not yet implemented. */
+       SR_CONF_LIMIT_SAMPLES, /* TODO: Not yet implemented. */
        0,
 };
 
index 098ba92ffa397a7d5a36534ff84c1e9dd4225e5b..d04ff9eb41cdfc85e7320049f7c2d8f99dbb3c7d 100644 (file)
 #define SERIALCOMM "2400/8n1"
 
 static const int hwopts[] = {
-       SR_HWOPT_CONN,
-       SR_HWOPT_SERIALCOMM,
+       SR_CONF_CONN,
+       SR_CONF_SERIALCOMM,
        0,
 };
 
 static const int hwcaps[] = {
-       SR_HWCAP_SOUNDLEVELMETER,
-       SR_HWCAP_LIMIT_SAMPLES,
-       SR_HWCAP_LIMIT_MSEC,
-       SR_HWCAP_CONTINUOUS,
+       SR_CONF_SOUNDLEVELMETER,
+       SR_CONF_LIMIT_SAMPLES,
+       SR_CONF_LIMIT_MSEC,
+       SR_CONF_CONTINUOUS,
        0,
 };
 
@@ -105,10 +105,10 @@ static GSList *hw_scan(GSList *options)
        for (l = options; l; l = l->next) {
                src = l->data;
                switch (src->key) {
-               case SR_HWOPT_CONN:
+               case SR_CONF_CONN:
                        conn = src->value;
                        break;
-               case SR_HWOPT_SERIALCOMM:
+               case SR_CONF_SERIALCOMM:
                        serialcomm = src->value;
                        break;
                }
@@ -224,7 +224,7 @@ static int hw_dev_config_set(const struct sr_dev_inst *sdi, int hwcap,
        }
 
        switch (hwcap) {
-       case SR_HWCAP_LIMIT_MSEC:
+       case SR_CONF_LIMIT_MSEC:
                /* TODO: not yet implemented */
                if (*(const uint64_t *)value == 0) {
                        sr_err("LIMIT_MSEC can't be 0.");
@@ -234,7 +234,7 @@ static int hw_dev_config_set(const struct sr_dev_inst *sdi, int hwcap,
                sr_dbg("Setting time limit to %" PRIu64 "ms.",
                       devc->limit_msec);
                break;
-       case SR_HWCAP_LIMIT_SAMPLES:
+       case SR_CONF_LIMIT_SAMPLES:
                devc->limit_samples = *(const uint64_t *)value;
                sr_dbg("Setting sample limit to %" PRIu64 ".",
                       devc->limit_samples);
index 5cc89612317d420bf437ad2cd2c82ce2f77d6ee3..efe4eb432a1444c854da118a3a15945707a0c40a 100644 (file)
@@ -25,7 +25,7 @@
 #include "libsigrok.h"
 #include "libsigrok-internal.h"
 
-/* SR_HWCAP_CONN takes one of these: */
+/* SR_CONF_CONN takes one of these: */
 #define CONN_USB_VIDPID  "^([0-9a-z]{1,4})\\.([0-9a-z]{1,4})$"
 #define CONN_USB_BUSADDR "^(\\d+)\\.(\\d+)$"
 
index c1a5a4138d6ac04e637addc64c18638d48d85b5d..850cf8a8ef533b53a686951d9fe09ef773b32c6f 100644 (file)
@@ -84,13 +84,13 @@ struct dev_context {
 };
 
 static const int hwcaps[] = {
-       SR_HWCAP_LOGIC_ANALYZER,
-       SR_HWCAP_DEMO_DEV,
-       SR_HWCAP_SAMPLERATE,
-       SR_HWCAP_PATTERN_MODE,
-       SR_HWCAP_LIMIT_SAMPLES,
-       SR_HWCAP_LIMIT_MSEC,
-       SR_HWCAP_CONTINUOUS,
+       SR_CONF_LOGIC_ANALYZER,
+       SR_CONF_DEMO_DEV,
+       SR_CONF_SAMPLERATE,
+       SR_CONF_PATTERN_MODE,
+       SR_CONF_LIMIT_SAMPLES,
+       SR_CONF_LIMIT_MSEC,
+       SR_CONF_CONTINUOUS,
 };
 
 static const struct sr_samplerates samplerates = {
@@ -259,24 +259,24 @@ static int hw_dev_config_set(const struct sr_dev_inst *sdi, int hwcap,
 
        (void)sdi;
 
-       if (hwcap == SR_HWCAP_SAMPLERATE) {
+       if (hwcap == SR_CONF_SAMPLERATE) {
                cur_samplerate = *(const uint64_t *)value;
                sr_dbg("%s: setting samplerate to %" PRIu64, __func__,
                       cur_samplerate);
                ret = SR_OK;
-       } else if (hwcap == SR_HWCAP_LIMIT_SAMPLES) {
+       } else if (hwcap == SR_CONF_LIMIT_SAMPLES) {
                limit_msec = 0;
                limit_samples = *(const uint64_t *)value;
                sr_dbg("%s: setting limit_samples to %" PRIu64, __func__,
                       limit_samples);
                ret = SR_OK;
-       } else if (hwcap == SR_HWCAP_LIMIT_MSEC) {
+       } else if (hwcap == SR_CONF_LIMIT_MSEC) {
                limit_msec = *(const uint64_t *)value;
                limit_samples = 0;
                sr_dbg("%s: setting limit_msec to %" PRIu64, __func__,
                       limit_msec);
                ret = SR_OK;
-       } else if (hwcap == SR_HWCAP_PATTERN_MODE) {
+       } else if (hwcap == SR_CONF_PATTERN_MODE) {
                stropt = value;
                ret = SR_OK;
                if (!strcmp(stropt, "sigrok")) {
index 44c4651e1bca095dfaa507215b1772ffe021facf..adc1853c33573fed9e0b824e8919a906457c847f 100644 (file)
 #include "fluke-dmm.h"
 
 static const int hwopts[] = {
-       SR_HWOPT_CONN,
-       SR_HWOPT_SERIALCOMM,
+       SR_CONF_CONN,
+       SR_CONF_SERIALCOMM,
        0,
 };
 
 static const int hwcaps[] = {
-       SR_HWCAP_MULTIMETER,
-       SR_HWCAP_LIMIT_SAMPLES,
-       SR_HWCAP_LIMIT_MSEC,
-       SR_HWCAP_CONTINUOUS,
+       SR_CONF_MULTIMETER,
+       SR_CONF_LIMIT_SAMPLES,
+       SR_CONF_LIMIT_MSEC,
+       SR_CONF_CONTINUOUS,
        0,
 };
 
@@ -203,10 +203,10 @@ static GSList *hw_scan(GSList *options)
        for (l = options; l; l = l->next) {
                src = l->data;
                switch (src->key) {
-               case SR_HWOPT_CONN:
+               case SR_CONF_CONN:
                        conn = src->value;
                        break;
-               case SR_HWOPT_SERIALCOMM:
+               case SR_CONF_SERIALCOMM:
                        serialcomm = src->value;
                        break;
                }
@@ -314,7 +314,7 @@ static int hw_dev_config_set(const struct sr_dev_inst *sdi, int hwcap,
        }
 
        switch (hwcap) {
-       case SR_HWCAP_LIMIT_MSEC:
+       case SR_CONF_LIMIT_MSEC:
                /* TODO: not yet implemented */
                if (*(const uint64_t *)value == 0) {
                        sr_err("LIMIT_MSEC can't be 0.");
@@ -324,7 +324,7 @@ static int hw_dev_config_set(const struct sr_dev_inst *sdi, int hwcap,
                sr_dbg("Setting time limit to %" PRIu64 "ms.",
                       devc->limit_msec);
                break;
-       case SR_HWCAP_LIMIT_SAMPLES:
+       case SR_CONF_LIMIT_SAMPLES:
                devc->limit_samples = *(const uint64_t *)value;
                sr_dbg("Setting sample limit to %" PRIu64 ".",
                       devc->limit_samples);
index 304873ae9f3a8f9b6b8ac7a4ab7bd93d325768d1..43f6f5254dad6fe48e61a17a5de96f6c85be99d5 100644 (file)
@@ -82,12 +82,12 @@ static const struct fx2lafw_profile supported_fx2[] = {
 };
 
 static const int hwcaps[] = {
-       SR_HWCAP_LOGIC_ANALYZER,
-       SR_HWCAP_SAMPLERATE,
+       SR_CONF_LOGIC_ANALYZER,
+       SR_CONF_SAMPLERATE,
 
        /* These are really implemented in the driver, not the hardware. */
-       SR_HWCAP_LIMIT_SAMPLES,
-       SR_HWCAP_CONTINUOUS,
+       SR_CONF_LIMIT_SAMPLES,
+       SR_CONF_CONTINUOUS,
        0,
 };
 
@@ -561,7 +561,7 @@ static int hw_dev_open(struct sr_dev_inst *sdi)
 
        if (devc->cur_samplerate == 0) {
                /* Samplerate hasn't been set; default to the slowest one. */
-               if (hw_dev_config_set(sdi, SR_HWCAP_SAMPLERATE,
+               if (hw_dev_config_set(sdi, SR_CONF_SAMPLERATE,
                    &supported_samplerates[0]) == SR_ERR)
                        return SR_ERR;
        }
@@ -640,10 +640,10 @@ static int hw_dev_config_set(const struct sr_dev_inst *sdi, int hwcap,
 
        devc = sdi->priv;
 
-       if (hwcap == SR_HWCAP_SAMPLERATE) {
+       if (hwcap == SR_CONF_SAMPLERATE) {
                devc->cur_samplerate = *(const uint64_t *)value;
                ret = SR_OK;
-       } else if (hwcap == SR_HWCAP_LIMIT_SAMPLES) {
+       } else if (hwcap == SR_CONF_LIMIT_SAMPLES) {
                devc->limit_samples = *(const uint64_t *)value;
                ret = SR_OK;
        } else {
index 8e589c51aa3c31062553953d304927427d0fe5f8..5a7aabccaca542b7f9e432f761e810eb81310cd5 100644 (file)
 #define TICK 1
 
 static const int hwcaps[] = {
-       SR_HWCAP_OSCILLOSCOPE,
-       SR_HWCAP_LIMIT_SAMPLES,
-       SR_HWCAP_CONTINUOUS,
-       SR_HWCAP_TIMEBASE,
-       SR_HWCAP_BUFFERSIZE,
-       SR_HWCAP_TRIGGER_SOURCE,
-       SR_HWCAP_TRIGGER_SLOPE,
-       SR_HWCAP_HORIZ_TRIGGERPOS,
-       SR_HWCAP_FILTER,
-       SR_HWCAP_VDIV,
-       SR_HWCAP_COUPLING,
+       SR_CONF_OSCILLOSCOPE,
+       SR_CONF_LIMIT_SAMPLES,
+       SR_CONF_CONTINUOUS,
+       SR_CONF_TIMEBASE,
+       SR_CONF_BUFFERSIZE,
+       SR_CONF_TRIGGER_SOURCE,
+       SR_CONF_TRIGGER_SLOPE,
+       SR_CONF_HORIZ_TRIGGERPOS,
+       SR_CONF_FILTER,
+       SR_CONF_VDIV,
+       SR_CONF_COUPLING,
        0,
 };
 
@@ -473,16 +473,16 @@ static int hw_dev_config_set(const struct sr_dev_inst *sdi, int hwcap,
        ret = SR_OK;
        devc = sdi->priv;
        switch (hwcap) {
-       case SR_HWCAP_LIMIT_FRAMES:
+       case SR_CONF_LIMIT_FRAMES:
                devc->limit_frames = *(const uint64_t *)value;
                break;
-       case SR_HWCAP_TRIGGER_SLOPE:
+       case SR_CONF_TRIGGER_SLOPE:
                tmp_u64 = *(const int *)value;
                if (tmp_u64 != SLOPE_NEGATIVE && tmp_u64 != SLOPE_POSITIVE)
                        ret = SR_ERR_ARG;
                devc->triggerslope = tmp_u64;
                break;
-       case SR_HWCAP_HORIZ_TRIGGERPOS:
+       case SR_CONF_HORIZ_TRIGGERPOS:
                tmp_float = *(const float *)value;
                if (tmp_float < 0.0 || tmp_float > 1.0) {
                        sr_err("Trigger position should be between 0.0 and 1.0.");
@@ -490,7 +490,7 @@ static int hw_dev_config_set(const struct sr_dev_inst *sdi, int hwcap,
                } else
                        devc->triggerposition = tmp_float;
                break;
-       case SR_HWCAP_BUFFERSIZE:
+       case SR_CONF_BUFFERSIZE:
                tmp_u64 = *(const int *)value;
                for (i = 0; buffersizes[i]; i++) {
                        if (buffersizes[i] == tmp_u64) {
@@ -501,7 +501,7 @@ static int hw_dev_config_set(const struct sr_dev_inst *sdi, int hwcap,
                if (buffersizes[i] == 0)
                        ret = SR_ERR_ARG;
                break;
-       case SR_HWCAP_TIMEBASE:
+       case SR_CONF_TIMEBASE:
                tmp_rat = *(const struct sr_rational *)value;
                for (i = 0; timebases[i].p && timebases[i].q; i++) {
                        if (timebases[i].p == tmp_rat.p
@@ -513,7 +513,7 @@ static int hw_dev_config_set(const struct sr_dev_inst *sdi, int hwcap,
                if (timebases[i].p == 0 && timebases[i].q == 0)
                        ret = SR_ERR_ARG;
                break;
-       case SR_HWCAP_TRIGGER_SOURCE:
+       case SR_CONF_TRIGGER_SOURCE:
                for (i = 0; trigger_sources[i]; i++) {
                        if (!strcmp(value, trigger_sources[i])) {
                                devc->triggersource = g_strdup(value);
@@ -523,7 +523,7 @@ static int hw_dev_config_set(const struct sr_dev_inst *sdi, int hwcap,
                if (trigger_sources[i] == 0)
                        ret = SR_ERR_ARG;
                break;
-       case SR_HWCAP_FILTER:
+       case SR_CONF_FILTER:
                devc->filter_ch1 = devc->filter_ch2 = devc->filter_trigger = 0;
                targets = g_strsplit(value, ",", 0);
                for (i = 0; targets[i]; i++) {
@@ -543,7 +543,7 @@ static int hw_dev_config_set(const struct sr_dev_inst *sdi, int hwcap,
                }
                g_strfreev(targets);
                break;
-       case SR_HWCAP_VDIV:
+       case SR_CONF_VDIV:
                /* TODO: Not supporting vdiv per channel yet. */
                tmp_rat = *(const struct sr_rational *)value;
                for (i = 0; vdivs[i].p && vdivs[i].q; i++) {
@@ -557,7 +557,7 @@ static int hw_dev_config_set(const struct sr_dev_inst *sdi, int hwcap,
                if (vdivs[i].p == 0 && vdivs[i].q == 0)
                        ret = SR_ERR_ARG;
                break;
-       case SR_HWCAP_COUPLING:
+       case SR_CONF_COUPLING:
                /* TODO: Not supporting coupling per channel yet. */
                for (i = 0; coupling[i]; i++) {
                        if (!strcmp(value, coupling[i])) {
index 16349fddb3e4f895e3a1efd517d2270bd30990a0..f0b69aee438f499408126a1281163c85fd5baaf0 100644 (file)
@@ -29,14 +29,14 @@ static struct sr_dev_driver *di = &lascar_el_usb_driver_info;
 static int hw_dev_close(struct sr_dev_inst *sdi);
 
 static const int hwopts[] = {
-       SR_HWOPT_CONN,
+       SR_CONF_CONN,
        0,
 };
 
 static const int hwcaps[] = {
-       SR_HWCAP_THERMOMETER,
-       SR_HWCAP_HYGROMETER,
-       SR_HWCAP_LIMIT_SAMPLES,
+       SR_CONF_THERMOMETER,
+       SR_CONF_HYGROMETER,
+       SR_CONF_LIMIT_SAMPLES,
        0
 };
 
@@ -107,7 +107,7 @@ static GSList *hw_scan(GSList *options)
        for (l = options; l; l = l->next) {
                src = l->data;
                switch (src->key) {
-               case SR_HWOPT_CONN:
+               case SR_CONF_CONN:
                        conn = src->value;
                        break;
                }
@@ -250,7 +250,7 @@ static int hw_dev_config_set(const struct sr_dev_inst *sdi, int hwcap,
        devc = sdi->priv;
        ret = SR_OK;
        switch (hwcap) {
-       case SR_HWCAP_LIMIT_SAMPLES:
+       case SR_CONF_LIMIT_SAMPLES:
                devc->limit_samples = *(const uint64_t *)value;
                sr_dbg("Setting sample limit to %" PRIu64 ".",
                       devc->limit_samples);
index fcec20c6bbfc2595c8e49da35772c77108b39982..fbd961c06cb2d17fba152143902ffaa7e09db4e7 100644 (file)
 #include "protocol.h"
 
 static const int hwcaps[] = {
-       SR_HWCAP_LOGIC_ANALYZER,
-       SR_HWCAP_SAMPLERATE,
-       SR_HWCAP_TRIGGER_SLOPE,
-       SR_HWCAP_HORIZ_TRIGGERPOS,
-//      SR_HWCAP_CAPTURE_RATIO,
-       SR_HWCAP_LIMIT_SAMPLES,
-//      SR_HWCAP_RLE,
+       SR_CONF_LOGIC_ANALYZER,
+       SR_CONF_SAMPLERATE,
+       SR_CONF_TRIGGER_SLOPE,
+       SR_CONF_HORIZ_TRIGGERPOS,
+//      SR_CONF_CAPTURE_RATIO,
+       SR_CONF_LIMIT_SAMPLES,
+//      SR_CONF_RLE,
        0,
 };
 
@@ -82,10 +82,10 @@ static GSList *hw_scan(GSList *options)
        for (l = options; l; l = l->next) {
                src = l->data;
                switch (src->key) {
-               case SR_HWOPT_CONN:
+               case SR_CONF_CONN:
                        conn = src->value;
                        break;
-               case SR_HWOPT_SERIALCOMM:
+               case SR_CONF_SERIALCOMM:
                        serialcomm = src->value;
                        break;
                }
@@ -342,12 +342,12 @@ static int hw_dev_config_set(const struct sr_dev_inst *sdi, int hwcap,
                return SR_ERR;
 
        switch (hwcap) {
-       case SR_HWCAP_SAMPLERATE:
+       case SR_CONF_SAMPLERATE:
                // FIXME
                return mso_configure_rate(sdi, *(const uint64_t *)value);
                ret = SR_OK;
                break;
-       case SR_HWCAP_LIMIT_SAMPLES:
+       case SR_CONF_LIMIT_SAMPLES:
                num_samples = *(uint64_t *)value;
                if (num_samples < 1024) {
                        sr_err("minimum of 1024 samples required");
@@ -359,10 +359,10 @@ static int hw_dev_config_set(const struct sr_dev_inst *sdi, int hwcap,
                        ret = SR_OK;
                }
                break;
-       case SR_HWCAP_CAPTURE_RATIO:
+       case SR_CONF_CAPTURE_RATIO:
                ret = SR_OK;
                break;
-       case SR_HWCAP_TRIGGER_SLOPE:
+       case SR_CONF_TRIGGER_SLOPE:
                slope = *(uint64_t *)value;
                if (slope != SLOPE_NEGATIVE && slope != SLOPE_POSITIVE) {
                        sr_err("Invalid trigger slope");
@@ -372,7 +372,7 @@ static int hw_dev_config_set(const struct sr_dev_inst *sdi, int hwcap,
                        ret = SR_OK;
                }
                break;
-       case SR_HWCAP_HORIZ_TRIGGERPOS:
+       case SR_CONF_HORIZ_TRIGGERPOS:
                pos = *(float *)value;
                if (pos < 0 || pos > 255) {
                        sr_err("Trigger position (%f) should be between 0 and 255.", pos);
@@ -383,7 +383,7 @@ static int hw_dev_config_set(const struct sr_dev_inst *sdi, int hwcap,
                        ret = SR_OK;
                }
                break;
-       case SR_HWCAP_RLE:
+       case SR_CONF_RLE:
                ret = SR_OK;
                break;
        default:
index a902b1435ce57df5a953c4081dd658102cc69274..dc97b9a720f864a326adc4fb465f202d5d316feb 100644 (file)
 #define OSCI_VIDPID "04b4.1004"
 
 static const int hwopts[] = {
-       SR_HWOPT_CONN,
-       SR_HWOPT_SERIALCOMM,
+       SR_CONF_CONN,
+       SR_CONF_SERIALCOMM,
        0,
 };
 
 static const int hwcaps[] = {
-       SR_HWCAP_OSCILLOSCOPE,
-       SR_HWCAP_LIMIT_SAMPLES,
-       SR_HWCAP_CONTINUOUS,
-       SR_HWCAP_TIMEBASE,
-       SR_HWCAP_VDIV,
+       SR_CONF_OSCILLOSCOPE,
+       SR_CONF_LIMIT_SAMPLES,
+       SR_CONF_CONTINUOUS,
+       SR_CONF_TIMEBASE,
+       SR_CONF_VDIV,
        0,
 };
 
@@ -179,7 +179,7 @@ static GSList *hw_scan(GSList *options)
        for (l = options; l; l = l->next) {
                src = l->data;
                switch (src->key) {
-               case SR_HWOPT_CONN:
+               case SR_CONF_CONN:
                        conn = src->value;
                        break;
                }
index 21844eed45bea53dea0db32f821734aeb2ec29ef..b31ec5b1b57118e947b48e5c22d41313cb71e125 100644 (file)
 #define SERIALCOMM "115200/8n1"
 
 static const int hwopts[] = {
-       SR_HWOPT_CONN,
-       SR_HWOPT_SERIALCOMM,
+       SR_CONF_CONN,
+       SR_CONF_SERIALCOMM,
        0,
 };
 
 static const int hwcaps[] = {
-       SR_HWCAP_LOGIC_ANALYZER,
-       SR_HWCAP_SAMPLERATE,
-       SR_HWCAP_CAPTURE_RATIO,
-       SR_HWCAP_LIMIT_SAMPLES,
-       SR_HWCAP_RLE,
+       SR_CONF_LOGIC_ANALYZER,
+       SR_CONF_SAMPLERATE,
+       SR_CONF_CAPTURE_RATIO,
+       SR_CONF_LIMIT_SAMPLES,
+       SR_CONF_RLE,
        0,
 };
 
@@ -91,10 +91,10 @@ static GSList *hw_scan(GSList *options)
        for (l = options; l; l = l->next) {
                src = l->data;
                switch (src->key) {
-               case SR_HWOPT_CONN:
+               case SR_CONF_CONN:
                        conn = src->value;
                        break;
-               case SR_HWOPT_SERIALCOMM:
+               case SR_CONF_SERIALCOMM:
                        serialcomm = src->value;
                        break;
                }
@@ -295,11 +295,11 @@ static int hw_dev_config_set(const struct sr_dev_inst *sdi, int hwcap,
                return SR_ERR;
 
        switch (hwcap) {
-       case SR_HWCAP_SAMPLERATE:
+       case SR_CONF_SAMPLERATE:
                ret = ols_set_samplerate(sdi, *(const uint64_t *)value,
                                         &samplerates);
                break;
-       case SR_HWCAP_LIMIT_SAMPLES:
+       case SR_CONF_LIMIT_SAMPLES:
                tmp_u64 = value;
                if (*tmp_u64 < MIN_NUM_SAMPLES)
                        return SR_ERR;
@@ -309,7 +309,7 @@ static int hw_dev_config_set(const struct sr_dev_inst *sdi, int hwcap,
                sr_info("Sample limit is %" PRIu64 ".", devc->limit_samples);
                ret = SR_OK;
                break;
-       case SR_HWCAP_CAPTURE_RATIO:
+       case SR_CONF_CAPTURE_RATIO:
                devc->capture_ratio = *(const uint64_t *)value;
                if (devc->capture_ratio < 0 || devc->capture_ratio > 100) {
                        devc->capture_ratio = 0;
@@ -317,7 +317,7 @@ static int hw_dev_config_set(const struct sr_dev_inst *sdi, int hwcap,
                } else
                        ret = SR_OK;
                break;
-       case SR_HWCAP_RLE:
+       case SR_CONF_RLE:
                if (GPOINTER_TO_INT(value)) {
                        sr_info("Enabling RLE.");
                        devc->flag_reg |= FLAG_RLE;
index 8c03ca86db5a700386087ce893a59e04c7ee68b0..93f1fc2a4cf0f81b54bd03802f9210ca183402ec 100644 (file)
 #include "protocol.h"
 
 static const int hwcaps[] = {
-       SR_HWCAP_OSCILLOSCOPE,
-       SR_HWCAP_LIMIT_SAMPLES,
-       SR_HWCAP_TIMEBASE,
-       SR_HWCAP_TRIGGER_SOURCE,
-       SR_HWCAP_TRIGGER_SLOPE,
-       SR_HWCAP_HORIZ_TRIGGERPOS,
-       SR_HWCAP_VDIV,
-       SR_HWCAP_COUPLING,
+       SR_CONF_OSCILLOSCOPE,
+       SR_CONF_LIMIT_SAMPLES,
+       SR_CONF_TIMEBASE,
+       SR_CONF_TRIGGER_SOURCE,
+       SR_CONF_TRIGGER_SLOPE,
+       SR_CONF_HORIZ_TRIGGERPOS,
+       SR_CONF_VDIV,
+       SR_CONF_COUPLING,
        0,
 };
 
@@ -370,24 +370,24 @@ static int hw_dev_config_set(const struct sr_dev_inst *sdi, int hwcap,
 
        ret = SR_OK;
        switch (hwcap) {
-       case SR_HWCAP_LIMIT_FRAMES:
+       case SR_CONF_LIMIT_FRAMES:
                devc->limit_frames = *(const uint64_t *)value;
                break;
-       case SR_HWCAP_TRIGGER_SLOPE:
+       case SR_CONF_TRIGGER_SLOPE:
                tmp_u64 = *(const int *)value;
                rigol_ds1xx2_send_data(devc->fd, ":TRIG:EDGE:SLOP %s\n",
                                       tmp_u64 ? "POS" : "NEG");
                break;
-       case SR_HWCAP_HORIZ_TRIGGERPOS:
+       case SR_CONF_HORIZ_TRIGGERPOS:
                tmp_float = *(const float *)value;
                rigol_ds1xx2_send_data(devc->fd, ":TIM:OFFS %.9f\n", tmp_float);
                break;
-       case SR_HWCAP_TIMEBASE:
+       case SR_CONF_TIMEBASE:
                tmp_rat = *(const struct sr_rational *)value;
                rigol_ds1xx2_send_data(devc->fd, ":TIM:SCAL %.9f\n",
                                       (float)tmp_rat.p / tmp_rat.q);
                break;
-       case SR_HWCAP_TRIGGER_SOURCE:
+       case SR_CONF_TRIGGER_SOURCE:
                if (!strcmp(value, "CH1"))
                        channel = "CHAN1";
                else if (!strcmp(value, "CH2"))
@@ -402,7 +402,7 @@ static int hw_dev_config_set(const struct sr_dev_inst *sdi, int hwcap,
                }
                rigol_ds1xx2_send_data(devc->fd, ":TRIG:EDGE:SOUR %s\n", channel);
                break;
-       case SR_HWCAP_VDIV:
+       case SR_CONF_VDIV:
                /* TODO: Not supporting vdiv per channel yet. */
                tmp_rat = *(const struct sr_rational *)value;
                for (i = 0; vdivs[i].p && vdivs[i].q; i++) {
@@ -418,7 +418,7 @@ static int hw_dev_config_set(const struct sr_dev_inst *sdi, int hwcap,
                if (vdivs[i].p == 0 && vdivs[i].q == 0)
                        ret = SR_ERR_ARG;
                break;
-       case SR_HWCAP_COUPLING:
+       case SR_CONF_COUPLING:
                /* TODO: Not supporting coupling per channel yet. */
                for (i = 0; coupling[i]; i++) {
                        if (!strcmp(value, coupling[i])) {
index 944972d96c0f50bc03ae4a05119b979ef8dc621d..b143a358e71499bb86d839ca10dc4e29ba88de37 100644 (file)
 #include "protocol.h"
 
 static const int hwopts[] = {
-       SR_HWOPT_CONN,
-       SR_HWOPT_SERIALCOMM,
+       SR_CONF_CONN,
+       SR_CONF_SERIALCOMM,
        0,
 };
 
 static const int hwcaps[] = {
-       SR_HWCAP_MULTIMETER,
-       SR_HWCAP_LIMIT_SAMPLES,
-       SR_HWCAP_LIMIT_MSEC,
-       SR_HWCAP_CONTINUOUS,
+       SR_CONF_MULTIMETER,
+       SR_CONF_LIMIT_SAMPLES,
+       SR_CONF_LIMIT_MSEC,
+       SR_CONF_CONTINUOUS,
        0,
 };
 
@@ -301,10 +301,10 @@ static GSList *hw_scan(GSList *options, int dmm)
        for (l = options; l; l = l->next) {
                src = l->data;
                switch (src->key) {
-               case SR_HWOPT_CONN:
+               case SR_CONF_CONN:
                        conn = src->value;
                        break;
-               case SR_HWOPT_SERIALCOMM:
+               case SR_CONF_SERIALCOMM:
                        serialcomm = src->value;
                        break;
                }
@@ -406,12 +406,12 @@ static int hw_dev_config_set(const struct sr_dev_inst *sdi, int hwcap,
        }
 
        switch (hwcap) {
-       case SR_HWCAP_LIMIT_SAMPLES:
+       case SR_CONF_LIMIT_SAMPLES:
                devc->limit_samples = *(const uint64_t *)value;
                sr_dbg("Setting sample limit to %" PRIu64 ".",
                       devc->limit_samples);
                break;
-       case SR_HWCAP_LIMIT_MSEC:
+       case SR_CONF_LIMIT_MSEC:
                devc->limit_msec = *(const uint64_t *)value;
                sr_dbg("Setting time limit to %" PRIu64 "ms.",
                       devc->limit_msec);
index b27625b57e6d06856f8d44ddc2a548990d869807..16099940e21dcf7a607c3596e8f011038dcbaf0c 100644 (file)
 #define SERIALCOMM "9600/8e1"
 
 static const int hwopts[] = {
-       SR_HWOPT_CONN,
-       SR_HWOPT_SERIALCOMM,
+       SR_CONF_CONN,
+       SR_CONF_SERIALCOMM,
        0,
 };
 
 static const int hwcaps[] = {
-       SR_HWCAP_SOUNDLEVELMETER,
-       SR_HWCAP_LIMIT_SAMPLES,
-       SR_HWCAP_CONTINUOUS,
+       SR_CONF_SOUNDLEVELMETER,
+       SR_CONF_LIMIT_SAMPLES,
+       SR_CONF_CONTINUOUS,
        0,
 };
 
@@ -104,10 +104,10 @@ static GSList *hw_scan(GSList *options)
                        continue;
                }
                switch (src->key) {
-               case SR_HWOPT_CONN:
+               case SR_CONF_CONN:
                        conn = src->value;
                        break;
-               case SR_HWOPT_SERIALCOMM:
+               case SR_CONF_SERIALCOMM:
                        serialcomm = src->value;
                        break;
                default:
@@ -227,7 +227,7 @@ static int hw_dev_config_set(const struct sr_dev_inst *sdi, int hwcap,
        devc = sdi->priv;
 
        switch (hwcap) {
-       case SR_HWCAP_LIMIT_SAMPLES:
+       case SR_CONF_LIMIT_SAMPLES:
                devc->limit_samples = *(const uint64_t *)value;
                sr_dbg("Setting sample limit to %" PRIu64 ".",
                       devc->limit_samples);
index bae358aaad9a91757078e263777af7cfe9abb722..42e9e309f9e4ab20e643bac87316d59228d7362d 100644 (file)
@@ -32,10 +32,10 @@ static const int hwopts[] = {
 };
 
 static const int hwcaps[] = {
-       SR_HWCAP_MULTIMETER,
-       SR_HWCAP_LIMIT_SAMPLES,
-       SR_HWCAP_LIMIT_MSEC,
-       SR_HWCAP_CONTINUOUS,
+       SR_CONF_MULTIMETER,
+       SR_CONF_LIMIT_SAMPLES,
+       SR_CONF_LIMIT_MSEC,
+       SR_CONF_CONTINUOUS,
        0,
 };
 
@@ -229,7 +229,7 @@ static int hw_dev_config_set(const struct sr_dev_inst *sdi, int hwcap,
        devc = sdi->priv;
 
        switch (hwcap) {
-       case SR_HWCAP_LIMIT_MSEC:
+       case SR_CONF_LIMIT_MSEC:
                /* TODO: Not yet implemented. */
                if (*(const uint64_t *)value == 0) {
                        sr_err("Time limit cannot be 0.");
@@ -239,7 +239,7 @@ static int hw_dev_config_set(const struct sr_dev_inst *sdi, int hwcap,
                sr_dbg("Setting time limit to %" PRIu64 "ms.",
                       devc->limit_msec);
                break;
-       case SR_HWCAP_LIMIT_SAMPLES:
+       case SR_CONF_LIMIT_SAMPLES:
                if (*(const uint64_t *)value == 0) {
                        sr_err("Sample limit cannot be 0.");
                        return SR_ERR;
index e7fdb7850093f895904daabe347b197eac21a148..b847fbf9e8352dbb62087b55194a718e596cfafc 100644 (file)
@@ -37,10 +37,10 @@ static int hw_dev_close(struct sr_dev_inst *sdi);
 static int hw_dev_acquisition_stop(struct sr_dev_inst *sdi, void *cb_data);
 
 static const int hwcaps[] = {
-       SR_HWCAP_MULTIMETER,
-       SR_HWCAP_LIMIT_MSEC,
-       SR_HWCAP_LIMIT_SAMPLES,
-       SR_HWCAP_CONTINUOUS,
+       SR_CONF_MULTIMETER,
+       SR_CONF_LIMIT_MSEC,
+       SR_CONF_LIMIT_SAMPLES,
+       SR_CONF_CONTINUOUS,
        0
 };
 
@@ -280,14 +280,14 @@ static int hw_dev_config_set(const struct sr_dev_inst *sdi, int hwcap,
        devc = sdi->priv;
        ret = SR_OK;
        switch (hwcap) {
-       case SR_HWCAP_LIMIT_MSEC:
+       case SR_CONF_LIMIT_MSEC:
                devc->limit_msec = *(const int64_t *)value;
                now = g_get_monotonic_time() / 1000;
                devc->end_time = now + devc->limit_msec;
                sr_dbg("Setting time limit to %" PRIu64 "ms.",
                       devc->limit_msec);
                break;
-       case SR_HWCAP_LIMIT_SAMPLES:
+       case SR_CONF_LIMIT_SAMPLES:
                devc->limit_samples = *(const uint64_t *)value;
                sr_dbg("Setting sample limit to %" PRIu64 ".",
                       devc->limit_samples);
index e132c78439450c3f30f19344c620eeeda5ebf16d..fcd8c064af213070ecc4140efd6e7ee87e9ca93b 100644 (file)
@@ -71,12 +71,12 @@ static model_t zeroplus_models[] = {
 };
 
 static const int hwcaps[] = {
-       SR_HWCAP_LOGIC_ANALYZER,
-       SR_HWCAP_SAMPLERATE,
-       SR_HWCAP_CAPTURE_RATIO,
+       SR_CONF_LOGIC_ANALYZER,
+       SR_CONF_SAMPLERATE,
+       SR_CONF_CAPTURE_RATIO,
 
        /* These are really implemented in the driver, not the hardware. */
-       SR_HWCAP_LIMIT_SAMPLES,
+       SR_CONF_LIMIT_SAMPLES,
        0,
 };
 
@@ -640,11 +640,11 @@ static int hw_dev_config_set(const struct sr_dev_inst *sdi, int hwcap,
        }
 
        switch (hwcap) {
-       case SR_HWCAP_SAMPLERATE:
+       case SR_CONF_SAMPLERATE:
                return set_samplerate(devc, *(const uint64_t *)value);
-       case SR_HWCAP_LIMIT_SAMPLES:
+       case SR_CONF_LIMIT_SAMPLES:
                return set_limit_samples(devc, *(const uint64_t *)value);
-       case SR_HWCAP_CAPTURE_RATIO:
+       case SR_CONF_CAPTURE_RATIO:
                return set_capture_ratio(devc, *(const uint64_t *)value);
        default:
                return SR_ERR;
index adbab4e9f258ce33939a60ad5add054178273625..6fd91216f12e626599fd52fad02787a19254f957 100644 (file)
  */
 
 static struct sr_config_info sr_config_info_data[] = {
-       {SR_HWOPT_CONN, SR_T_CHAR, "conn",
+       {SR_CONF_CONN, SR_T_CHAR, "conn",
                "Connection", NULL},
-       {SR_HWOPT_SERIALCOMM, SR_T_CHAR, "serialcomm",
+       {SR_CONF_SERIALCOMM, SR_T_CHAR, "serialcomm",
                "Serial communication", NULL},
-       {SR_HWCAP_SAMPLERATE, SR_T_UINT64, "samplerate",
+       {SR_CONF_SAMPLERATE, SR_T_UINT64, "samplerate",
                "Sample rate", NULL},
-       {SR_HWCAP_CAPTURE_RATIO, SR_T_UINT64, "captureratio",
+       {SR_CONF_CAPTURE_RATIO, SR_T_UINT64, "captureratio",
                "Pre-trigger capture ratio", NULL},
-       {SR_HWCAP_PATTERN_MODE, SR_T_CHAR, "pattern",
+       {SR_CONF_PATTERN_MODE, SR_T_CHAR, "pattern",
                "Pattern generator mode", NULL},
-       {SR_HWCAP_RLE, SR_T_BOOL, "rle",
+       {SR_CONF_RLE, SR_T_BOOL, "rle",
                "Run Length Encoding", NULL},
-       {SR_HWCAP_TRIGGER_SLOPE, SR_T_UINT64, "triggerslope",
+       {SR_CONF_TRIGGER_SLOPE, SR_T_UINT64, "triggerslope",
                "Trigger slope", NULL},
-       {SR_HWCAP_TRIGGER_SOURCE, SR_T_CHAR, "triggersource",
+       {SR_CONF_TRIGGER_SOURCE, SR_T_CHAR, "triggersource",
                "Trigger source", NULL},
-       {SR_HWCAP_HORIZ_TRIGGERPOS, SR_T_FLOAT, "horiz_triggerpos",
+       {SR_CONF_HORIZ_TRIGGERPOS, SR_T_FLOAT, "horiz_triggerpos",
                "Horizontal trigger position", NULL},
-       {SR_HWCAP_BUFFERSIZE, SR_T_UINT64, "buffersize",
+       {SR_CONF_BUFFERSIZE, SR_T_UINT64, "buffersize",
                "Buffer size", NULL},
-       {SR_HWCAP_TIMEBASE, SR_T_RATIONAL_PERIOD, "timebase",
+       {SR_CONF_TIMEBASE, SR_T_RATIONAL_PERIOD, "timebase",
                "Time base", NULL},
-       {SR_HWCAP_FILTER, SR_T_CHAR, "filter",
+       {SR_CONF_FILTER, SR_T_CHAR, "filter",
                "Filter targets", NULL},
-       {SR_HWCAP_VDIV, SR_T_RATIONAL_VOLT, "vdiv",
+       {SR_CONF_VDIV, SR_T_RATIONAL_VOLT, "vdiv",
                "Volts/div", NULL},
-       {SR_HWCAP_COUPLING, SR_T_CHAR, "coupling",
+       {SR_CONF_COUPLING, SR_T_CHAR, "coupling",
                "Coupling", NULL},
        {0, 0, NULL, NULL, NULL},
 };
@@ -307,7 +307,7 @@ SR_PRIV struct sr_config *sr_config_make(int key, const void *value)
  * Returns information about the given driver or device instance.
  *
  * @param driver The sr_dev_driver struct to query.
- * @param id The type of information, in the form of an SR_HWCAP_* option.
+ * @param id The type of information, in the form of an SR_CONF_* option.
  * @param data Pointer where the value. will be stored. Must not be NULL.
  * @param sdi Pointer to the struct sr_dev_inst to be checked. Must not be NULL.
  *
index 3d4418ca41044077a771afc3898e8940210d22cb..d8e47b52e56ce9b9786b3d10d2f504c56e3c31d5 100644 (file)
@@ -124,7 +124,7 @@ static int loadfile(struct sr_input *in, const char *filename)
        if (ctx->samplerate) {
                packet.type = SR_DF_META;
                packet.payload = &meta;
-               src = sr_config_make(SR_HWCAP_SAMPLERATE, (const void *)&ctx->samplerate);
+               src = sr_config_make(SR_CONF_SAMPLERATE, (const void *)&ctx->samplerate);
                meta.config = g_slist_append(NULL, src);
                sr_session_send(in->sdi, &packet);
        }
index c3913789a3e67b82a1ff2b783f8acf3d88ee9b30..d64899d3c040e15f24b1420116c861e9d8448494 100644 (file)
@@ -176,7 +176,7 @@ static int loadfile(struct sr_input *in, const char *filename)
        /* Send metadata about the SR_DF_LOGIC packets to come. */
        packet.type = SR_DF_META;
        packet.payload = &meta;
-       src = sr_config_make(SR_HWCAP_SAMPLERATE, (const void *)&samplerate);
+       src = sr_config_make(SR_CONF_SAMPLERATE, (const void *)&samplerate);
        meta.config = g_slist_append(NULL, src);
        sr_session_send(in->sdi, &packet);
 
index 25192f88fa7894b1850b682c93d03382345ca53a..5bb1f677b7c527ad0c6107960ec4b9af2e154117 100644 (file)
@@ -574,7 +574,7 @@ static int loadfile(struct sr_input *in, const char *filename)
        packet.type = SR_DF_META;
        packet.payload = &meta;
        samplerate = ctx->samplerate / ctx->downsample;
-       src = sr_config_make(SR_HWCAP_SAMPLERATE, (const void *)&samplerate);
+       src = sr_config_make(SR_CONF_SAMPLERATE, (const void *)&samplerate);
        meta.config = g_slist_append(NULL, src);
        sr_session_send(in->sdi, &packet);
 
index 2e7b1373fca9988e1b832397816185e31e5c4d35..825591d62b78c2b4c95aea754c3a9d82fcc4cf62 100644 (file)
@@ -388,39 +388,39 @@ enum {
        /*--- Device classes ------------------------------------------------*/
 
        /** The device can act as logic analyzer. */
-       SR_HWCAP_LOGIC_ANALYZER = 10000,
+       SR_CONF_LOGIC_ANALYZER = 10000,
 
        /** The device can act as an oscilloscope. */
-       SR_HWCAP_OSCILLOSCOPE,
+       SR_CONF_OSCILLOSCOPE,
 
        /** The device can act as a multimeter. */
-       SR_HWCAP_MULTIMETER,
+       SR_CONF_MULTIMETER,
 
        /** The device is a demo device. */
-       SR_HWCAP_DEMO_DEV,
+       SR_CONF_DEMO_DEV,
 
        /** The device can act as a sound level meter. */
-       SR_HWCAP_SOUNDLEVELMETER,
+       SR_CONF_SOUNDLEVELMETER,
 
        /** The device can measure temperature. */
-       SR_HWCAP_THERMOMETER,
+       SR_CONF_THERMOMETER,
 
        /** The device can measure humidity. */
-       SR_HWCAP_HYGROMETER,
+       SR_CONF_HYGROMETER,
 
        /*--- Driver options ------------------------------------------------*/
 
        /**
         * Specification on how to connect to a device.
         *
-        * In combination with SR_HWOPT_SERIALCOMM, this is a serial port in
+        * In combination with SR_CONF_SERIALCOMM, this is a serial port in
         * the form which makes sense to the OS (e.g., /dev/ttyS0).
         * Otherwise this specifies a USB device, either in the form of
         * @verbatim <bus>.<address> @endverbatim (decimal, e.g. 1.65) or
         * @verbatim <vendorid>.<productid> @endverbatim
         * (hexadecimal, e.g. 1d6b.0001).
         */
-       SR_HWOPT_CONN = 20000,
+       SR_CONF_CONN = 20000,
 
        /**
         * Serial communication specification, in the form:
@@ -441,62 +441,62 @@ enum {
         * This is always an optional parameter, since a driver typically
         * knows the speed at which the device wants to communicate.
         */
-       SR_HWOPT_SERIALCOMM,
+       SR_CONF_SERIALCOMM,
 
        /*--- Device configuration ------------------------------------------*/
 
        /** The device supports setting/changing its samplerate. */
-       SR_HWCAP_SAMPLERATE = 30000,
+       SR_CONF_SAMPLERATE = 30000,
 
        /** The device supports setting a pre/post-trigger capture ratio. */
-       SR_HWCAP_CAPTURE_RATIO,
+       SR_CONF_CAPTURE_RATIO,
 
        /** The device supports setting a pattern (pattern generator mode). */
-       SR_HWCAP_PATTERN_MODE,
+       SR_CONF_PATTERN_MODE,
 
        /** The device supports Run Length Encoding. */
-       SR_HWCAP_RLE,
+       SR_CONF_RLE,
 
        /** The device supports setting trigger slope. */
-       SR_HWCAP_TRIGGER_SLOPE,
+       SR_CONF_TRIGGER_SLOPE,
 
        /** Trigger source. */
-       SR_HWCAP_TRIGGER_SOURCE,
+       SR_CONF_TRIGGER_SOURCE,
 
        /** Horizontal trigger position. */
-       SR_HWCAP_HORIZ_TRIGGERPOS,
+       SR_CONF_HORIZ_TRIGGERPOS,
 
        /** Buffer size. */
-       SR_HWCAP_BUFFERSIZE,
+       SR_CONF_BUFFERSIZE,
 
        /** Time base. */
-       SR_HWCAP_TIMEBASE,
+       SR_CONF_TIMEBASE,
 
        /** Filter. */
-       SR_HWCAP_FILTER,
+       SR_CONF_FILTER,
 
        /** Volts/div. */
-       SR_HWCAP_VDIV,
+       SR_CONF_VDIV,
 
        /** Coupling. */
-       SR_HWCAP_COUPLING,
+       SR_CONF_COUPLING,
 
        /*--- Special stuff -------------------------------------------------*/
 
        /** Session filename. */
-       SR_HWCAP_SESSIONFILE = 40000,
+       SR_CONF_SESSIONFILE = 40000,
 
        /* TODO: Better description. */
        /** The device supports specifying a capturefile to inject. */
-       SR_HWCAP_CAPTUREFILE,
+       SR_CONF_CAPTUREFILE,
 
        /* TODO: Better description. */
        /** The device supports specifying the capturefile unit size. */
-       SR_HWCAP_CAPTURE_UNITSIZE,
+       SR_CONF_CAPTURE_UNITSIZE,
 
        /* TODO: Better description. */
        /** The device supports setting the number of probes. */
-       SR_HWCAP_CAPTURE_NUM_PROBES,
+       SR_CONF_CAPTURE_NUM_PROBES,
 
        /*--- Acquisition modes ---------------------------------------------*/
 
@@ -504,26 +504,26 @@ enum {
         * The device supports setting a sample time limit (how long
         * the sample acquisition should run, in ms).
         */
-       SR_HWCAP_LIMIT_MSEC = 50000,
+       SR_CONF_LIMIT_MSEC = 50000,
 
        /**
         * The device supports setting a sample number limit (how many
         * samples should be acquired).
         */
-       SR_HWCAP_LIMIT_SAMPLES,
+       SR_CONF_LIMIT_SAMPLES,
 
        /**
         * The device supports setting a frame limit (how many
         * frames should be acquired).
         */
-       SR_HWCAP_LIMIT_FRAMES,
+       SR_CONF_LIMIT_FRAMES,
 
        /**
         * The device supports continuous sampling. Neither a time limit
         * nor a sample number limit has to be supplied, it will just acquire
         * samples continuously, until explicitly stopped by a certain command.
         */
-       SR_HWCAP_CONTINUOUS,
+       SR_CONF_CONTINUOUS,
 };
 
 struct sr_dev_inst {
index 70e6f217818825dbf0072284d8bb172e6cf23c26..e3a49145e1c488f6956a00032bd90e58a6a79bb8 100644 (file)
@@ -128,7 +128,7 @@ static int init(struct sr_output *o)
        ctx->probelist[ctx->num_enabled_probes] = 0;
        ctx->unitsize = (ctx->num_enabled_probes + 7) / 8;
 
-       if (sr_dev_has_hwcap(o->sdi, SR_HWCAP_SAMPLERATE)) {
+       if (sr_dev_has_hwcap(o->sdi, SR_CONF_SAMPLERATE)) {
                o->sdi->driver->info_get(SR_DI_CUR_SAMPLERATE,
                                (const void **)&samplerate, o->sdi);
                ctx->samplerate = *samplerate;
index c86fd7c919e7151635279b3711b2ad5a4a0bab79..da09c3e70b51030a93fe8e5d9ae8c6c24b653803 100644 (file)
@@ -99,7 +99,7 @@ static int init(struct sr_output *o)
 
        num_probes = g_slist_length(o->sdi->probes);
 
-       if (sr_dev_has_hwcap(o->sdi, SR_HWCAP_SAMPLERATE)) {
+       if (sr_dev_has_hwcap(o->sdi, SR_CONF_SAMPLERATE)) {
                o->sdi->driver->info_get(SR_DI_CUR_SAMPLERATE,
                                (const void **)&samplerate, o->sdi);
                ctx->samplerate = *samplerate;
index 7a7c2d4619060c4aba719cc51336417ec15b3bf9..5e6042302793b4bd3c5f400f503e8a20f67270d3 100644 (file)
@@ -109,7 +109,7 @@ static int init(struct sr_output *o)
 
        num_probes = g_slist_length(o->sdi->probes);
        comment[0] = '\0';
-       if (sr_dev_has_hwcap(o->sdi, SR_HWCAP_SAMPLERATE)) {
+       if (sr_dev_has_hwcap(o->sdi, SR_CONF_SAMPLERATE)) {
                o->sdi->driver->info_get(SR_DI_CUR_SAMPLERATE,
                                (const void **)&samplerate, o->sdi);
                if (!(frequency_s = sr_samplerate_string(*samplerate))) {
index 8c71eea0775dda5d7c5e6ea43614ad15bccf996b..dc5704bbee2499a45843467b8e7cbc1a2aa0cae4 100644 (file)
@@ -69,7 +69,7 @@ static int init(struct sr_output *o)
        }
        ctx->unitsize = (num_enabled_probes + 7) / 8;
 
-       if (o->sdi->driver && sr_dev_has_hwcap(o->sdi, SR_HWCAP_SAMPLERATE))
+       if (o->sdi->driver && sr_dev_has_hwcap(o->sdi, SR_CONF_SAMPLERATE))
                o->sdi->driver->info_get(SR_DI_CUR_SAMPLERATE,
                                (const void **)&samplerate, o->sdi);
        else {
index dc8dc4b0eb4ff7dd849ee0e5835e33687d4bad5e..e7b5d2c8eb263e3768efad62042ba97fe875ad90 100644 (file)
@@ -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);
        num_probes = g_slist_length(o->sdi->probes);
-       if (o->sdi->driver || sr_dev_has_hwcap(o->sdi, SR_HWCAP_SAMPLERATE)) {
+       if (o->sdi->driver || sr_dev_has_hwcap(o->sdi, SR_CONF_SAMPLERATE)) {
                ret = o->sdi->driver->info_get(SR_DI_CUR_SAMPLERATE,
                                (const void **)&samplerate, o->sdi);
                if (ret != SR_OK)
index e609e0f303419d5cb679057e118b8935a37bf703..f937ef7fd1223d8480754d69c8f2be872caf0857 100644 (file)
@@ -94,7 +94,7 @@ static int init(struct sr_output *o)
        g_string_append_printf(ctx->header, "$version %s %s $end\n",
                        PACKAGE, PACKAGE_VERSION);
 
-       if (o->sdi->driver && sr_dev_has_hwcap(o->sdi, SR_HWCAP_SAMPLERATE)) {
+       if (o->sdi->driver && sr_dev_has_hwcap(o->sdi, SR_CONF_SAMPLERATE)) {
                o->sdi->driver->info_get(SR_DI_CUR_SAMPLERATE,
                                (const void **)&samplerate, o->sdi);
                ctx->samplerate = *samplerate;
index 8a5b08ce274ab5b5f3e9855aeb4d6dfd54b11ad5..dfde8d799264f734e8d8c1b0450c294350981b63 100644 (file)
@@ -53,8 +53,8 @@ struct session_vdev {
 
 static GSList *dev_insts = NULL;
 static const int hwcaps[] = {
-       SR_HWCAP_CAPTUREFILE,
-       SR_HWCAP_CAPTURE_UNITSIZE,
+       SR_CONF_CAPTUREFILE,
+       SR_CONF_CAPTURE_UNITSIZE,
        0,
 };
 
@@ -180,24 +180,24 @@ static int hw_dev_config_set(const struct sr_dev_inst *sdi, int hwcap,
        vdev = sdi->priv;
 
        switch (hwcap) {
-       case SR_HWCAP_SAMPLERATE:
+       case SR_CONF_SAMPLERATE:
                tmp_u64 = value;
                vdev->samplerate = *tmp_u64;
                sr_info("Setting samplerate to %" PRIu64 ".", vdev->samplerate);
                break;
-       case SR_HWCAP_SESSIONFILE:
+       case SR_CONF_SESSIONFILE:
                vdev->sessionfile = g_strdup(value);
                sr_info("Setting sessionfile to '%s'.", vdev->sessionfile);
                break;
-       case SR_HWCAP_CAPTUREFILE:
+       case SR_CONF_CAPTUREFILE:
                vdev->capturefile = g_strdup(value);
                sr_info("Setting capturefile to '%s'.", vdev->capturefile);
                break;
-       case SR_HWCAP_CAPTURE_UNITSIZE:
+       case SR_CONF_CAPTURE_UNITSIZE:
                tmp_u64 = value;
                vdev->unitsize = *tmp_u64;
                break;
-       case SR_HWCAP_CAPTURE_NUM_PROBES:
+       case SR_CONF_CAPTURE_NUM_PROBES:
                tmp_u64 = value;
                vdev->num_probes = *tmp_u64;
                break;
index c1fcf57f25b196aca56e2ad7ef4ee48cff7d21a3..c4f0db63d4072340307ee3c490bab0c5e98cf909 100644 (file)
@@ -146,18 +146,18 @@ SR_API int sr_session_load(const char *filename)
                                                /* first device, init the driver */
                                                sdi->driver->init(NULL);
                                        sr_session_dev_add(sdi);
-                                       sdi->driver->dev_config_set(sdi, SR_HWCAP_SESSIONFILE, filename);
-                                       sdi->driver->dev_config_set(sdi, SR_HWCAP_CAPTUREFILE, val);
+                                       sdi->driver->dev_config_set(sdi, SR_CONF_SESSIONFILE, filename);
+                                       sdi->driver->dev_config_set(sdi, SR_CONF_CAPTUREFILE, val);
                                        g_ptr_array_add(capturefiles, val);
                                } else if (!strcmp(keys[j], "samplerate")) {
                                        sr_parse_sizestring(val, &tmp_u64);
-                                       sdi->driver->dev_config_set(sdi, SR_HWCAP_SAMPLERATE, &tmp_u64);
+                                       sdi->driver->dev_config_set(sdi, SR_CONF_SAMPLERATE, &tmp_u64);
                                } else if (!strcmp(keys[j], "unitsize")) {
                                        tmp_u64 = strtoull(val, NULL, 10);
-                                       sdi->driver->dev_config_set(sdi, SR_HWCAP_CAPTURE_UNITSIZE, &tmp_u64);
+                                       sdi->driver->dev_config_set(sdi, SR_CONF_CAPTURE_UNITSIZE, &tmp_u64);
                                } else if (!strcmp(keys[j], "total probes")) {
                                        total_probes = strtoull(val, NULL, 10);
-                                       sdi->driver->dev_config_set(sdi, SR_HWCAP_CAPTURE_NUM_PROBES, &total_probes);
+                                       sdi->driver->dev_config_set(sdi, SR_CONF_CAPTURE_NUM_PROBES, &total_probes);
                                        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,
@@ -253,7 +253,7 @@ SR_API int sr_session_save(const char *filename, const struct sr_dev_inst *sdi,
        fprintf(meta, "capturefile = logic-1\n");
        fprintf(meta, "unitsize = %d\n", unitsize);
        fprintf(meta, "total probes = %d\n", g_slist_length(sdi->probes));
-       if (sr_dev_has_hwcap(sdi, SR_HWCAP_SAMPLERATE)) {
+       if (sr_dev_has_hwcap(sdi, SR_CONF_SAMPLERATE)) {
                if (sr_info_get(sdi->driver, SR_DI_CUR_SAMPLERATE,
                                (const void **)&samplerate, sdi) == SR_OK) {
                        s = sr_samplerate_string(*samplerate);