blogmsg位于blob的上层,提供表格和数组等数据类型的处理,定义在blogmsg.h中。 TLV是用于表示可变长度的数据格式,Type表示数据的类型,length表示数据长度,value存储数据值。类型和长度的占用空间是固定的,在libubox库中共占用4个字节。 Value的长度由length指定。这样可以存储和传输任何类型的数据,只需预先定义服务器和客...
char *blobmsg_format_json_value_with_cb(struct blob_attr *attr, blobmsg_json_format_t cb, void *priv, int indent) { struct strbuf s; char *ret; setup_strbuf(&s, attr, cb, priv, indent); if (!s.buf) return NULL; blobmsg_format_element(&s, attr, true, false); if...
blobmsg_json_format_tcb,void*priv, intindent); staticinlinechar*blobmsg_format_json_value(structblob_attr*attr) { returnblobmsg_format_json_value_with_cb(attr,NULL,NULL,-1); } staticinlinechar*blobmsg_format_json_value_indent(structblob_attr*attr,intindent) ...