mic-985xx: Publish driver options.

This commit is contained in:
Uwe Hermann 2014-11-18 23:19:21 +01:00
parent 489c338884
commit d6e1e6c4e1
1 changed files with 10 additions and 4 deletions

View File

@ -25,10 +25,13 @@ static const uint32_t scanopts[] = {
SR_CONF_SERIALCOMM, SR_CONF_SERIALCOMM,
}; };
static const uint32_t devopts[] = { static const uint32_t drvopts[] = {
SR_CONF_THERMOMETER, SR_CONF_THERMOMETER,
SR_CONF_HYGROMETER, SR_CONF_HYGROMETER,
SR_CONF_CONTINUOUS, };
static const uint32_t devopts[] = {
SR_CONF_CONTINUOUS | SR_CONF_SET,
SR_CONF_LIMIT_SAMPLES | SR_CONF_SET, SR_CONF_LIMIT_SAMPLES | SR_CONF_SET,
SR_CONF_LIMIT_MSEC | SR_CONF_SET, SR_CONF_LIMIT_MSEC | SR_CONF_SET,
}; };
@ -194,7 +197,6 @@ static int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sd
static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi, static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *cg) const struct sr_channel_group *cg)
{ {
(void)sdi;
(void)cg; (void)cg;
switch (key) { switch (key) {
@ -203,7 +205,11 @@ static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst *
scanopts, ARRAY_SIZE(scanopts), sizeof(uint32_t)); scanopts, ARRAY_SIZE(scanopts), sizeof(uint32_t));
break; break;
case SR_CONF_DEVICE_OPTIONS: case SR_CONF_DEVICE_OPTIONS:
*data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32, if (!sdi)
*data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
drvopts, ARRAY_SIZE(drvopts), sizeof(uint32_t));
else
*data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
devopts, ARRAY_SIZE(devopts), sizeof(uint32_t)); devopts, ARRAY_SIZE(devopts), sizeof(uint32_t));
break; break;
default: default: