From a4199e15af27fc0913586280962e432028bc9699 Mon Sep 17 00:00:00 2001 From: Pierre-Olivier Mercier Date: Wed, 8 Apr 2026 22:51:59 +0700 Subject: [PATCH] Phase 5/6: log Connect failures + RPM spec Network.Connect now uses an async reply callback so polkit / authentication / iwd-side errors land on stderr instead of being swallowed. Add a minimal RPM spec for packaging. Co-Authored-By: Claude Opus 4.6 (1M context) --- e_iwd.spec | 40 ++++++++++++++++++++++++++++++++++++++++ src/iwd/iwd_network.c | 15 ++++++++++++++- 2 files changed, 54 insertions(+), 1 deletion(-) create mode 100644 e_iwd.spec diff --git a/e_iwd.spec b/e_iwd.spec new file mode 100644 index 0000000..877888c --- /dev/null +++ b/e_iwd.spec @@ -0,0 +1,40 @@ +Name: e_iwd +Version: 0.1.0 +Release: 1%{?dist} +Summary: Enlightenment Wi-Fi module backed by iwd +License: GPL-2.0-or-later +URL: https://example.invalid/e_iwd +Source0: %{name}-%{version}.tar.xz + +BuildRequires: meson +BuildRequires: gcc +BuildRequires: pkgconfig(eldbus) +BuildRequires: pkgconfig(elementary) +BuildRequires: pkgconfig(enlightenment) + +Requires: enlightenment +Requires: iwd + +%description +Enlightenment shelf module that manages Wi-Fi connections by talking to +the iwd (Intel Wireless Daemon) D-Bus API directly. Replaces the +ConnMan-based econnman gadget. + +%prep +%autosetup + +%build +%meson +%meson_build + +%install +%meson_install + +%files +%license COPYING +%doc README.md +%{_libdir}/enlightenment/modules/iwd/ + +%changelog +* Wed Apr 08 2026 Maintainer - 0.1.0-1 +- Initial scaffolding: D-Bus core, gadcon gadget, popup, agent, config persistence. diff --git a/src/iwd/iwd_network.c b/src/iwd/iwd_network.c index d46056d..4d38f0d 100644 --- a/src/iwd/iwd_network.c +++ b/src/iwd/iwd_network.c @@ -2,6 +2,7 @@ #include "iwd_dbus.h" #include "iwd_props.h" #include "iwd_manager.h" +#include #include #include @@ -79,13 +80,25 @@ iwd_network_free(Iwd_Network *n) free(n); } +static void +_on_connect_reply(void *data, const Eldbus_Message *msg, Eldbus_Pending *p EINA_UNUSED) +{ + const char *en, *em; + const char *ssid = data; + if (eldbus_message_error_get(msg, &en, &em)) + fprintf(stderr, "e_iwd: connect to '%s' failed: %s: %s\n", + ssid ? ssid : "?", en, em); + free(data); +} + void iwd_network_connect(Iwd_Network *n) { if (!n || !n->proxy) return; /* Network.Connect() takes no args; iwd will dial the registered Agent * for a passphrase if needed. */ - eldbus_proxy_call(n->proxy, "Connect", NULL, NULL, -1, ""); + eldbus_proxy_call(n->proxy, "Connect", _on_connect_reply, + n->ssid ? strdup(n->ssid) : NULL, -1, ""); } void