X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=pv%2Fbinding%2Fdevice.cpp;h=6f9788932c8dd0d4377d98771cee69ad6b6760e3;hb=bf9146988d2298e1750142dccdcf597ef13d6606;hp=7547a46b341b33d3f472c2fce56812fa491fbe9c;hpb=ef2986c0f3e0ce3346a28d86348d8cc1746e9b66;p=pulseview.git diff --git a/pv/binding/device.cpp b/pv/binding/device.cpp index 7547a46b..6f978893 100644 --- a/pv/binding/device.cpp +++ b/pv/binding/device.cpp @@ -56,9 +56,15 @@ namespace binding { Device::Device(shared_ptr configurable) : configurable_(configurable) { - assert(configurable); + std::map< const ConfigKey*, std::set > keys; - for (auto entry : configurable->config_keys(ConfigKey::DEVICE_OPTIONS)) { + try { + keys = configurable->config_keys(ConfigKey::DEVICE_OPTIONS); + } catch (const Error) { + return; + } + + for (auto entry : keys) { auto key = entry.first; auto capabilities = entry.second; @@ -106,6 +112,7 @@ Device::Device(shared_ptr configurable) : case SR_CONF_EXTERNAL_CLOCK: case SR_CONF_RLE: + case SR_CONF_POWER_OFF: bind_bool(name, get, set); break; @@ -121,6 +128,10 @@ Device::Device(shared_ptr configurable) : bind_enum(name, key, capabilities, get, set, print_voltage_threshold); break; + case SR_CONF_PROBE_FACTOR: + bind_int(name, "", pair(1, 500), get, set); + break; + default: break; }