Skip to contentSkip to conversation

main: Add D-Bus Daemon.GetInfo method

PATCH In review Andrew Zaborowski 2 participants 3 messages May 6, 2021 – May 7, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 main: Add D-Bus Daemon.GetInfo method

Expose the state directory/storage directory path on D-Bus because it can't be known to clients until IWD runs, and client might need to occasionally fiddle with the network config files. While there also expose the IWD version string, similar to how some other D-Bus services do.

---
 src/dbus.h |  1 +
 src/main.c | 42 ++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 43 insertions(+)
src/dbus.h +1 -0
index 4936dc6c..b3896108 100644
@@ -24,6 +24,7 @@
 
 #define IWD_SERVICE "net.connman.iwd"
 
+#define IWD_DAEMON_INTERFACE "net.connman.iwd.Daemon"
 #define IWD_AGENT_MANAGER_INTERFACE "net.connman.iwd.AgentManager"
 #define IWD_WIPHY_INTERFACE "net.connman.iwd.Adapter"
 #define IWD_DEVICE_INTERFACE "net.connman.iwd.Device"
src/main.c +42 -0

60 lines not on this page · raw message

Signature · 1 line
2.27.0
#1 lore raw

PATCH 2/2 doc: Daemon DBus interface documentation

---
 doc/daemon-api.txt | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)
 create mode 100644 doc/daemon-api.txt
doc/daemon-api.txt new file +24 -0
new file mode 100644
index 00000000..8256bb10
@@ -0,0 +1,24 @@
+Daemon hierarchy
+================
+
+Service		net.connman.iwd
+Interface	net.connman.iwd.Daemon [Experimental]
+Object path	/net/connman/iwd
+
+Methods		dict GetInfo()
+
+			Returns basic IWD daemon's status and configuration
+			properties.  Their values are global and may be useful
+			for D-Bus clients interacting with IWD, not so much
+			for the user.  The returned dictionary (a{sv}) maps
+			string keys to values of types defined per key.
+			Clients should ignore unknown keys.
+
+			The following key/value pairs are defined currently:
+
+			string Version - IWD release version,
+
+			string StateDirectory - Absolute path to the IWD
+			state directory where network configuration and
+			runtime state files are kept (see $STATE_DIRECTORY in
+			iwd(8) and iwd.network(5)).
Signature · 1 line
2.27.0
#2 lore raw
In reply to Andrew Zaborowski

Hi Andrew,

Quoted 10 lines · Andrew Zaborowski

Expose the state directory/storage directory path on D-Bus because it can't be known to clients until IWD runs, and client might need to occasionally fiddle with the network config files. While there also expose the IWD version string, similar to how some other D-Bus services do.

---
  src/dbus.h |  1 +
  src/main.c | 42 ++++++++++++++++++++++++++++++++++++++++++
  2 files changed, 43 insertions(+)

Both applied, thanks.

Regards,
-Denis