]> sigrok.org Git - libsigrok.git/blobdiff - hardware/lascar-el-usb/api.c
Always interleave analog data with all enabled probes.
[libsigrok.git] / hardware / lascar-el-usb / api.c
index 3ae8ba5315523236692563caabb72a31aea639a9..f0b69aee438f499408126a1281163c85fd5baaf0 100644 (file)
@@ -29,22 +29,17 @@ 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
 };
 
-static const char *probe_names[] = {
-       "P1",
-       NULL,
-};
-
 /* Properly close and free all devices. */
 static int clear_instances(void)
 {
@@ -94,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;
 
@@ -110,10 +105,10 @@ static GSList *hw_scan(GSList *options)
 
        conn = NULL;
        for (l = options; l; l = l->next) {
-               opt = l->data;
-               switch (opt->hwopt) {
-               case SR_HWOPT_CONN:
-                       conn = opt->value;
+               src = l->data;
+               switch (src->key) {
+               case SR_CONF_CONN:
+                       conn = src->value;
                        break;
                }
        }
@@ -221,7 +216,6 @@ static int hw_cleanup(void)
 static int hw_info_get(int info_id, const void **data,
                const struct sr_dev_inst *sdi)
 {
-
        (void)sdi;
 
        switch (info_id) {
@@ -231,14 +225,7 @@ static int hw_info_get(int info_id, const void **data,
        case SR_DI_HWCAPS:
                *data = hwcaps;
                break;
-       case SR_DI_NUM_PROBES:
-               *data = GINT_TO_POINTER(1);
-               break;
-       case SR_DI_PROBE_NAMES:
-               *data = probe_names;
-               break;
        default:
-               sr_err("Unknown info_id: %d.", info_id);
                return SR_ERR_ARG;
        }
 
@@ -263,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);
@@ -348,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;
@@ -442,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. */