X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=hwplugin.c;h=0a30aad0016263f5ecc0012ba6f0f7fb6c731ccd;hb=32c0551ba66452acc24c9dc163ade3a637b1c7f2;hp=bbecaef12270daa4553f84c0477facb5cb5758cb;hpb=17e1afcb81b8581091fcb660c2e61f05c75e00b5;p=libsigrok.git diff --git a/hwplugin.c b/hwplugin.c index bbecaef1..0a30aad0 100644 --- a/hwplugin.c +++ b/hwplugin.c @@ -39,6 +39,7 @@ GSList *plugins; struct hwcap_option hwcap_options[] = { {HWCAP_SAMPLERATE, T_UINT64, "Sample rate", "samplerate"}, {HWCAP_CAPTURE_RATIO, T_UINT64, "Pre-trigger capture ratio", "captureratio"}, + {HWCAP_PATTERN_MODE, T_CHAR, "Pattern generator mode", "patternmode"}, {0, 0, NULL, NULL}, }; @@ -61,7 +62,6 @@ extern struct device_plugin asix_sigma_plugin_info; extern struct device_plugin link_mso19_plugin_info; #endif - /* TODO: No linked list needed, this can be a simple array. */ int load_hwplugins(void) { @@ -105,9 +105,9 @@ struct sigrok_device_instance *sigrok_device_instance_new(int index, int status, sdi->index = index; sdi->status = status; sdi->instance_type = -1; - sdi->vendor = strdup(vendor); - sdi->model = strdup(model); - sdi->version = strdup(version); + sdi->vendor = vendor ? strdup(vendor) : strdup("(unknown)"); + sdi->model = model ? strdup(model) : NULL; + sdi->version = version ? strdup(version) : NULL; sdi->priv = NULL; sdi->usb = NULL;