This patch exposes the TRIGGER_SOURCE and COUPLING options via config_get().
---
 hardware/hameg-hmo/api.c | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/hardware/hameg-hmo/api.c b/hardware/hameg-hmo/api.c
index bd97af8..d61a5e8 100644
--- a/hardware/hameg-hmo/api.c
+++ b/hardware/hameg-hmo/api.c
@@ -449,6 +449,27 @@ static int config_get(int key, GVariant **data, const 
struct sr_dev_inst *sdi,
                        ret = SR_ERR_NA;
                }
                break;
+       case SR_CONF_TRIGGER_SOURCE:
+               *data = 
g_variant_new_string((*model->trigger_sources)[state->trigger_source]);
+               ret = SR_OK;
+               break;
+       case SR_CONF_COUPLING:
+               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_string((*model->coupling_options)[state->analog_channels[i].coupling]);
+                               ret = SR_OK;
+                               break;
+                       }
+
+               } else {
+                       ret = SR_ERR_NA;
+               }
+               break;
        case SR_CONF_SAMPLERATE:
                *data = g_variant_new_uint64(state->sample_rate);
                ret = SR_OK;
-- 
1.8.5.3


------------------------------------------------------------------------------
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today. 
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
_______________________________________________
sigrok-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sigrok-devel

Reply via email to