eiwd

no dbus iwd with iwctl functionality
git clone https://git.daat.foo/repos/eiwd.git
Log | Files | Refs | Submodules | README | LICENSE

commit 4f1c661273a9994524acb8ed7d265713030be146
parent be5e955e65f1a51ad42a6dc4967395958e92a2b8
Author: Tim Kourt <tim.a.kourt@linux.intel.com>
Date:   Fri,  8 Nov 2019 11:32:23 -0800

client: Fail in non-interactive mode if iwd service isn’t running

In non-interactive mode request the managed object right away and do
not wait for the service to appear. This way client can fail right
away instead of endlessly waiting in non-interactive mode.

Diffstat:
Mclient/dbus-proxy.c | 26++++++++++++++++----------
1 file changed, 16 insertions(+), 10 deletions(-)

diff --git a/client/dbus-proxy.c b/client/dbus-proxy.c @@ -740,11 +740,17 @@ no_agent: display_enable_cmd_prompt(); } -static void service_appeared_callback(struct l_dbus *dbus, void *user_data) +static void get_managed_objects(void) { - if (!command_is_interactive_mode()) - goto get_objects; + l_dbus_method_call(dbus, IWD_SERVICE, IWD_ROOT_PATH, + L_DBUS_INTERFACE_OBJECT_MANAGER, + "GetManagedObjects", NULL, + get_managed_objects_callback, + NULL, NULL); +} +static void service_appeared_callback(struct l_dbus *dbus, void *user_data) +{ l_dbus_add_signal_watch(dbus, IWD_SERVICE, IWD_ROOT_PATH, L_DBUS_INTERFACE_OBJECT_MANAGER, "InterfacesAdded", L_DBUS_MATCH_NONE, @@ -759,12 +765,8 @@ static void service_appeared_callback(struct l_dbus *dbus, void *user_data) L_DBUS_INTERFACE_PROPERTIES, "PropertiesChanged", L_DBUS_MATCH_NONE, properties_changed_callback, NULL); -get_objects: - l_dbus_method_call(dbus, IWD_SERVICE, IWD_ROOT_PATH, - L_DBUS_INTERFACE_OBJECT_MANAGER, - "GetManagedObjects", NULL, - get_managed_objects_callback, - NULL, NULL); + + get_managed_objects(); } static void service_disappeared_callback(struct l_dbus *dbus, @@ -834,9 +836,13 @@ bool dbus_proxy_init(void) l_dbus_set_disconnect_handler(dbus, dbus_disconnect_callback, NULL, NULL); - l_dbus_add_service_watch(dbus, IWD_SERVICE, service_appeared_callback, + if (command_is_interactive_mode()) + l_dbus_add_service_watch(dbus, IWD_SERVICE, + service_appeared_callback, service_disappeared_callback, NULL, NULL); + else + get_managed_objects(); return true; }