- uint64_t *tmp_u64;
- char *stropt;
-
- /* Avoid compiler warnings. */
- device_index = device_index;
-
- if (capability == HWCAP_PROBECONFIG) {
- /* Nothing to do. */
- ret = SIGROK_OK;
- } else if (capability == HWCAP_LIMIT_SAMPLES) {
- tmp_u64 = value;
- limit_samples = *tmp_u64;
- ret = SIGROK_OK;
- } else if (capability == HWCAP_LIMIT_MSEC) {
- tmp_u64 = value;
- limit_msec = *tmp_u64;
- ret = SIGROK_OK;
- } else if (capability == HWCAP_PATTERN_MODE) {
+ const char *stropt;
+
+ (void)sdi;
+
+ if (hwcap == SR_HWCAP_PROBECONFIG) {
+ /* Nothing to do, but must be supported */
+ ret = SR_OK;
+ } else if (hwcap == SR_HWCAP_SAMPLERATE) {
+ cur_samplerate = *(const uint64_t *)value;
+ sr_dbg("demo: %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("demo: %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("demo: %s: setting limit_msec to %" PRIu64, __func__,
+ limit_msec);
+ ret = SR_OK;
+ } else if (hwcap == SR_HWCAP_PATTERN_MODE) {