projects
/
pulseview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Change namespace for the trace view and implement ViewBase
[pulseview.git]
/
pv
/
devices
/
device.cpp
diff --git
a/pv/devices/device.cpp
b/pv/devices/device.cpp
index 4edc1d10e11cbb3be3e1b5ae1e79760da47fc4cb..403acc4896c684d82d3ee35cf279bc2c945c700e 100644
(file)
--- a/
pv/devices/device.cpp
+++ b/
pv/devices/device.cpp
@@
-28,6
+28,7
@@
using std::map;
using std::set;
using sigrok::ConfigKey;
using std::set;
using sigrok::ConfigKey;
+using sigrok::Capability;
using sigrok::Error;
using Glib::VariantBase;
using sigrok::Error;
using Glib::VariantBase;
@@
-64,20
+65,11
@@
template<typename T>
T Device::read_config(const ConfigKey *key, const T default_value)
{
assert(key);
T Device::read_config(const ConfigKey *key, const T default_value)
{
assert(key);
- map< const ConfigKey*, set<sigrok::Capability> > keys;
if (!device_)
return default_value;
if (!device_)
return default_value;
- try {
- keys = device_->config_keys(ConfigKey::DEVICE_OPTIONS);
- } catch (const Error) {
- return default_value;
- }
-
- const auto iter = keys.find(key);
- if (iter == keys.end() ||
- (*iter).second.find(sigrok::GET) == (*iter).second.end())
+ if (!device_->config_check(key, Capability::GET))
return default_value;
return VariantBase::cast_dynamic<Glib::Variant<guint64>>(
return default_value;
return VariantBase::cast_dynamic<Glib::Variant<guint64>>(