-void Session::read_sample_rate(shared_ptr<sigrok::Device> device)
-{
- assert(device);
- map< const ConfigKey*, set<sigrok::Capability> > keys;
-
- try {
- keys = device->config_keys(ConfigKey::DEVICE_OPTIONS);
- } catch (const Error) {}
-
- const auto iter = keys.find(ConfigKey::SAMPLERATE);
- cur_samplerate_ = (iter != keys.end() &&
- (*iter).second.find(sigrok::GET) != (*iter).second.end()) ?
- VariantBase::cast_dynamic<Variant<guint64>>(
- device->config_get(ConfigKey::SAMPLERATE)).get() : 0;
-}
-