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

* Re: [PATCH] Add ObjectManager interface to connman
  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
  1 sibling, 1 reply; 4+ messages in thread
From: Michael Nazzareno Trimarchi @ 2021-12-11 16:58 UTC (permalink / raw)
  To: connman, Daniel Wagner

Hi

Sorry Daniel for the signed-off. I will try to adjust my policy here

On Sat, Dec 11, 2021 at 2:50 PM Michael Trimarchi
<michael@amarulasolutions.com> wrote:
>
> 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
>


-- 
Michael Nazzareno Trimarchi
Co-Founder & Chief Executive Officer
M. +39 347 913 2170
michael@amarulasolutions.com
__________________________________

Amarula Solutions BV
Joop Geesinkweg 125, 1114 AB, Amsterdam, NL
T. +31 (0)85 111 9172
info@amarulasolutions.com
www.amarulasolutions.com

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

* Re: [PATCH] Add ObjectManager interface to connman
  2021-12-11 16:58 ` Michael Nazzareno Trimarchi
@ 2021-12-19 17:28   ` Daniel Wagner
  0 siblings, 0 replies; 4+ messages in thread
From: Daniel Wagner @ 2021-12-19 17:28 UTC (permalink / raw)
  To: Michael Nazzareno Trimarchi; +Cc: connman

Hi Michael,

On Sat, Dec 11, 2021 at 05:58:18PM +0100, Michael Nazzareno Trimarchi wrote:
> Sorry Daniel for the signed-off. I will try to adjust my policy here

No worries, was easy to fixup.

Patch applied.

Thanks,
Daniel

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

* Re: [PATCH] Add ObjectManager interface to connman
  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:29 ` Daniel Wagner
  1 sibling, 0 replies; 4+ messages in thread
From: Daniel Wagner @ 2021-12-19 17:29 UTC (permalink / raw)
  To: Michael Trimarchi, connman; +Cc: Daniel Wagner

On Sat, 11 Dec 2021 13:50:28 +0000, Michael Trimarchi wrote:
> 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();
> 
> [...]

Applied, thanks!

[1/1] Add ObjectManager interface to connman
      commit: 8122063b3ccc62563f91a2cc04899baecf0d66fd

Best regards,
-- 
Daniel Wagner <wagi@monom.org>

^ permalink raw reply	[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.