#include <stdio.h>
+#include <inttypes.h>
#include "blobmsg.h"
#include "blobmsg_json.h"
int type = blobmsg_type(data);
switch(type) {
case BLOBMSG_TYPE_STRING:
- indent_printf(indent, "%s\n", blobmsg_data(data));
+ indent_printf(indent, "%s\n", blobmsg_get_string(data));
break;
case BLOBMSG_TYPE_INT8:
indent_printf(indent, "%d\n", blobmsg_get_u8(data));
case BLOBMSG_TYPE_INT64:
indent_printf(indent, "%"PRIu64"\n", blobmsg_get_u64(data));
break;
+ case BLOBMSG_TYPE_DOUBLE:
+ indent_printf(indent, "%lf\n", blobmsg_get_double(data));
+ break;
case BLOBMSG_TYPE_TABLE:
case BLOBMSG_TYPE_ARRAY:
if (!indent)
blobmsg_add_string(buf, "message", "Hello, world!");
tbl = blobmsg_open_table(buf, "testdata");
+ blobmsg_add_double(buf, "double", 1.337e2);
blobmsg_add_u32(buf, "hello", 1);
blobmsg_add_string(buf, "world", "2");
blobmsg_close_table(buf, tbl);
blobmsg_add_u32(buf, NULL, 0);
blobmsg_add_u32(buf, NULL, 1);
blobmsg_add_u32(buf, NULL, 2);
+ blobmsg_add_double(buf, "double", 1.337e2);
blobmsg_close_table(buf, tbl);
}