Skip to contentSkip to conversation

Add ObjectManager interface to connman

PATCH Applied Michael Trimarchi 2 participants 4 messages Dec 11, 2021 – Dec 19, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Add ObjectManager interface to connman

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;
}
---
 src/dbus.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
src/dbus.c +1 -1
index c454a581..74b3157b 100644
@@ -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)
Signature · 1 line
2.25.1
#1 lore raw

Hi

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

Quoted 44 lines · Michael Trimarchi

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;
}
---
 src/dbus.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
src/dbus.c +1 -2
index c454a581..74b3157b 100644
@@ -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

Signature · 11 lines
Michael Nazzareno Trimarchi
Co-Founder & Chief Executive Officer
M. +39 347 913 2170
[email protected]
__________________________________

Amarula Solutions BV
Joop Geesinkweg 125, 1114 AB, Amsterdam, NL
T. +31 (0)85 111 9172
[email protected]
www.amarulasolutions.com
#2 lore raw

Hi Michael,

Quoted 1 line · Michael Nazzareno Trimarchi

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

No worries, was easy to fixup.

Patch applied.

Thanks,
Daniel

#3 lore raw
In reply to Michael Trimarchi
Quoted 9 lines · Michael Trimarchi

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,

Signature · 1 line
Daniel Wagner <[email protected]>