X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fhwdriver.c;h=c81a87a169d0f9e8ef52a1abba87b51c4cb5d63a;hb=efad7cccec8ab00043939b36de950ba2ced15f85;hp=8da425c848a86089ac8bb754f136f682832e8ef3;hpb=758906aa711c2936e7e9adcb449f70905087a5d9;p=libsigrok.git diff --git a/src/hwdriver.c b/src/hwdriver.c index 8da425c8..c81a87a1 100644 --- a/src/hwdriver.c +++ b/src/hwdriver.c @@ -690,6 +690,15 @@ static int check_key(const struct sr_dev_driver *driver, return SR_ERR_ARG; } break; + case SR_CONF_CAPTURE_RATIO: + /* Capture ratio must always be between 0 and 100. */ + if (op != SR_CONF_SET || !data) + break; + if (g_variant_get_uint64(data) > 100) { + sr_err("Capture ratio must be 0..100."); + return SR_ERR_ARG; + } + break; } if (sr_config_list(driver, sdi, cg, SR_CONF_DEVICE_OPTIONS, &gvar_opts) != SR_OK) {