From: Bert Vermeulen Date: Sat, 15 Jan 2011 04:11:40 +0000 (+0100) Subject: add new HWCAP patternmode X-Git-Tag: libsigrok-0.1.0~439 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=925dbf9f97c18628ead7cb5a93f95052b48ca0e4;p=libsigrok.git add new HWCAP patternmode --- diff --git a/hwplugin.c b/hwplugin.c index bbecaef1..1ba4dbb0 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}, }; @@ -105,9 +106,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; diff --git a/sigrok.h b/sigrok.h index 9a22cb0e..1b4552ca 100644 --- a/sigrok.h +++ b/sigrok.h @@ -213,10 +213,16 @@ extern GSList *devices; /* Hardware plugin capabilities */ enum { HWCAP_DUMMY, /* Used to terminate lists */ + /* device classes */ HWCAP_LOGIC_ANALYZER, + + /* device options */ HWCAP_SAMPLERATE, /* Change samplerate */ HWCAP_PROBECONFIG, /* Configure probe mask */ HWCAP_CAPTURE_RATIO, /* Set pre/post-trigger capture ratio */ + HWCAP_PATTERN_MODE, /* Pattern generator mode */ + + /* acquisition modes */ HWCAP_LIMIT_MSEC, /* Set a time limit for sample acquisition */ HWCAP_LIMIT_SAMPLES, /* Set a limit on number of samples */ HWCAP_CONTINUOUS, @@ -289,6 +295,8 @@ enum { DI_TRIGGER_TYPES, /* The currently set samplerate in Hz (uint64_t) */ DI_CUR_SAMPLERATE, + /* Supported pattern generator modes */ + DI_PATTERNMODES, }; /*