X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=hwplugin.c;h=00ebec9c2d7a8e60206a70f7ce70f5085c039916;hb=ffedd0bf5d3abb1eae86db68e336285eddf41778;hp=1248bd773c238c4787a2c8270c0926e40a663e22;hpb=bb7ef79377ae617e1275373e0b631beb7f909d73;p=libsigrok.git diff --git a/hwplugin.c b/hwplugin.c index 1248bd77..00ebec9c 100644 --- a/hwplugin.c +++ b/hwplugin.c @@ -177,7 +177,7 @@ SR_PRIV struct sr_dev_inst *sr_dev_inst_new(int index, int status, sdi->index = index; sdi->status = status; - sdi->instance_type = -1; + sdi->inst_type = -1; sdi->vendor = vendor ? g_strdup(vendor) : NULL; sdi->model = model ? g_strdup(model) : NULL; sdi->version = version ? g_strdup(version) : NULL; @@ -270,11 +270,11 @@ SR_PRIV void sr_serial_dev_inst_free(struct sr_serial_dev_inst *serial) */ SR_API gboolean sr_hw_has_hwcap(struct sr_dev_plugin *plugin, int hwcap) { - int *capabilities, i; + int *hwcaps, i; - capabilities = plugin->get_capabilities(); - for (i = 0; capabilities[i]; i++) { - if (capabilities[i] == hwcap) + hwcaps = plugin->hwcap_get_all(); + for (i = 0; hwcaps[i]; i++) { + if (hwcaps[i] == hwcap) return TRUE; } @@ -293,8 +293,8 @@ SR_API struct sr_hwcap_option *sr_hw_hwcap_get(int hwcap) { int i; - for (i = 0; sr_hwcap_options[i].capability; i++) { - if (sr_hwcap_options[i].capability == hwcap) + for (i = 0; sr_hwcap_options[i].hwcap; i++) { + if (sr_hwcap_options[i].hwcap == hwcap) return &sr_hwcap_options[i]; }