public inbox for iwd@lists.linux.dev
 help / color / mirror / Atom feed
From: James Prestwood <prestwoj@gmail.com>
To: iwd@lists.linux.dev
Cc: James Prestwood <prestwoj@gmail.com>
Subject: [PATCH v3 04/13] network: add ExtendedServiceSet DBus property
Date: Mon, 12 Aug 2024 08:46:04 -0700	[thread overview]
Message-ID: <20240812154613.126522-4-prestwoj@gmail.com> (raw)
In-Reply-To: <20240812154613.126522-1-prestwoj@gmail.com>

This contains a list of all BasicServiceSet objects (paths) that
exist for a network.
---
 src/network.c | 31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)

diff --git a/src/network.c b/src/network.c
index 8c16d9a6..76238e56 100644
--- a/src/network.c
+++ b/src/network.c
@@ -1149,6 +1149,9 @@ static bool network_unregister_bss(void *a, void *user_data)
 	l_dbus_unregister_object(dbus_get_bus(),
 					network_bss_get_path(network, bss));
 
+	l_dbus_property_changed(dbus_get_bus(), network->object_path,
+				IWD_NETWORK_INTERFACE, "ExtendedServiceSet");
+
 	return true;
 }
 
@@ -1174,6 +1177,9 @@ static bool network_register_bss(struct network *network, struct scan_bss *bss)
 					L_DBUS_INTERFACE_PROPERTIES, bss))
 		return false;
 
+	l_dbus_property_changed(dbus_get_bus(), network->object_path,
+				IWD_NETWORK_INTERFACE, "ExtendedServiceSet");
+
 	return true;
 }
 
@@ -1960,6 +1966,28 @@ static bool network_property_get_known_network(struct l_dbus *dbus,
 	return true;
 }
 
+static bool network_property_get_extended_service_set(struct l_dbus *dbus,
+					struct l_dbus_message *message,
+					struct l_dbus_message_builder *builder,
+					void *user_data)
+{
+	struct network *network = user_data;
+	const struct l_queue_entry *e;
+
+	l_dbus_message_builder_enter_array(builder, "o");
+
+	for (e = l_queue_get_entries(network->bss_list); e; e = e->next) {
+		struct scan_bss *bss = e->data;
+		const char *path = network_bss_get_path(network, bss);
+
+		l_dbus_message_builder_append_basic(builder, 'o', path);
+	}
+
+	l_dbus_message_builder_leave_array(builder);
+
+	return true;
+}
+
 bool network_register(struct network *network, const char *path)
 {
 	if (!l_dbus_object_add_interface(dbus_get_bus(), path,
@@ -2259,6 +2287,9 @@ static void setup_network_interface(struct l_dbus_interface *interface)
 
 	l_dbus_interface_property(interface, "KnownNetwork", 0, "o",
 				network_property_get_known_network, NULL);
+
+	l_dbus_interface_property(interface, "ExtendedServiceSet", 0, "ao",
+				network_property_get_extended_service_set, NULL);
 }
 
 static bool network_bss_property_get_address(struct l_dbus *dbus,
-- 
2.34.1


  parent reply	other threads:[~2024-08-12 15:46 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-12 15:46 [PATCH v3 01/13] dbus: Add net.connman.iwd.BasicServiceSet interface James Prestwood
2024-08-12 15:46 ` [PATCH v3 02/13] network: Add BasicServiceSet object James Prestwood
2024-08-12 15:46 ` [PATCH v3 03/13] station: use network_bss_{start,stop}_update James Prestwood
2024-08-12 15:46 ` James Prestwood [this message]
2024-08-12 15:46 ` [PATCH v3 05/13] network: remove network_bss_list_clear James Prestwood
2024-08-12 15:46 ` [PATCH v3 06/13] station: add ConnectedAccessPoint property James Prestwood
2024-08-12 15:46 ` [PATCH v3 07/13] doc: document BasicServiceSet API James Prestwood
2024-08-12 15:46 ` [PATCH v3 08/13] client: separate property header and values into two functions James Prestwood
2024-08-12 15:46 ` [PATCH v3 09/13] client: add net.connman.iwd.BasicServiceSet definition James Prestwood
2024-08-12 15:46 ` [PATCH v3 10/13] client: Add BasicServiceSets property to network James Prestwood
2024-08-12 15:46 ` [PATCH v3 11/13] client: add BasicServiceSet interface James Prestwood
2024-08-12 15:46 ` [PATCH v3 12/13] client: refactor cmd_connect() and add find_network() James Prestwood
2024-08-12 15:46 ` [PATCH v3 13/13] client: add station command "get-bsses" James Prestwood
2024-08-12 17:11 ` [PATCH v3 01/13] dbus: Add net.connman.iwd.BasicServiceSet interface Denis Kenzior

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240812154613.126522-4-prestwoj@gmail.com \
    --to=prestwoj@gmail.com \
    --cc=iwd@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox