Send connman mailing list submissions to
[email protected]
To subscribe or unsubscribe via the World Wide Web, visit
https://lists.01.org/mailman/listinfo/connman
or, via email, send a message with subject or body 'help' to
[email protected]
You can reach the person managing the list at
[email protected]
When replying, please edit your Subject line so it is more specific
than "Re: Contents of connman digest..."
Today's Topics:
1. [PATCHv3 1/6] wps: add new WPS API ([email protected])
2. [PATCHv3 2/6] wps: add new WPS command for connmanctl
([email protected])
----------------------------------------------------------------------
Message: 1
Date: Thu, 11 Oct 2018 16:06:00 +0000
From: <[email protected]>
To: <[email protected]>
Cc: <[email protected]>, <[email protected]>
Subject: [PATCHv3 1/6] wps: add new WPS API
Message-ID:
<[email protected]>
Content-Type: text/plain; charset="us-ascii"
Here is the summery of the patch:
* connman should conduct WPS protocol without specifying SSID/band.
* connman should save a received credential into applicable wifi
service after completing WPS protocol.
* Then connman should notify WPS success with credential saved
service list.
* After that, user selects and calls connect from service list.
* User also can retry the connection without retrying WPS even if
the connection to AP gets unstable.
Previous connman wps API conducts WPS procedure with specific wifi
service (SSID), which causes following issues in those cases:
* Multi-band Operation:
- Many APs in the market operate WPS protocol over multi-band and
the SSID is different between band A and band B.
- However, current connman WPS implementation cannot specify
the operation band.
- Therefore, wpa_supplicant might proceed with conducting WPS
procedure and connecting to SSID (AP) which is different from
connman-specified SSID (service).
- In such case, connman disconnects WPS connection and judges as
a failure.
* Multi credential delivery:
- There might be a case the AP distributes multiple credentials.
- In current implementation, the wpa_supplicant might select and
connect with the SSID which is different from specified service, too.
- connman disconnects this WPS connection and judges as a failure
* Unconfigured AP:
- The SSID and security setting would be updated after the WPS procedure.
- wpa_supplicant can connect with correct AP, but the SSID and setting
are different from specified service then connman disconnects with AP.
So, user would see such problems and since those scenarios are tested
during WPS certification testing, current connman cannot pass
the WPS certification.
Moreover, connman discards WPS credential when connman fails
the association with AP even after WPS protocol has successfully completed.
In this case, the user need retry WPS protocol, so I think WPS protocol
and connection should be separated.
Signed-off-by: n-itaya <[email protected]>
---
doc/agent-api.txt | 6 ++++++
doc/technology-api.txt | 43 ++++++++++++++++++++++++++++++++++++++++++
2 files changed, 49 insertions(+)
diff --git a/doc/agent-api.txt b/doc/agent-api.txt
index e3c1dcde..f52ed4bd 100644
--- a/doc/agent-api.txt
+++ b/doc/agent-api.txt
@@ -141,6 +141,12 @@ Fields string Name
In case of a RequestPeerAuthorization, this field will
be set as mandatory.
+ To use this in order to get connected to a given
+ services is deprecated and should not be used. Methods
+ Technology.StartStaWps and Technology.StartApWps
+ are provided by ConnMan and user should use those two
+ instead.
+
string Username
Username for WISPr authentication. This field will be
diff --git a/doc/technology-api.txt b/doc/technology-api.txt
index f22e9b29..62d2c612 100644
--- a/doc/technology-api.txt
+++ b/doc/technology-api.txt
@@ -40,6 +40,49 @@ Methods dict GetProperties() [deprecated]
via the PeersChanged signal from the manager
interface.
+ void StartApWps(string authentication)
+
+ Start a WPS Session when the system is playing AP
+ role (Tethering) in order to allow potential Ex-STAs
+ to get connected by using WPS.
+
+ The argument indicates the WPS authentication method
+ which can be an empty string, if user wants to use
+ push-button method, or a pin code if user wants to
+ use the pin method.
+
+ This method is supported only by WiFi technology.
+
+ Possible Errors: [service].Error.InvalidArguments
+ [service].Error.PermissionDenied
+ [service].Error.NotSupported
+
+ void StartStaWps(string authentication)
+
+ Start a WPS Session in STA role in order to be able
+ to get connected with an Ex-AP with WPS capabilities.
+
+ The argument indicates the WPS authentication method
+ which can be an empty string, if user wants to use
+ push-button method, or a pin code if user wants to
+ use the pin method.
+
+ This method is supported only by WiFi technology.
+
+ Possible Errors: [service].Error.InvalidArguments
+ [service].Error.OperationAborted
+ [service].Error.OperationTimeout
+ [service].Error.NotConnected
+ [service].Error.NotSupported
+
+ void CancelWps()
+
+ Cancel ongoing WPS session.
+
+ This method is supported only by WiFi technology.
+
+ Possible Errors: [service].Error.NotSupported
+
Signals PropertyChanged(string name, variant value)
This signal indicates a changed value of the given
--
2.17.1
------------------------------
Message: 2
Date: Thu, 11 Oct 2018 16:06:28 +0000
From: <[email protected]>
To: <[email protected]>
Cc: <[email protected]>, <[email protected]>
Subject: [PATCHv3 2/6] wps: add new WPS command for connmanctl
Message-ID:
<[email protected]>
Content-Type: text/plain; charset="us-ascii"
Add new WPS start/cancel command.
Add WPS success/fail event handler.
Signed-off-by: n-itaya <[email protected]>
---
client/commands.c | 126 ++++++++++++++++++++++++++++++++++++++++++
client/dbus_helpers.c | 2 +-
2 files changed, 127 insertions(+), 1 deletion(-)
diff --git a/client/commands.c b/client/commands.c
index 05b93162..07404ca8 100644
--- a/client/commands.c
+++ b/client/commands.c
@@ -639,6 +639,86 @@ static int cmd_tether(char *args[], int num, struct
connman_option *options)
return tether_set(args[1], set_tethering);
}
+static int wps_cb(DBusMessageIter *iter, const char *error,
+ void *user_data)
+{
+ bool sta = GPOINTER_TO_UINT(user_data);
+
+ if (error) {
+ fprintf(stderr, "WPS Error: %s\n", error);
+ return 1;
+ }
+
+ if (sta) {
+ fprintf(stdout, "WPS: Success\n");
+ services_list(iter, NULL, NULL);
+ } else
+ fprintf(stdout, "WPS: Started\n");
+
+ return 0;
+}
+
+static void set_wps_authentication(DBusMessageIter *iter, void *user_data)
+{
+ const char *auth = user_data;
+
+ dbus_message_iter_append_basic(iter, DBUS_TYPE_STRING, &auth);
+}
+
+static int cmd_wps_start(char *args[], int num, struct connman_option *options)
+{
+ char *auth = "";
+ char *method = "StartStaWPS";
+ bool sta = true;
+
+ if (num > 3)
+ return -E2BIG;
+
+ if (num < 3)
+ return -EINVAL;
+
+ if (g_strcmp0(args[2], "pbc") != 0)
+ auth = args[2];
+
+ if (g_strcmp0(args[1], "ap") == 0) {
+ method = "StartApWps";
+ sta = false;
+ } else if (g_strcmp0(args[1], "sta") != 0) {
+ fprintf(stdout,
+ "Incorrect mode %s. Correct options: ap or sta\n",
+ args[1]);
+ return -EINVAL;
+ }
+
+ return __connmanctl_dbus_method_call(connection, CONNMAN_SERVICE,
+ "/net/connman/technology/wifi",
+ "net.connman.Technology",
+ method, wps_cb, GUINT_TO_POINTER(sta),
+ set_wps_authentication, auth);
+}
+
+static int wps_cancel_cb(DBusMessageIter *iter, const char *error,
+ void *user_data)
+{
+ if (!error)
+ fprintf(stdout, "Ongoing WPS session cancelled\n");
+ else
+ fprintf(stdout, "WPS Error: %s\n", error);
+
+ return 0;
+}
+
+static int cmd_wps_cancel(char *args[], int num, struct connman_option
*options)
+{
+ if (num > 1)
+ return -E2BIG;
+
+ return __connmanctl_dbus_method_call(connection, CONNMAN_SERVICE,
+ "/net/connman/technology/wifi",
+ "net.connman.Technology", "CancelWps",
+ wps_cancel_cb, NULL, NULL, NULL);
+}
+
static int scan_return(DBusMessageIter *iter, const char *error,
void *user_data)
{
@@ -2332,6 +2412,46 @@ static char *lookup_tether(const char *text, int state)
return NULL;
}
+static char *lookup_wps_option(const char *text, int state, char **opt)
+{
+ static int idx;
+ static int len;
+ char *str;
+
+ if (!state) {
+ idx = 0;
+ len = strlen(text);
+ }
+
+ while (opt[idx]) {
+ str = opt[idx];
+ idx++;
+
+ if (!strncmp(text, str, len))
+ return strdup(str);
+ }
+
+ return NULL;
+}
+
+static char *lookup_wps(const char *text, int state)
+{
+ int level;
+ const char *action[] = { "ap", "sta", NULL };
+ const char *type[] = { "pbc", NULL };
+
+ level = __connmanctl_input_calc_level();
+
+ if (level == 1)
+ return lookup_wps_option(text, state, action);
+ if (level == 2)
+ return lookup_wps_option(text, state, type);
+
+ __connmanctl_input_lookup_end();
+
+ return NULL;
+}
+
static char *lookup_agent(const char *text, int state)
{
if (__connmanctl_input_calc_level() > 1) {
@@ -2736,6 +2856,12 @@ static const struct {
NULL, cmd_tether,
"Enable, disable tethering, set SSID and passphrase for wifi",
lookup_tether },
+ { "wps", "ap|sta <pbc/PIN>", NULL, cmd_wps_start,
+ "Start WPS in AP or STA mode with PBC or indicating the PIN to be
used",
+ lookup_wps },
+ { "wps_cancel", NULL, NULL, cmd_wps_cancel,
+ "Cancel ongoing WPS Session",
+ lookup_wps },
{ "services", "[<service>]", service_options, cmd_services,
"Display services", lookup_service_arg },
{ "peers", "[peer]", NULL, cmd_peers,
diff --git a/client/dbus_helpers.c b/client/dbus_helpers.c
index 6ca407d4..1a8eea16 100644
--- a/client/dbus_helpers.c
+++ b/client/dbus_helpers.c
@@ -28,7 +28,7 @@
#include "input.h"
#include "dbus_helpers.h"
-#define TIMEOUT 120000
+#define TIMEOUT 125000
void __connmanctl_dbus_print(DBusMessageIter *iter, const char *pre,
const char *dict, const char *sep)
--
2.17.1
------------------------------
Subject: Digest Footer
_______________________________________________
connman mailing list
[email protected]
https://lists.01.org/mailman/listinfo/connman
------------------------------
End of connman Digest, Vol 36, Issue 11
***************************************