]> sigrok.org Git - libsigrok.git/commitdiff
drivers: use new sr_config struct
authorBert Vermeulen <redacted>
Sun, 6 Jan 2013 16:41:30 +0000 (17:41 +0100)
committerBert Vermeulen <redacted>
Mon, 21 Jan 2013 22:32:49 +0000 (23:32 +0100)
Sending an SR_DF_META packet at the start of every stream is not
mandatory; the frontend should ask for what it needs, and any extra
information the driver wants to send will come in due time.

20 files changed:
hardware/agilent-dmm/api.c
hardware/alsa/api.c
hardware/asix-sigma/asix-sigma.c
hardware/chronovu-la8/api.c
hardware/colead-slm/api.c
hardware/demo/demo.c
hardware/fluke-dmm/api.c
hardware/fx2lafw/fx2lafw.c
hardware/hantek-dso/api.c
hardware/hantek-dso/dso.h
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

index 167d4cc83cdb44d89cd547eb7ea7ae6a01f11897..9bcca5887e29e9208ffcd25ebc143a91d6adf691 100644 (file)
@@ -109,7 +109,7 @@ static GSList *hw_scan(GSList *options)
        struct sr_dev_inst *sdi;
        struct drv_context *drvc;
        struct dev_context *devc;
-       struct sr_hwopt *opt;
+       struct sr_config *src;
        struct sr_probe *probe;
        struct sr_serial_dev_inst *serial;
        GSList *l, *devices;
