fprintf(stderr, "Failed to parse message data\n"); - return -1; + ret = -1; + goto error; } - return ubus_send_event(ctx, argv[0], b.head); + ret = ubus_send_event(ctx, argv[0], b.head); + +error: + blob_buf_free(&b); + return ret; } struct cli_wait_data { ...
Arrange the ubus call method and method arguments into blob_buffblob_buf_init(&b, 0);if (argc = 3 & !blobmsg_add_json_from_string(&b, argv2) if (!simple_output)fprintf(stderr, Failed to parse message datan);return -1;/M3. Look up the target object id by the object pathret =...
fprintf(stderr, "Failed to parse message data\n"); return -1; } //M3. Look up the target object id by the object path ret = ubus_lookup_id(ctx, argv[0], &id); if (ret) return ret; //M5. Invoke the method and wait for the reply //receive_call_result_datacallback will con...
Cancel Submit feedback Saved searches Use saved searches to filter your results more quickly Cancel Create saved search Sign in Sign up Reseting focus {{ message }} openwrt / ubus Public Notifications You must be signed in to change notification settings Fork 9 Star 18 ...
blobmsg_parse(&read_policy, 1, &tb, blob_data(msg), blob_len(msg)); if (tb) count = blobmsg_get_u32(tb); } // 具体业务处理 if (pipe(fds) == -1) { fprintf(stderr, "logd: failed to create pipe: %s\n", strerror(errno)); ...
Cancel Submit feedback Saved searches Use saved searches to filter your results more quickly Cancel Create saved search Sign in Sign up {{ message }} allaudet / openwrt-ubus Public Notifications Fork 2 Star 3 Code Issues Pull requests Actions Projects Security Insights ...
blobmsg_parse(zboard_policy, ZTEST_MAX, tb, blob_data(msg), blob_len(msg)); if (!tb[ZTEST_STATUS] || !tb[ZTEST_PORT]) return UBUS_STATUS_INVALID_ARGUMENT; g_wan_status = blobmsg_get_u32(tb[ZTEST_STATUS]); g_wan_port = blobmsg_get_u32(tb[ZTEST_PORT]); ...
设置消息message: root@zihome:/usr/sbin# ubus call ztest get_test{"status":0,"port":0}root@zihome:/usr/sbin# ubus call ztest set_test '{"status": 1, "port": 1}'root@zihome:/usr/sbin# ubus call ztest get_test{"status":1,"port":1} ...
ubus_data_handler_t data_cb; ubus_fd_handler_t fd_cb; ubus_complete_handler_t complete_cb;structubus_context *ctx;void*priv; };structubus_notify_request {structubus_request req; ubus_notify_complete_handler_t status_cb; ubus_notify_complete_handler_t complete_cb; ...
(struct ubus_request *req, int type, struct blob_attr *msg) ubus_lua_parse_blob_array(L, blob_data(msg), blob_len(msg), true); } +static void +ubus_lua_async_complete_cb(struct ubus_request *req, int ret) +{ + struct ubus_lua_request *lureq = container_of(req, struct ubus_...