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) <noreply@anthropic.com>
This commit is contained in:
nemunaire 2026-04-08 22:51:59 +07:00
commit a4199e15af
2 changed files with 54 additions and 1 deletions

40
e_iwd.spec Normal file
View file

@ -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 <maint@example.invalid> - 0.1.0-1
- Initial scaffolding: D-Bus core, gadcon gadget, popup, agent, config persistence.

View file

@ -2,6 +2,7 @@
#include "iwd_dbus.h"
#include "iwd_props.h"
#include "iwd_manager.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@ -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