@@ -123,13 +123,13 @@ static GSList *hw_scan(GSList *options)
        devices = NULL;
        conn = serialcomm = NULL;
        for (l = options; l; l = l->next) {
-               opt = l->data;
-               switch (opt->hwopt) {
+               src = l->data;
+               switch (src->key) {
                case SR_HWOPT_CONN:
-                       conn = opt->value;
+                       conn = src->value;
                        break;
                case SR_HWOPT_SERIALCOMM:
-                       serialcomm = opt->value;
+                       serialcomm = src->value;
                        break;
                }
        }
@@ -309,7 +309,6 @@ static int hw_dev_acquisition_start(const struct sr_dev_inst *sdi,
 {
        struct sr_datafeed_packet packet;
        struct sr_datafeed_header header;
-       struct sr_datafeed_meta_analog meta;
        struct dev_context *devc;
 
        if (!(devc = sdi->priv)) {
@@ -329,13 +328,6 @@ static int hw_dev_acquisition_start(const struct sr_dev_inst *sdi,
        gettimeofday(&header.starttime, NULL);
        sr_session_send(devc->cb_data, &packet);
 
-       /* Send metadata about the SR_DF_ANALOG packets to come. */
-       sr_dbg("Sending SR_DF_META_ANALOG.");
-       packet.type = SR_DF_META_ANALOG;
-       packet.payload = &meta;
-       meta.num_probes = 1;
-       sr_session_send(devc->cb_data, &packet);
-
        /* Poll every 100ms, or whenever some data comes in. */
        sr_source_add(devc->serial->fd, G_IO_IN, 100, agdmm_receive_data, (void *)sdi);
 
index 5731346132d1b59a18b90c33463b381325f56607..f3948458144ca8725b0dc34ad0fdf533bdc3e98b 100644 (file)
@@ -196,7 +196,6 @@ static int hw_dev_acquisition_start(const struct sr_dev_inst *sdi,
 {
        struct sr_datafeed_packet packet;
        struct sr_datafeed_header header;
-       struct sr_datafeed_meta_analog meta;
        struct dev_context *devc;
        int count, ret;
        char *endianness;
@@ -287,13 +286,6 @@ static int hw_dev_acquisition_start(const struct sr_dev_inst *sdi,
        gettimeofday(&header.starttime, NULL);
        sr_session_send(devc->cb_data, &packet);
 
-       /* Send metadata about the SR_DF_ANALOG packets to come. */
-       sr_dbg("Sending SR_DF_META_ANALOG packet.");
-       packet.type = SR_DF_META_ANALOG;
-       packet.payload = &meta;
-       meta.num_probes = devc->num_probes;
-       sr_session_send(devc->cb_data, &packet);
-
        /* Poll every 10ms, or whenever some data comes in. */
        sr_source_add(devc->ufds[0].fd, devc->ufds[0].events, 10,
                      alsa_receive_data, (void *)sdi);
index 3c6b3e2c8107031c3324052b3ef3354c1b7950dd..dd7457748d7859c1d8a610dfcd87c9516006414c 100644 (file)
@@ -1271,7 +1271,6 @@ static int hw_dev_acquisition_start(const struct sr_dev_inst *sdi,
        struct dev_context *devc;
        struct sr_datafeed_packet *packet;
        struct sr_datafeed_header *header;
-       struct sr_datafeed_meta_logic meta;
        struct clockselect_50 clockselect;
        int frac, triggerpin, ret;
        uint8_t triggerselect = 0;
@@ -1382,13 +1381,6 @@ static int hw_dev_acquisition_start(const struct sr_dev_inst *sdi,
        gettimeofday(&header->starttime, NULL);
        sr_session_send(devc->session_dev_id, packet);
 
-       /* Send metadata about the SR_DF_LOGIC packets to come. */
-       packet->type = SR_DF_META_LOGIC;
-       packet->payload = &meta;
-       meta.samplerate = devc->cur_samplerate;
-       meta.num_probes = devc->num_probes;
-       sr_session_send(devc->session_dev_id, packet);
-
        /* Add capture source. */
        sr_source_add(0, G_IO_IN, 10, receive_data, (void *)sdi);
 
index 0df9a7bc92eb633e9485c0459812f64be94ddf75..9267ca7b7c32f0446e4019fc90bd655a5ce2009e 100644 (file)
@@ -421,7 +421,6 @@ static int hw_dev_acquisition_start(const struct sr_dev_inst *sdi,
        struct dev_context *devc;
        struct sr_datafeed_packet packet;
        struct sr_datafeed_header header;
-       struct sr_datafeed_meta_logic meta;
        uint8_t buf[4];
        int bytes_written;
 
@@ -477,13 +476,6 @@ static int hw_dev_acquisition_start(const struct sr_dev_inst *sdi,
        gettimeofday(&header.starttime, NULL);
        sr_session_send(devc->session_dev_id, &packet);
 
-       /* Send metadata about the SR_DF_LOGIC packets to come. */
-       packet.type = SR_DF_META_LOGIC;
-       packet.payload = &meta;
-       meta.samplerate = devc->cur_samplerate;
-       meta.num_probes = NUM_PROBES;
-       sr_session_send(devc->session_dev_id, &packet);
-
        /* Time when we should be done (for detecting trigger timeouts). */
        devc->done = (devc->divcount + 1) * 0.08388608 + time(NULL)
                        + devc->trigger_timeout;
index 3135a5f35f95b9b5fbe9cba0619de086d344adfe..098ba92ffa397a7d5a36534ff84c1e9dd4225e5b 100644 (file)
@@ -92,7 +92,7 @@ static GSList *hw_scan(GSList *options)
        struct drv_context *drvc;
        struct dev_context *devc;
        struct sr_dev_inst *sdi;
-       struct sr_hwopt *opt;
+       struct sr_config *src;
        struct sr_probe *probe;
        GSList *devices, *l;
        const char *conn, *serialcomm;
@@ -103,13 +103,13 @@ static GSList *hw_scan(GSList *options)
 
        conn = serialcomm = NULL;
        for (l = options; l; l = l->next) {
-               opt = l->data;
-               switch (opt->hwopt) {
+               src = l->data;
+               switch (src->key) {
                case SR_HWOPT_CONN:
-                       conn = opt->value;
+                       conn = src->value;
                        break;
                case SR_HWOPT_SERIALCOMM:
-                       serialcomm = opt->value;
+                       serialcomm = src->value;
                        break;
                }
        }
@@ -253,7 +253,6 @@ static int hw_dev_acquisition_start(const struct sr_dev_inst *sdi,
 {
        struct sr_datafeed_packet packet;
        struct sr_datafeed_header header;
-       struct sr_datafeed_meta_analog meta;
        struct dev_context *devc;
 
        if (!(devc = sdi->priv)) {
@@ -273,13 +272,6 @@ static int hw_dev_acquisition_start(const struct sr_dev_inst *sdi,
        gettimeofday(&header.starttime, NULL);
        sr_session_send(devc->cb_data, &packet);
 
-       /* Send metadata about the SR_DF_ANALOG packets to come. */
-       sr_dbg("Sending SR_DF_META_ANALOG.");
-       packet.type = SR_DF_META_ANALOG;
-       packet.payload = &meta;
-       meta.num_probes = 1;
-       sr_session_send(devc->cb_data, &packet);
-
        /* Poll every 150ms, or whenever some data comes in. */
        sr_source_add(devc->serial->fd, G_IO_IN, 150, colead_slm_receive_data,
                        (void *)sdi);
index 5d7c006aab3ae1843234fc62f19d7c304aadade0..c1a5a4138d6ac04e637addc64c18638d48d85b5d 100644 (file)
@@ -390,7 +390,6 @@ static int hw_dev_acquisition_start(const struct sr_dev_inst *sdi,
 {
        struct sr_datafeed_packet *packet;
        struct sr_datafeed_header *header;
-       struct sr_datafeed_meta_logic meta;
        struct dev_context *devc;
 
        (void)sdi;
@@ -452,13 +451,6 @@ static int hw_dev_acquisition_start(const struct sr_dev_inst *sdi,
        gettimeofday(&header->starttime, NULL);
        sr_session_send(devc->session_dev_id, packet);
 
-       /* Send metadata about the SR_DF_LOGIC packets to come. */
-       packet->type = SR_DF_META_LOGIC;
-       packet->payload = &meta;
-       meta.samplerate = cur_samplerate;
-       meta.num_probes = NUM_PROBES;
-       sr_session_send(devc->session_dev_id, packet);
-
        /* We use this timestamp to decide how many more samples to send. */
        devc->starttime = g_get_monotonic_time();
 
index a7272ad960e8adf8c878483a9637e7ba18632662..44c4651e1bca095dfaa507215b1772ffe021facf 100644 (file)
@@ -194,20 +194,20 @@ static GSList *fluke_scan(const char *conn, const char *serialcomm)
 
 static GSList *hw_scan(GSList *options)
 {
-       struct sr_hwopt *opt;
+       struct sr_config *src;
        GSList *l, *devices;
        int i;
        const char *conn, *serialcomm;
 
        conn = serialcomm = NULL;
        for (l = options; l; l = l->next) {
-               opt = l->data;
-               switch (opt->hwopt) {
+               src = l->data;
+               switch (src->key) {
                case SR_HWOPT_CONN:
-                       conn = opt->value;
+                       conn = src->value;
                        break;
                case SR_HWOPT_SERIALCOMM:
-                       serialcomm = opt->value;
+                       serialcomm = src->value;
                        break;
                }
        }
@@ -343,7 +343,6 @@ static int hw_dev_acquisition_start(const struct sr_dev_inst *sdi,
 {
        struct sr_datafeed_packet packet;
        struct sr_datafeed_header header;
-       struct sr_datafeed_meta_analog meta;
        struct dev_context *devc;
 
        if (!(devc = sdi->priv)) {
@@ -363,13 +362,6 @@ static int hw_dev_acquisition_start(const struct sr_dev_inst *sdi,
        gettimeofday(&header.starttime, NULL);
        sr_session_send(devc->cb_data, &packet);
 
-       /* Send metadata about the SR_DF_ANALOG packets to come. */
-       sr_dbg("Sending SR_DF_META_ANALOG.");
-       packet.type = SR_DF_META_ANALOG;
-       packet.payload = &meta;
-       meta.num_probes = 1;
-       sr_session_send(devc->cb_data, &packet);
-
        /* Poll every 100ms, or whenever some data comes in. */
        sr_source_add(devc->serial->fd, G_IO_IN, 50, fluke_receive_data, (void *)sdi);
 
index 9eae9508fd7af9500fc9b45645bbdaf92ed848e7..304873ae9f3a8f9b6b8ac7a4ab7bd93d325768d1 100644 (file)
@@ -928,7 +928,6 @@ static int hw_dev_acquisition_start(const struct sr_dev_inst *sdi,
 {
        struct sr_datafeed_packet packet;
        struct sr_datafeed_header header;
-       struct sr_datafeed_meta_logic meta;
        struct dev_context *devc;
        struct drv_context *drvc;
        struct libusb_transfer *transfer;
@@ -998,13 +997,6 @@ static int hw_dev_acquisition_start(const struct sr_dev_inst *sdi,
        gettimeofday(&header.starttime, NULL);
        sr_session_send(cb_data, &packet);
 
-       /* Send metadata about the SR_DF_LOGIC packets to come. */
-       packet.type = SR_DF_META_LOGIC;
-       packet.payload = &meta;
-       meta.samplerate = devc->cur_samplerate;
-       meta.num_probes = devc->sample_wide ? 16 : 8;
-       sr_session_send(cb_data, &packet);
-
        if ((ret = command_start_acquisition(devc->usb->devhdl,
                devc->cur_samplerate, devc->sample_wide)) != SR_OK) {
                abort_acquisition(devc);
index aec6651ff7677a0b82933f3cff04faa5cc8b732e..8e589c51aa3c31062553953d304927427d0fe5f8 100644 (file)
@@ -842,7 +842,6 @@ static int hw_dev_acquisition_start(const struct sr_dev_inst *sdi,
        const struct libusb_pollfd **lupfd;
        struct sr_datafeed_packet packet;
        struct sr_datafeed_header header;
-       struct sr_datafeed_meta_analog meta;
        struct dev_context *devc;
        struct drv_context *drvc = di->priv;
        int i;
@@ -878,12 +877,6 @@ static int hw_dev_acquisition_start(const struct sr_dev_inst *sdi,
        gettimeofday(&header.starttime, NULL);
        sr_session_send(cb_data, &packet);
 
-       /* Send metadata about the SR_DF_ANALOG packets to come. */
-       packet.type = SR_DF_META_ANALOG;
-       packet.payload = &meta;
-       meta.num_probes = NUM_PROBES;
-       sr_session_send(cb_data, &packet);
-
        return SR_OK;
 }
 
index bafa077d2440f6a6e733e1c3bb065be1836ab3d9..866dc2d5343fadda68a4d613711b042a5949c9d1 100644 (file)
@@ -26,7 +26,6 @@
 #define USB_CONFIGURATION              1
 #define DSO_EP_IN                      0x86
 #define DSO_EP_OUT                     0x02
-#define NUM_PROBES                     2
 
 /* FX2 renumeration delay in ms */
 #define MAX_RENUM_DELAY_MS             3000
index e987570579838a318ad3b3b507e7a7147c6bdd1a..16349fddb3e4f895e3a1efd517d2270bd30990a0 100644 (file)
@@ -89,7 +89,7 @@ static GSList *hw_scan(GSList *options)
        struct dev_context *devc;
        struct sr_dev_inst *sdi;
        struct sr_usb_dev_inst *usb;
-       struct sr_hwopt *opt;
+       struct sr_config *src;
        GSList *usb_devices, *devices, *l;
        const char *conn;
 
@@ -105,10 +105,10 @@ static GSList *hw_scan(GSList *options)
 
        conn = NULL;
        for (l = options; l; l = l->next) {
-               opt = l->data;
-               switch (opt->hwopt) {
+               src = l->data;
+               switch (src->key) {
                case SR_HWOPT_CONN:
-                       conn = opt->value;
+                       conn = src->value;
                        break;
                }
        }
@@ -335,7 +335,6 @@ static int hw_dev_acquisition_start(const struct sr_dev_inst *sdi,
 {
        struct sr_datafeed_packet packet;
        struct sr_datafeed_header header;
-       struct sr_datafeed_meta_analog meta;
        struct dev_context *devc;
        struct drv_context *drvc = di->priv;
        struct libusb_transfer *xfer_in, *xfer_out;
@@ -429,12 +428,6 @@ static int hw_dev_acquisition_start(const struct sr_dev_inst *sdi,
        devc->log_size = xfer_in->buffer[1] + (xfer_in->buffer[2] << 8);
        libusb_free_transfer(xfer_out);
 
-       /* Send metadata about the SR_DF_ANALOG packets to come. */
-       packet.type = SR_DF_META_ANALOG;
-       packet.payload = &meta;
-       meta.num_probes = 1;
-       sr_session_send(devc->cb_data, &packet);
-
        pfd = libusb_get_pollfds(drvc->sr_ctx->libusb_ctx);
        for (i = 0; pfd[i]; i++) {
                /* Handle USB events every 100ms, for decent latency. */
index 5dd040a60d9e25d4835315bb8ab6125349ec3abb..fcec20c6bbfc2595c8e49da35772c77108b39982 100644 (file)
@@ -74,19 +74,19 @@ static GSList *hw_scan(GSList *options)
        const char *conn = NULL;
        const char *serialcomm = NULL;
        GSList *l;
-       struct sr_hwopt *opt;
+       struct sr_config *src;
        struct udev *udev;
 
        (void)options;
 
        for (l = options; l; l = l->next) {
-               opt = l->data;
-               switch (opt->hwopt) {
+               src = l->data;
+               switch (src->key) {
                case SR_HWOPT_CONN:
-                       conn = opt->value;
+                       conn = src->value;
                        break;
                case SR_HWOPT_SERIALCOMM:
-                       serialcomm = opt->value;
+                       serialcomm = src->value;
                        break;
                }
        }
@@ -399,7 +399,6 @@ static int hw_dev_acquisition_start(const struct sr_dev_inst *sdi,
 {
        struct sr_datafeed_packet *packet;
        struct sr_datafeed_header *header;
-       struct sr_datafeed_meta_logic meta;
        struct dev_context *devc;
        int ret = SR_ERR;
 
@@ -469,12 +468,6 @@ static int hw_dev_acquisition_start(const struct sr_dev_inst *sdi,
        gettimeofday(&header->starttime, NULL);
        sr_session_send(cb_data, packet);
 
-       packet->type = SR_DF_META_LOGIC;
-       packet->payload = &meta;
-       meta.samplerate = devc->cur_rate;
-       meta.num_probes = NUM_PROBES;
-       sr_session_send(cb_data, packet);
-
        g_free(header);
        g_free(packet);
 
index bb631be27a512d983e6b61a45d2ed343e0a802e1..a902b1435ce57df5a953c4081dd658102cc69274 100644 (file)
@@ -158,7 +158,7 @@ static GSList *hw_scan(GSList *options)
        struct dev_context *devc;
        struct sr_dev_inst *sdi;
        struct sr_usb_dev_inst *usb;
-       struct sr_hwopt *opt;
+       struct sr_config *src;
        struct sr_probe *probe;
        libusb_device *dev;
        GSList *usb_devices, *devices, *l;
@@ -177,10 +177,10 @@ static GSList *hw_scan(GSList *options)
 
        conn = NULL;
        for (l = options; l; l = l->next) {
-               opt = l->data;
-               switch (opt->hwopt) {
+               src = l->data;
+               switch (src->key) {
                case SR_HWOPT_CONN:
-                       conn = opt->value;
+                       conn = src->value;
                        break;
                }
        }
index fbcafda8c71f591bbf5a39ef23d5891e77d8c439..21844eed45bea53dea0db32f821734aeb2ec29ef 100644 (file)
@@ -71,7 +71,7 @@ static int hw_init(struct sr_context *sr_ctx)
 
 static GSList *hw_scan(GSList *options)
 {
-       struct sr_hwopt *opt;
+       struct sr_config *src;
        struct sr_dev_inst *sdi;
        struct drv_context *drvc;
        struct dev_context *devc;
@@ -89,13 +89,13 @@ static GSList *hw_scan(GSList *options)
 
        conn = serialcomm = NULL;
        for (l = options; l; l = l->next) {
-               opt = l->data;
-               switch (opt->hwopt) {
+               src = l->data;
+               switch (src->key) {
                case SR_HWOPT_CONN:
-                       conn = opt->value;
+                       conn = src->value;
                        break;
                case SR_HWOPT_SERIALCOMM:
-                       serialcomm = opt->value;
+                       serialcomm = src->value;
                        break;
                }
        }
@@ -336,7 +336,6 @@ static int hw_dev_acquisition_start(const struct sr_dev_inst *sdi,
 {
        struct sr_datafeed_packet *packet;
        struct sr_datafeed_header *header;
-       struct sr_datafeed_meta_logic meta;
        struct dev_context *devc;
        uint32_t trigger_config[4];
        uint32_t data;
@@ -479,13 +478,6 @@ static int hw_dev_acquisition_start(const struct sr_dev_inst *sdi,
        gettimeofday(&header->starttime, NULL);
        sr_session_send(cb_data, packet);
 
-       /* Send metadata about the SR_DF_LOGIC packets to come. */
-       packet->type = SR_DF_META_LOGIC;
-       packet->payload = &meta;
-       meta.samplerate = devc->cur_samplerate;
-       meta.num_probes = NUM_PROBES;
-       sr_session_send(cb_data, packet);
-
        g_free(header);
        g_free(packet);
 
index 64f8c2220d42c7394bed2ed1fc6f7dd507095a63..8c03ca86db5a700386087ce893a59e04c7ee68b0 100644 (file)
@@ -26,8 +26,6 @@
 #include "libsigrok-internal.h"
 #include "protocol.h"
 
-#define NUM_PROBES 2
-
 static const int hwcaps[] = {
        SR_HWCAP_OSCILLOSCOPE,
        SR_HWCAP_LIMIT_SAMPLES,
@@ -448,7 +446,6 @@ static int hw_dev_acquisition_start(const struct sr_dev_inst *sdi,
        struct dev_context *devc;
        struct sr_datafeed_packet packet;
        struct sr_datafeed_header header;
-       struct sr_datafeed_meta_analog meta;
        char buf[256];
        int len;
 
@@ -467,12 +464,6 @@ static int hw_dev_acquisition_start(const struct sr_dev_inst *sdi,
        gettimeofday(&header.starttime, NULL);
        sr_session_send(cb_data, &packet);
 
-       /* Send metadata about the SR_DF_ANALOG packets to come. */
-       packet.type = SR_DF_META_ANALOG;
-       packet.payload = &meta;
-       meta.num_probes = NUM_PROBES;
-       sr_session_send(cb_data, &packet);
-
        rigol_ds1xx2_send_data(devc->fd, ":CHAN1:SCAL?\n");
        len = read(devc->fd, buf, sizeof(buf));
        buf[len] = 0;
index eee148912f6a611b630447cedbeea9814912a2bf..944972d96c0f50bc03ae4a05119b979ef8dc621d 100644 (file)
@@ -293,19 +293,19 @@ scan_cleanup:
 
 static GSList *hw_scan(GSList *options, int dmm)
 {
-       struct sr_hwopt *opt;
+       struct sr_config *src;
        GSList *l, *devices;
        const char *conn, *serialcomm;
 
        conn = serialcomm = NULL;
        for (l = options; l; l = l->next) {
-               opt = l->data;
-               switch (opt->hwopt) {
+               src = l->data;
+               switch (src->key) {
                case SR_HWOPT_CONN:
-                       conn = opt->value;
+                       conn = src->value;
                        break;
                case SR_HWOPT_SERIALCOMM:
-                       serialcomm = opt->value;
+                       serialcomm = src->value;
                        break;
                }
        }
@@ -430,7 +430,6 @@ static int hw_dev_acquisition_start(const struct sr_dev_inst *sdi,
 {
        struct sr_datafeed_packet packet;
        struct sr_datafeed_header header;
-       struct sr_datafeed_meta_analog meta;
        struct dev_context *devc;
 
        if (!(devc = sdi->priv)) {
@@ -458,13 +457,6 @@ static int hw_dev_acquisition_start(const struct sr_dev_inst *sdi,
        gettimeofday(&header.starttime, NULL);
        sr_session_send(devc->cb_data, &packet);
 
-       /* Send metadata about the SR_DF_ANALOG packets to come. */
-       sr_dbg("Sending SR_DF_META_ANALOG.");
-       packet.type = SR_DF_META_ANALOG;
-       packet.payload = &meta;
-       meta.num_probes = 1;
-       sr_session_send(devc->cb_data, &packet);
-
        /* Poll every 50ms, or whenever some data comes in. */
        sr_source_add(devc->serial->fd, G_IO_IN, 50,
                      dmms[dmm].receive_data, (void *)sdi);
index 5b7ed363bc3b4b195cf20ae11a113d02de969796..b27625b57e6d06856f8d44ddc2a548990d869807 100644 (file)
@@ -88,7 +88,7 @@ static GSList *hw_scan(GSList *options)
        struct drv_context *drvc;
        struct dev_context *devc;
        struct sr_dev_inst *sdi;
-       struct sr_hwopt *opt;
+       struct sr_config *src;
        struct sr_probe *probe;
        GSList *devices, *l;
        const char *conn, *serialcomm;
@@ -99,19 +99,19 @@ static GSList *hw_scan(GSList *options)
 
        conn = serialcomm = NULL;
        for (l = options; l; l = l->next) {
-               if (!(opt = l->data)) {
+               if (!(src = l->data)) {
                        sr_err("Invalid option data, skipping.");
                        continue;
                }
-               switch (opt->hwopt) {
+               switch (src->key) {
                case SR_HWOPT_CONN:
-                       conn = opt->value;
+                       conn = src->value;
                        break;
                case SR_HWOPT_SERIALCOMM:
-                       serialcomm = opt->value;
+                       serialcomm = src->value;
                        break;
                default:
-                       sr_err("Unknown option %d, skipping.", opt->hwopt);
+                       sr_err("Unknown option %d, skipping.", src->key);
                        break;
                }
        }
@@ -245,7 +245,6 @@ static int hw_dev_acquisition_start(const struct sr_dev_inst *sdi,
 {
        struct sr_datafeed_packet packet;
        struct sr_datafeed_header header;
-       struct sr_datafeed_meta_analog meta;
        struct dev_context *devc;
 
        devc = sdi->priv;
@@ -259,13 +258,6 @@ static int hw_dev_acquisition_start(const struct sr_dev_inst *sdi,
        gettimeofday(&header.starttime, NULL);
        sr_session_send(devc->cb_data, &packet);
 
-       /* Send metadata about the SR_DF_ANALOG packets to come. */
-       sr_dbg("Sending SR_DF_META_ANALOG.");
-       packet.type = SR_DF_META_ANALOG;
-       packet.payload = &meta;
-       meta.num_probes = 1;
-       sr_session_send(devc->cb_data, &packet);
-
        /* Poll every 500ms, or whenever some data comes in. */
        sr_source_add(devc->serial->fd, G_IO_IN, 500,
                      tondaj_sl_814_receive_data, (void *)sdi);
index 7c6ad77f9cadae0a55cdce29f0ce74f4a73bdbdb..bae358aaad9a91757078e263777af7cfe9abb722 100644 (file)
@@ -262,7 +262,6 @@ static int hw_dev_acquisition_start(const struct sr_dev_inst *sdi,
 {
        struct sr_datafeed_packet packet;
        struct sr_datafeed_header header;
-       struct sr_datafeed_meta_analog meta;
        struct dev_context *devc;
 
        devc = sdi->priv;
@@ -279,13 +278,6 @@ static int hw_dev_acquisition_start(const struct sr_dev_inst *sdi,
        gettimeofday(&header.starttime, NULL);
        sr_session_send(devc->cb_data, &packet);
 
-       /* Send metadata about the SR_DF_ANALOG packets to come. */
-       sr_dbg("Sending SR_DF_META_ANALOG.");
-       packet.type = SR_DF_META_ANALOG;
-       packet.payload = &meta;
-       meta.num_probes = 1;
-       sr_session_send(devc->cb_data, &packet);
-
        if (!strcmp(di->name, "uni-t-ut61d")) {
                sr_source_add(0, 0, 10 /* poll_timeout */,
                              uni_t_ut61d_receive_data, (void *)sdi);
index 23c12e9dfe40c37edcdc04b3b26791bcca6e7d53..e7fdb7850093f895904daabe347b197eac21a148 100644 (file)
@@ -385,7 +385,6 @@ static int hw_dev_acquisition_start(const struct sr_dev_inst *sdi,
 {
        struct sr_datafeed_packet packet;
        struct sr_datafeed_header header;
-       struct sr_datafeed_meta_analog meta;
        struct dev_context *devc;
        struct drv_context *drvc = di->priv;
        const struct libusb_pollfd **pfd;
@@ -410,12 +409,6 @@ static int hw_dev_acquisition_start(const struct sr_dev_inst *sdi,
        header.feed_version = 1;
        sr_session_send(devc->cb_data, &packet);
 
-       /* Send metadata about the SR_DF_ANALOG packets to come. */
-       packet.type = SR_DF_META_ANALOG;
-       packet.payload = &meta;
-       meta.num_probes = 1;
-       sr_session_send(devc->cb_data, &packet);
-
        pfd = libusb_get_pollfds(drvc->sr_ctx->libusb_ctx);
        for (i = 0; pfd[i]; i++) {
                /* Handle USB events every 100ms, for decent latency. */
index f2fcac63c182a54ba38b1c4ca60c7d631b20c0b3..e132c78439450c3f30f19344c620eeeda5ebf16d 100644 (file)
@@ -686,7 +686,6 @@ static int hw_dev_acquisition_start(const struct sr_dev_inst *sdi,
        struct sr_datafeed_packet packet;
        struct sr_datafeed_logic logic;
        struct sr_datafeed_header header;
-       struct sr_datafeed_meta_logic meta;
        //uint64_t samples_read;
        int res;
        unsigned int packet_num;
@@ -726,13 +725,6 @@ static int hw_dev_acquisition_start(const struct sr_dev_inst *sdi,
        gettimeofday(&header.starttime, NULL);
        sr_session_send(cb_data, &packet);
 
-       /* Send metadata about the SR_DF_LOGIC packets to come. */
-       packet.type = SR_DF_META_LOGIC;
-       packet.payload = &meta;
-       meta.samplerate = devc->cur_samplerate;
-       meta.num_probes = devc->num_channels;
-       sr_session_send(cb_data, &packet);
-
        if (!(buf = g_try_malloc(PACKET_SIZE))) {
                sr_err("zp: %s: buf malloc failed", __func__);
                return SR_ERR_MALLOC;