From ccf146182522391d6506dcb3944d305e8906101c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?poljar=20=28Damir=20Jeli=C4=87=29?= Date: Thu, 16 Jan 2014 15:28:58 +0100 Subject: [PATCH] hameg-hmo: Expose more options with config_get(). 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 bd97af88..d61a5e87 100644 --- a/hardware/hameg-hmo/api.c +++ b/hardware/hameg-hmo/api.c @@ -445,6 +445,27 @@ static int config_get(int key, GVariant **data, const struct sr_dev_inst *sdi, break; } + } else { + 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; }