nreq->complete_cb(nreq, 0, 0);
}
+static void
+ubus_notify_data_cb(struct ubus_request *req, int type, struct blob_attr *msg)
+{
+ struct ubus_notify_request *nreq;
+
+ nreq = container_of(req, struct ubus_notify_request, req);
+ if (!nreq->data_cb)
+ return;
+
+ nreq->data_cb(nreq, type, msg);
+}
+
static int
__ubus_notify_async(struct ubus_context *ctx, struct ubus_object *obj,
const char *type, struct blob_attr *msg,
req->pending = 1;
req->id[0] = obj->id;
req->req.complete_cb = ubus_notify_complete_cb;
+ req->req.data_cb = ubus_notify_data_cb;
return 0;
}
typedef void (*ubus_complete_handler_t)(struct ubus_request *req, int ret);
typedef void (*ubus_notify_complete_handler_t)(struct ubus_notify_request *req,
int idx, int ret);
+typedef void (*ubus_notify_data_handler_t)(struct ubus_notify_request *req,
+ int type, struct blob_attr *msg);
typedef void (*ubus_connect_handler_t)(struct ubus_context *ctx);
#define UBUS_OBJECT_TYPE(_name, _methods) \
ubus_notify_complete_handler_t status_cb;
ubus_notify_complete_handler_t complete_cb;
+ ubus_notify_data_handler_t data_cb;
uint32_t pending;
uint32_t id[UBUS_MAX_NOTIFY_PEERS + 1];