X-Git-Url: http://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fhwdriver.c;h=dc727a5606204fa5c5260bfeba45fcf966ade296;hb=ce48b174da534120e7b725cd664743a6e9a75956;hp=454a767fcbb2dd3274bd263bebcd7960aab72aa6;hpb=ae431bc8d607ee381052eed1727f644fbc1fd89d;p=libsigrok.git diff --git a/src/hwdriver.c b/src/hwdriver.c index 454a767f..dc727a56 100644 --- a/src/hwdriver.c +++ b/src/hwdriver.c @@ -138,6 +138,14 @@ static struct sr_config_info sr_config_info_data[] = { "Over-temperature protection", NULL}, {SR_CONF_OUTPUT_REGULATION, SR_T_STRING, "output_regulation", "Output channel regulation", NULL}, + {SR_CONF_OUTPUT_FREQUENCY, SR_T_UINT64, "output_frequency", + "Output frequency", NULL}, + {SR_CONF_MEASURED_QUANTITY, SR_T_STRING, "measured_quantity", + "Measured quantity", NULL}, + {SR_CONF_MEASURED_2ND_QUANTITY, SR_T_STRING, "measured_2nd_quantity", + "Measured secondary quantity", NULL}, + {SR_CONF_EQUIV_CIRCUIT_MODEL, SR_T_STRING, "equiv_circuit_model", + "Equivalent circuit model", NULL}, {0, 0, NULL, NULL, NULL}, }; @@ -170,20 +178,25 @@ SR_PRIV int sr_variant_type_check(uint32_t key, GVariant *value) { const struct sr_config_info *info; const GVariantType *type, *expected; + char *expected_string, *type_string; + info = sr_config_info_get(key); if (!info) return SR_OK; + expected = sr_variant_type_get(info->datatype); type = g_variant_get_type(value); - if (!g_variant_type_equal(type, expected)) { - gchar *expected_string = g_variant_type_dup_string(expected); - gchar *type_string = g_variant_type_dup_string(type); + if (!g_variant_type_equal(type, expected) + && !g_variant_type_is_subtype_of(type, expected)) { + expected_string = g_variant_type_dup_string(expected); + type_string = g_variant_type_dup_string(type); sr_err("Wrong variant type for key '%s': expected '%s', got '%s'", info->name, expected_string, type_string); g_free(expected_string); g_free(type_string); return SR_ERR_ARG; } + return SR_OK; }