X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fhardware%2Fikalogic-scanaplus%2Fapi.c;h=5075364624946c4d48563f5c6e6f2b16f540614d;hb=0af636bed97c174bea46e61e961eaa1b0b162e0f;hp=e4ebb267b5de9c302ae495530122921026da1d7d;hpb=584560f142e1b17b9f4ef9069bd3724f2f77e750;p=libsigrok.git diff --git a/src/hardware/ikalogic-scanaplus/api.c b/src/hardware/ikalogic-scanaplus/api.c index e4ebb267..50753646 100644 --- a/src/hardware/ikalogic-scanaplus/api.c +++ b/src/hardware/ikalogic-scanaplus/api.c @@ -28,12 +28,11 @@ #define SAMPLE_BUF_SIZE (8 * 1024 * 1024) -static const uint32_t hwcaps[] = { +static const uint32_t devopts[] = { SR_CONF_LOGIC_ANALYZER, - SR_CONF_SAMPLERATE, - SR_CONF_LIMIT_MSEC, - SR_CONF_LIMIT_SAMPLES, - SR_CONF_CONTINUOUS, // TODO? + SR_CONF_LIMIT_SAMPLES | SR_CONF_SET, + SR_CONF_LIMIT_MSEC | SR_CONF_SET, + SR_CONF_SAMPLERATE | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST, }; /* Channels are numbered 1-9. */ @@ -124,12 +123,10 @@ static GSList *scan(GSList *options) } /* Register the device with libsigrok. */ - sdi = sr_dev_inst_new(0, SR_ST_INITIALIZING, - USB_VENDOR_NAME, USB_MODEL_NAME, NULL); - if (!sdi) { - sr_err("Failed to create device instance."); - goto err_close_ftdic; - } + sdi = sr_dev_inst_new(); + sdi->status = SR_ST_INITIALIZING; + sdi->vendor = g_strdup(USB_VENDOR_NAME); + sdi->model = g_strdup(USB_MODEL_NAME); sdi->driver = di; sdi->priv = devc; @@ -148,7 +145,6 @@ static GSList *scan(GSList *options) return devices; -err_close_ftdic: scanaplus_close(devc); err_free_ftdic: ftdi_free(devc->ftdic); /* NOT free() or g_free()! */ @@ -347,7 +343,7 @@ static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst * switch (key) { case SR_CONF_DEVICE_OPTIONS: *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32, - hwcaps, ARRAY_SIZE(hwcaps), sizeof(uint32_t)); + devopts, ARRAY_SIZE(devopts), sizeof(uint32_t)); break; case SR_CONF_SAMPLERATE: g_variant_builder_init(&gvb, G_VARIANT_TYPE("a{sv}"));