From: James Prestwood <prestwoj@gmail.com>
To: iwd@lists.01.org
Subject: [PATCH] client: add support for AP StartProfile
Date: Mon, 01 Feb 2021 09:17:17 -0800 [thread overview]
Message-ID: <20210201171717.7215-1-prestwoj@gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 1862 bytes --]
StartProfile was added to the AP interface but the required
command was never added to iwctl. This command requires a
profile exists in <configuration dir>/ap/. The syntax is as
follows:
ap <wlanX> start-profile <profile_name>
---
client/ap.c | 29 +++++++++++++++++++++++++++++
1 file changed, 29 insertions(+)
diff --git a/client/ap.c b/client/ap.c
index 81baa3fc..7130bb9a 100644
--- a/client/ap.c
+++ b/client/ap.c
@@ -235,11 +235,40 @@ static enum cmd_status cmd_show(const char *device_name, char **argv, int argc)
return CMD_STATUS_TRIGGERED;
}
+static enum cmd_status cmd_start_profile(const char *device_name,
+ char **argv, int argc)
+{
+ const struct proxy_interface *ap_i;
+
+ if (argc < 1)
+ return CMD_STATUS_INVALID_ARGS;
+
+ if (strlen(argv[0]) > 32) {
+ display("Network name cannot exceed 32 characters.\n");
+
+ return CMD_STATUS_INVALID_VALUE;
+ }
+
+ ap_i = device_proxy_find(device_name, IWD_ACCESS_POINT_INTERFACE);
+ if (!ap_i) {
+ display("No ap on device: '%s'\n", device_name);
+ return CMD_STATUS_INVALID_VALUE;
+ }
+
+ proxy_interface_method_call(ap_i, "StartProfile", "s",
+ check_errors_method_callback,
+ argv[0]);
+
+ return CMD_STATUS_TRIGGERED;
+}
+
static const struct command ap_commands[] = {
{ NULL, "list", NULL, cmd_list, "List devices in AP mode", true },
{ "<wlan>", "start", "<\"network name\"> <passphrase>", cmd_start,
"Start an access point\n\t\t\t\t\t\t called \"network "
"name\" with\n\t\t\t\t\t\t a passphrase" },
+ { "<wlan>", "start-profile", "<\"network name\">", cmd_start_profile,
+ "Start an access point based on a disk profile" },
{ "<wlan>", "stop", NULL, cmd_stop, "Stop a started access\n"
"\t\t\t\t\t\t point" },
{ "<wlan", "show", NULL, cmd_show, "Show AP info", false },
--
2.26.2
next reply other threads:[~2021-02-01 17:17 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-01 17:17 James Prestwood [this message]
2021-02-01 21:38 ` [PATCH] client: add support for AP StartProfile 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=20210201171717.7215-1-prestwoj@gmail.com \
--to=prestwoj@gmail.com \
--cc=iwd@lists.01.org \
/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