mirror of
https://dev.iopsys.eu/bbf/bbfdm.git
synced 2025-12-10 07:44:39 +01:00
Introduce a new ubus API with timeout
This commit is contained in:
parent
4e32948acc
commit
ab5cde2c42
2 changed files with 17 additions and 0 deletions
|
|
@ -525,6 +525,22 @@ int dmubus_call_blocking(const char *obj, const char *method, struct ubus_arg u_
|
|||
return rc;
|
||||
}
|
||||
|
||||
int dmubus_call_timeout(const char *obj, const char *method, struct ubus_arg u_args[], int u_args_size, int timeout, json_object **req_res)
|
||||
{
|
||||
struct blob_buf bmsg;
|
||||
int rc;
|
||||
|
||||
memset(&bmsg, 0, sizeof(struct blob_buf));
|
||||
prepare_blob_message(&bmsg, u_args, u_args_size);
|
||||
|
||||
rc = __dm_ubus_call_internal(obj, method, timeout, bmsg.head);
|
||||
|
||||
blob_buf_free(&bmsg);
|
||||
*req_res = json_res;
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
static void receive_list_result(struct ubus_context *ctx, struct ubus_object_data *obj, void *priv)
|
||||
{
|
||||
struct blob_attr *cur = NULL;
|
||||
|
|
|
|||
|
|
@ -53,6 +53,7 @@ void dmubus_wait_for_event(const char *event, int timeout, void *ev_data, CB_FUN
|
|||
struct dmubus_ev_subtask *subtask);
|
||||
|
||||
int dmubus_call(const char *obj, const char *method, struct ubus_arg u_args[], int u_args_size, json_object **req_res);
|
||||
int dmubus_call_timeout(const char *obj, const char *method, struct ubus_arg u_args[], int u_args_size, int timeout, json_object **req_res);
|
||||
int dmubus_call_blocking(const char *obj, const char *method, struct ubus_arg u_args[], int u_args_size, json_object **req_res);
|
||||
int dmubus_call_set(const char *obj, const char *method, struct ubus_arg u_args[], int u_args_size);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue