From: Michael Trimarchi <michael@amarulasolutions.com>
To: connman@lists.linux.dev, Daniel Wagner <wagi@monom.org>
Subject: [PATCH] Add ObjectManager interface to connman
Date: Sat, 11 Dec 2021 13:50:28 +0000 [thread overview]
Message-ID: <20211211135028.11355-1-michael@amarulasolutions.com> (raw)
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
next reply other threads:[~2021-12-11 13:50 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-11 13:50 Michael Trimarchi [this message]
2021-12-11 16:58 ` [PATCH] Add ObjectManager interface to connman Michael Nazzareno Trimarchi
2021-12-19 17:28 ` Daniel Wagner
2021-12-19 17:29 ` Daniel Wagner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20211211135028.11355-1-michael@amarulasolutions.com \
--to=michael@amarulasolutions.com \
--cc=connman@lists.linux.dev \
--cc=wagi@monom.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.