Ejemplo n.º 1
0
/*
 * Boot module scope
 */
int
app_preload(struct app_t *app, int argc, char **argv)
{
	struct module_t *module = app->data;
	struct app_opt_t *app_opt;

	if(NULL == module)
		return E_MOD;

	app_opt = app->opts;
	log(app->ctx,1,"app preload: %s\n", module->name);

	/* Must be boot type */
	if(!GET_BIT(module->type, M_BOOT))
		return E_CONF;

	if(!GET_BIT(module->type, M_EMBED))
		log(app->ctx, 1, "Warn: app module not embedded!\n");

	app->ctx->boot->module = module;

	if(module->preload(app->ctx, app->ctx->boot))
		return E_CONF;

	/* Now register app and we are ready to go */
	if(!register_app(app->ctx, app))
		return E_CONF;

	return E_NONE;
}
Ejemplo n.º 2
0
static void proxy_added_cb(GDBusProxy *proxy, void *user_data)
{
	const char *iface;

	iface = g_dbus_proxy_get_interface(proxy);

	if (g_strcmp0(iface, GATT_MGR_IFACE))
		return;

	register_app(proxy);
}