Accept decoder options where the value is a floating point number. This
fixes bug #1247 (the "unsupported type" issue reported for sigrok-cli).
GSList *optl;
GVariant *gvar;
gint64 val_int;
+ double val_dbl;
int ret;
char *val_str, *conv;
break;
}
gvar = g_variant_new_int64(val_int);
+ } else if (g_variant_is_of_type(o->def, G_VARIANT_TYPE_DOUBLE)) {
+ conv = NULL;
+ val_dbl = strtod(val_str, &conv);
+ if (!conv || conv == val_str || *conv) {
+ g_critical("Protocol decoder '%s' option '%s' requires a float number.",
+ dec->name, o->id);
+ ret = FALSE;
+ break;
+ }
+ gvar = g_variant_new_double(val_dbl);
} else {
g_critical("Unsupported type for option '%s' (%s)",
o->id, g_variant_get_type_string(o->def));