commit 8102b33634da0b9e9a600fd5a85de7c02fce22a1
parent 5011637df2d08f4a7984bdf7d26188272df32762
Author: Denis Kenzior <denkenz@gmail.com>
Date: Tue, 7 Aug 2018 17:08:06 -0500
wiphy: Support Adapter.SupportedModes property
Diffstat:
1 file changed, 23 insertions(+), 0 deletions(-)
diff --git a/src/wiphy.c b/src/wiphy.c
@@ -905,6 +905,26 @@ static bool wiphy_property_get_name(struct l_dbus *dbus,
return true;
}
+static bool wiphy_property_get_supported_modes(struct l_dbus *dbus,
+ struct l_dbus_message *message,
+ struct l_dbus_message_builder *builder,
+ void *user_data)
+{
+ struct wiphy *wiphy = user_data;
+ unsigned int j = 0;
+ char **iftypes = wiphy_get_supported_iftypes(wiphy);
+
+ l_dbus_message_builder_enter_array(builder, "s");
+
+ while (iftypes[j])
+ l_dbus_message_builder_append_basic(builder, 's', iftypes[j++]);
+
+ l_dbus_message_builder_leave_array(builder);
+ l_strfreev(iftypes);
+
+ return true;
+}
+
static void setup_wiphy_interface(struct l_dbus_interface *interface)
{
l_dbus_interface_property(interface, "Powered", 0, "b",
@@ -916,6 +936,9 @@ static void setup_wiphy_interface(struct l_dbus_interface *interface)
wiphy_property_get_vendor, NULL);
l_dbus_interface_property(interface, "Name", 0, "s",
wiphy_property_get_name, NULL);
+ l_dbus_interface_property(interface, "SupportedModes", 0, "as",
+ wiphy_property_get_supported_modes,
+ NULL);
}
bool wiphy_init(struct l_genl_family *in, const char *whitelist,