*cur;int rem;// 调用该函数可以遍历该数组的每个成员blobmsg_for_each_attr(cur,tb[SETCONFIG_PARAMETER],rem){// 再依据策略对数组成员进行解析,可得到每个元素blobmsg_parse(parameter_policy,__MAX_PARAM,ptb,blobmsg_data(cur),blobmsg
struct ubus_request_data *req, const char *method, struct blob_attr *msg){struct blob_attr *tb[__NAME_MAX];//定义接受参数大小的数组 char* name;//定义临时变量接收传参的值 blobmsg_parse(set_name_policy, __NAME_MAX, tb, blob_data(msg), blob_len(msg));//依据set_name_policy策略解析...
}staticintmy_ubus_method_2(structubus_context *ctx,structubus_object *obj,structubus_request_data *req,constchar*method,structblob_attr *msg){/* TO DO */return0; }staticintmy_ubus_method_3(structubus_context *ctx,structubus_object *obj,structubus_request_data *req,constchar*method,struct...
static int test_notify(struct ubus_context *ctx, struct ubus_object *obj, struct ubus_request_data *req, const char *method, struct blob_attr *msg) { printf("notify handler...\n"); } static void test_handle_remove(struct ubus_context *ctx, struct ubus_subscriber *obj, uint32_t id)...
char data[UBUS_MAX_MSGLEN]; } msgbuf; /** 通信报文 */ }; struct ubus_object_data { uint32_t id; uint32_t type_id; const char *path; struct blob_attr *signature; }; struct ubus_request_data { uint32_t object; uint32_t peer; ...
struct ubus_request_data *req, const char *method, struct blob_attr *msg) { blob_buf_init(&g_bbuf, 0); blobmsg_add_u32(&g_bbuf, "status", g_wan_status); blobmsg_add_u32(&g_bbuf, "port", g_wan_port); ubus_send_reply(ctx, req, g_bbuf.head); ...
***/staticintubus_test_sub(structubus_context*ctx,structubus_object*obj,structubus_request_data*req,constchar*method,structblob_attr*msg){unsignedret=0;structblob_attr*tb[__UBUS_test_SUB_MAX];blobmsg_parse(test_sub_policy,__UBUS_test_SUB_MAX,tb,blob_data(msg),blob_len(msg));if(!tb[...
uint16_t request_seq; int stack_depth; /** 断开连接回调函数 */ void (*connection_lost)(struct ubus_context *ctx); struct { struct ubus_msghdr hdr; char data[UBUS_MAX_MSGLEN]; } msgbuf; /** 通信报文 */ }; struct ubus_object_data { ...
(structubus_context *ctx,structubus_object *obj,structubus_request_data *req,constchar*method,structblob_attr *msg){intret=0;structblob_attr*tb[__UBUS_test_PUB_MAX];char*message="", *topic;blobmsg_parse(test_pub_policy, __UBUS_test_PUB_MAX, tb,blob_data(msg),blob_len(msg));if(!
32struct ubus_request_data *req, const char *method,33struct blob_attr *msg)34 { 35int ret = -1;36void * json_list = NULL;37void * json_uri = NULL;38int idx;39 40 blob_buf_init(&b, 0);41 42struct blob_attr *tb[SCAN_POLICY_MAX];43 blobmsg_parse(scan_policy, SCAN_P...