All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Add ObjectManager interface to connman
@ 2021-12-11 13:50 Michael Trimarchi
  2021-12-11 16:58 ` Michael Nazzareno Trimarchi
  2021-12-19 17:29 ` Daniel Wagner
  0 siblings, 2 replies; 4+ messages in thread
From: Michael Trimarchi @ 2021-12-11 13:50 UTC (permalink / raw)
  To: connman, Daniel Wagner

ObjectManager let us to understand if the connman interface
is up before use it. InterfacesAdded and InterfacesRemoved
signals will then be emitted.

int main()
{
    auto connection = sdbus::createSystemBusConnection();

    auto managerProxy = std::make_unique<ManagerProxy>(*connection, "net.connman", "/");
    try {
        managerProxy->handleExistingObjects();
    }
    catch (const sdbus::Error& e) {
        if (e.getName() == "org.freedesktop.DBus.Error.ServiceUnknown") {
            std::cout << "Waiting for server to start ..." << std::endl;
        }
    }

    connection->enterEventLoop();
    return 0;
}

Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
---
 src/dbus.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/dbus.c b/src/dbus.c
index c454a581..74b3157b 100644
--- a/src/dbus.c
+++ b/src/dbus.c
@@ -687,7 +687,7 @@ int __connman_dbus_init(DBusConnection *conn)
 
 	connection = conn;
 
-	return 0;
+	return g_dbus_attach_object_manager(conn);
 }
 
 void __connman_dbus_cleanup(void)
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-12-19 17:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-12-11 13:50 [PATCH] Add ObjectManager interface to connman Michael Trimarchi
2021-12-11 16:58 ` Michael Nazzareno Trimarchi
2021-12-19 17:28   ` Daniel Wagner
2021-12-19 17:29 ` Daniel Wagner

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.