Blobmsg: Appropriate way for sending arrays?

Hi,
how do you send arrays with blobmsg in most appropriate way?

I tried this for an int array:

r = blobmsg_open_array(&b, "rates");
for(int i = 0; i < hapd->iface->hw_features->num_rates; i++)
{
	blobmsg_add_u32(&b, NULL, hapd->iface->hw_features->rates[i]);
}
blobmsg_close_array(&b, r);

Looks not good? :confused:

So, this is the way to generate arrays.
And the output looks ok.
The ubus command formats blobmsg as JSON, when you get data from a ubus call.

1 Like