BLOBMSG_TYPE_UNSPEC, BLOBMSG_TYPE_ARRAY, BLOBMSG_TYPE_TABLE, BLOBMSG_TYPE_STRING, BLOBMSG_TYPE_INT64, BLOBMSG_TYPE_INT32, BLOBMSG_TYPE_INT16, BLOBMSG_TYPE_INT8, __BLOBMSG_TYPE_LAST, BLOBMSG_TYPE_LAST= __BLOBMSG_TYPE_LAST -1, BLOBMSG_TYPE_BOOL=BLOBMSG_TYPE_INT8, };structblobmsg_hdr { u...
blobmsg_parse如何解析多层(嵌套)BLOBMSG_TYPE_TABLE 技术标签:C语言c语言 前言,项目需求,收到JSON数据,转为blob数据,然后信息解析,用uci接口,写入uci 文件的过程。网上没有搜到 一般都是一层解析,一对一的,很简单。但是我遇到了多层解析,如下: 第一层为: mac、2.4G、5G 第二层为: enable、channel、power、...
2:BLOBMSG_TYPE_UNSPEC, 3:BLOBMSG_TYPE_ARRAY, 4:BLOBMSG_TYPE_TABLE, 5:BLOBMSG_TYPE_STRING, 6:BLOBMSG_TYPE_INT64, 7:BLOBMSG_TYPE_INT32, 8:BLOBMSG_TYPE_INT16, 9:BLOBMSG_TYPE_INT8, 10:__BLOBMSG_TYPE_LAST, 11:BLOBMSG_TYPE_LAST = __BLOBMSG_TYPE_LAST - 1, 12:BLOBMSG_TYPE_BOOL = BLOB...
switch (type) { case BLOBMSG_TYPE_INT32: int data = blobmsg_get_u32(attr); printf("Type: Integer, Data: %d\n", data); break; case BLOBMSG_TYPE_STRING: const char *data = blobmsg_get_string(attr); printf("Type: String, Data: %s\n", data); break; case BLOBMSG_TYPE_TABLE: pro...
blobmsg_close_table(b, c); break; case json_type_array: c = blobmsg_open_array(b, name); ret = blobmsg_add_array(b, json_object_get_array(obj)); blobmsg_close_array(b, c); break; case json_type_string: blobmsg_add_string(b, name, json_object_get_string(obj)); ...
1:enumblobmsg_type { 2:BLOBMSG_TYPE_UNSPEC, 3:BLOBMSG_TYPE_ARRAY, 4:BLOBMSG_TYPE_TABLE, 5:BLOBMSG_TYPE_STRING, 6:BLOBMSG_TYPE_INT64, 7:BLOBMSG_TYPE_INT32, 8:BLOBMSG_TYPE_INT16, 9:BLOBMSG_TYPE_INT8, 10:__BLOBMSG_TYPE_LAST,