- (void)sdi;
-
- if (hwcap == SR_HWCAP_SAMPLERATE) {
- cur_samplerate = *(const uint64_t *)value;
- sr_dbg("%s: setting samplerate to %" PRIu64, __func__,
- cur_samplerate);
- ret = SR_OK;
- } else if (hwcap == SR_HWCAP_LIMIT_SAMPLES) {
- limit_msec = 0;
- limit_samples = *(const uint64_t *)value;
- sr_dbg("%s: setting limit_samples to %" PRIu64, __func__,
- limit_samples);
- ret = SR_OK;
- } else if (hwcap == SR_HWCAP_LIMIT_MSEC) {
- limit_msec = *(const uint64_t *)value;
- limit_samples = 0;
- sr_dbg("%s: setting limit_msec to %" PRIu64, __func__,
- limit_msec);
- ret = SR_OK;
- } else if (hwcap == SR_HWCAP_PATTERN_MODE) {
- stropt = value;
- ret = SR_OK;
- if (!strcmp(stropt, "sigrok")) {
- default_pattern = PATTERN_SIGROK;
- } else if (!strcmp(stropt, "random")) {
- default_pattern = PATTERN_RANDOM;
- } else if (!strcmp(stropt, "incremental")) {
- default_pattern = PATTERN_INC;
- } else if (!strcmp(stropt, "all-low")) {
- default_pattern = PATTERN_ALL_LOW;
- } else if (!strcmp(stropt, "all-high")) {
- default_pattern = PATTERN_ALL_HIGH;
- } else {
- ret = SR_ERR;
- }
- sr_dbg("%s: setting pattern to %d", __func__, default_pattern);
- } else {
- ret = SR_ERR;
- }
-
- return ret;
-}
-
-static void samples_generator(uint8_t *buf, uint64_t size, void *data)
-{
- static uint64_t p = 0;
- struct dev_context *devc = data;
- uint64_t i;