]> sigrok.org Git - pulseview.git/commitdiff
Adapt to config key capabilities.
authorBert Vermeulen <redacted>
Wed, 17 Sep 2014 14:04:35 +0000 (16:04 +0200)
committerBert Vermeulen <redacted>
Wed, 17 Sep 2014 14:04:35 +0000 (16:04 +0200)
pv/dialogs/connect.cpp
pv/prop/binding/deviceoptions.cpp
pv/toolbars/samplingbar.cpp

index d554b4c181fefc9b12f56ee214e5acc839777766..1156d6f5c87b2e79993f6cea7426e8411adc51e4 100644 (file)
@@ -119,7 +119,7 @@ void Connect::populate_drivers()
                        hwopts = (const int32_t *)g_variant_get_fixed_array(gvar_opts,
                                        &num_opts, sizeof(int32_t));
                        for (unsigned int j = 0; j < num_opts; j++)
-                               if (hwopts[j] == SR_CONF_SAMPLERATE) {
+                               if ((hwopts[j] & SR_CONF_MASK) == SR_CONF_SAMPLERATE) {
                                        supported_device = true;
                                        break;
                                }
index 8811b6f3a21f73976a09a207203bd4184ad50ee0..c8da5a05f47b392d7d7577dfaf41da3b785d2239 100644 (file)
@@ -62,7 +62,7 @@ DeviceOptions::DeviceOptions(shared_ptr<pv::device::DevInst> dev_inst,
                gvar_opts, &num_opts, sizeof(int32_t));
        for (unsigned int i = 0; i < num_opts; i++) {
                const struct sr_config_info *const info =
-                       sr_config_info_get(options[i]);
+                       sr_config_info_get(options[i] & SR_CONF_MASK);
 
                if (!info)
                        continue;
index 526f382ce402e7e07979ef722e3cba498af3c0fa..c34373776ca572ca101465a2fc73bfff2ab2cf80 100644 (file)
@@ -339,13 +339,15 @@ void SamplingBar::update_device_config_widgets()
                                gvar, &num_opts, sizeof(int32_t));
                for (unsigned int i = 0; i < num_opts; i++)
                {
-                       switch (options[i]) {
+                       switch (options[i] & SR_CONF_MASK) {
                        case SR_CONF_LIMIT_SAMPLES:
-                               _sample_count_supported = true;
+                               if (options[i] & SR_CONF_SET)
+                                       _sample_count_supported = true;
                                break;
                        case SR_CONF_LIMIT_FRAMES:
-                               dev_inst->set_config(NULL, SR_CONF_LIMIT_FRAMES,
-                                       g_variant_new_uint64(1));
+                               if (options[i] & SR_CONF_SET)
+                                       dev_inst->set_config(NULL, SR_CONF_LIMIT_FRAMES,
+                                               g_variant_new_uint64(1));
                                break;
                        }
                }