]> sigrok.org Git - libsigrok.git/commitdiff
hameg-hmo: Add missing cases in config_get().
authorpoljar (Damir Jelić) <redacted>
Tue, 25 Mar 2014 16:44:38 +0000 (17:44 +0100)
committerUwe Hermann <redacted>
Tue, 25 Mar 2014 19:48:58 +0000 (20:48 +0100)
hardware/hameg-hmo/api.c

index 1d3ea5abab1eb8b576d9ae8b02a1adb84ccd46ec..fb2548af524796e1a7246ef972a775b6fa4abfea 100644 (file)
@@ -231,6 +231,11 @@ static int config_get(int key, GVariant **data, const struct sr_dev_inst *sdi,
                *data = g_variant_new_int32(model->num_xdivs);
                ret = SR_OK;
                break;
+       case SR_CONF_TIMEBASE:
+               *data = g_variant_new("(tt)", (*model->timebases)[state->timebase][0],
+                                     (*model->timebases)[state->timebase][1]);
+               ret = SR_OK;
+               break;
        case SR_CONF_NUM_VDIV:
                if (pg_type == PG_NONE) {
                        sr_err("No probe group specified.");
@@ -244,6 +249,25 @@ static int config_get(int key, GVariant **data, const struct sr_dev_inst *sdi,
                                break;
                        }
 
+               } else {
+                       ret = SR_ERR_NA;
+               }
+               break;
+       case SR_CONF_VDIV:
+               if (pg_type == PG_NONE) {
+                       sr_err("No probe group specified.");
+                       return SR_ERR_PROBE_GROUP;
+               } else if (pg_type == PG_ANALOG) {
+                       for (i = 0; i < model->analog_channels; ++i) {
+                               if (probe_group != &devc->analog_groups[i])
+                                       continue;
+                               *data = g_variant_new("(tt)",
+                                                     (*model->vdivs)[state->analog_channels[i].vdiv][0],
+                                                     (*model->vdivs)[state->analog_channels[i].vdiv][1]);
+                               ret = SR_OK;
+                               break;
+                       }
+
                } else {
                        ret = SR_ERR_NA;
                }
@@ -252,6 +276,14 @@ static int config_get(int key, GVariant **data, const struct sr_dev_inst *sdi,
                *data = g_variant_new_string((*model->trigger_sources)[state->trigger_source]);
                ret = SR_OK;
                break;
+       case SR_CONF_TRIGGER_SLOPE:
+               *data = g_variant_new_string((*model->trigger_slopes)[state->trigger_slope]);
+               ret = SR_OK;
+               break;
+       case SR_CONF_HORIZ_TRIGGERPOS:
+               *data = g_variant_new_double(state->horiz_triggerpos);
+               ret = SR_OK;
+               break;
        case SR_CONF_COUPLING:
                if (pg_type == PG_NONE) {
                        sr_err("No probe group specified.");