Skip to content
Snippets Groups Projects

Add ubus object then register service

Merged Vivek Kumar Dutta requested to merge register into devel
1 file
+ 2
12
Compare changes
  • Side-by-side
  • Inline
+ 2
12
@@ -906,11 +906,6 @@ static void lookup_event_cb(struct ubus_context *ctx,
if (path && strcmp(path, UBUS_MAIN_METHOD_NAME) == 0) {
// register micro-service
register_service(ctx);
// adding ubus method for micro-service
int err = bbfdm_init(ctx);
if (err != UBUS_STATUS_OK)
uloop_end();
}
}
@@ -952,15 +947,11 @@ int main(int argc, char **argv)
uloop_init();
ubus_add_uloop(&bbfdm_ctx.ubus_ctx);
err = bbfdm_init(&bbfdm_ctx.ubus_ctx);
// micro-service registration to parent
bool is_registred = register_service(&bbfdm_ctx.ubus_ctx);
if (is_registred) {
// service is registred, so add ubus method for micro-service
err = bbfdm_init(&bbfdm_ctx.ubus_ctx);
if (err != UBUS_STATUS_OK)
goto exit;
} else {
if (is_registred == false) {
// register for add event
struct ubus_event_handler add_event;
@@ -972,7 +963,6 @@ int main(int argc, char **argv)
INFO("Waiting on uloop....");
uloop_run();
exit:
ubus_shutdown(&bbfdm_ctx.ubus_ctx);
uloop_done();
bbfdm_cleanup();
Loading