X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fhardware%2Fkecheng-kc-330b%2Fapi.c;h=a4e62619600bca84ba82924612a6119e436c1b5b;hb=7dcaddd3f0df3a87dae252eb1f64f7b0e3997b8f;hp=f67d253238dc1e3dfe88f73085585d6a6d9b55ea;hpb=dd5c48a6d567a3cac62c4b0058588273bbeea171;p=libsigrok.git diff --git a/src/hardware/kecheng-kc-330b/api.c b/src/hardware/kecheng-kc-330b/api.c index f67d2532..a4e62619 100644 --- a/src/hardware/kecheng-kc-330b/api.c +++ b/src/hardware/kecheng-kc-330b/api.c @@ -112,7 +112,6 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options) (void)options; drvc = di->context; - drvc->instances = NULL; devices = NULL; if ((usb_devices = sr_usb_find(drvc->sr_ctx->libusb_ctx, USB_CONN))) { @@ -125,7 +124,6 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options) sdi->status = SR_ST_INACTIVE; sdi->vendor = g_strdup(VENDOR); sdi->model = model; /* Already g_strndup()'d. */ - sdi->driver = di; sdi->inst_type = SR_INST_USB; sdi->conn = l->data; sr_channel_new(sdi, 0, SR_CHANNEL_ANALOG, TRUE, "SPL"); @@ -143,14 +141,13 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options) /* TODO: Set date/time? */ - drvc->instances = g_slist_append(drvc->instances, sdi); devices = g_slist_append(devices, sdi); } g_slist_free(usb_devices); } else g_slist_free_full(usb_devices, g_free); - return devices; + return std_scan_complete(di, devices); } static int dev_open(struct sr_dev_inst *sdi) @@ -392,7 +389,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi) devc->num_samples = 0; - std_session_send_df_header(sdi, LOG_PREFIX); + std_session_send_df_header(sdi); if (devc->data_source == DATA_SOURCE_LIVE) { /* Force configuration. */ @@ -415,7 +412,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi) devc->stored_samples = (buf[7] << 8) | buf[8]; if (devc->stored_samples == 0) { /* Notify frontend of empty log by sending start/end packets. */ - std_session_send_df_end(sdi, LOG_PREFIX); + std_session_send_df_end(sdi); return SR_OK; }