X-Git-Url: http://git.code-monkey.de/?a=blobdiff_plain;f=pv%2Fdevinst.cpp;h=b28fce08269f4c3f238d01c8fd016e5aecb560ec;hb=0fc664a99e0d9a444e593123d1db7a47b1657366;hp=4cae04aee29a32e8f98a862c0550a98f68957535;hpb=42e634cff774d802c0fb1047f93f874aafe89277;p=pulseview.git diff --git a/pv/devinst.cpp b/pv/devinst.cpp index 4cae04a..b28fce0 100644 --- a/pv/devinst.cpp +++ b/pv/devinst.cpp @@ -93,4 +93,30 @@ GVariant* DevInst::list_config(const sr_probe_group *group, int key) return data; } +void DevInst::enable_probe(const sr_probe *probe, bool enable) +{ + for (const GSList *p = _sdi->probes; p; p = p->next) + if (probe == p->data) { + const_cast(probe)->enabled = enable; + config_changed(); + return; + } + + // Probe was not found in the device + assert(0); +} + +uint64_t DevInst::get_sample_limit() +{ + uint64_t sample_limit; + GVariant* gvar = get_config(NULL, SR_CONF_LIMIT_SAMPLES); + if (gvar != NULL) { + sample_limit = g_variant_get_uint64(gvar); + g_variant_unref(gvar); + } else { + sample_limit = 0U; + } + return sample_limit; +} + } // pv