Add support for different ubus arg types

Add support for boolean and integer values in the dynamic JSON ubus args.
This commit is contained in:
Dominic Lake 2022-03-10 15:12:38 +00:00
parent 8d1fa958e7
commit 7f0ca8ccd5

View file

@ -350,7 +350,17 @@ static int fill_ubus_arguments(struct dmctx *ctx, void *data, char *instance, ch
u_args[u_args_size].key = dm_dynamic_strdup(&json_memhead, buf_key);
u_args[u_args_size].val = dm_dynamic_strdup(&json_memhead, buf_val);
switch (json_object_get_type(val)) {
case json_type_boolean:
u_args[u_args_size].type = Boolean;
break;
case json_type_int:
u_args[u_args_size].type = Integer;
break;
default:
u_args[u_args_size].type = String;
break;
}
u_args_size++;
}