]> sigrok.org Git - libsigrok.git/blobdiff - hardware/lascar-el-usb/api.c
drivers: use new sr_config struct
[libsigrok.git] / hardware / lascar-el-usb / api.c
index 049c7b519e35286ea0505252b39577882279c839..16349fddb3e4f895e3a1efd517d2270bd30990a0 100644 (file)
@@ -40,11 +40,6 @@ static const int hwcaps[] = {
        0
 };
 
-static const char *probe_names[] = {
-       "P1",
-};
-
-
 /* 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) {
+               src = l->data;
+               switch (src->key) {
                case SR_HWOPT_CONN:
-                       conn = opt->value;
+                       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;
        }
 
@@ -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. */