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. Re: [Question]: Scan schedule (M?ns Zigher)
   2. RE: [PATCH] add WPS patch ([email protected])
   3. [PATCH v2 1/4] wps: add new WPS command for connmanctl
      ([email protected])


----------------------------------------------------------------------

Message: 1
Date: Fri, 31 Aug 2018 07:00:06 +0200
From: M?ns Zigher <[email protected]>
Cc: [email protected]
Subject: Re: [Question]: Scan schedule
Message-ID:
        <caehqi8kkp8pyp7m18nkfngt0qnpll6b2q9pvok467+h-fwo...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

Hi again,

According to the comments for BackgroundScanning

# Enable background scanning. Default is true.
# Background scanning will start every 5 minutes unless
# the scan list is empty. In that case, a simple backoff
# mechanism starting from 10s up to 5 minutes will run.

I would assume that connman should detect when the list is empty and
trigger a scan but what we are experiencing is that it will only trigger a
scan every 5 minute no mater if the list is empty or not. Is this how it is
intended?

BR
M?ns Zigher



Den m?n 27 aug. 2018 kl 12:51 skrev Julien Massot <
[email protected]>:

> Hi M?ns,
>
> On Mon, Aug 27, 2018 at 6:23 AM, M?ns Zigher <[email protected]>
> wrote:
> > Hi Daniel,
> >
> > Thanks for your time I appreciate it. On our target what I can see is
> that
> > if I let connman/wpa_supplicant manage the scanning I end up with an
> empty
> > list frequently which then causes my application to fail since it cannot
> > find the service to connect to. Is this is a bug or is this a situation
> that
> > my application need to take into consideration and if so the action to
> take
> > is to trigger a scan?
>
> wpa_s remove bss from the list after a delay of 180s
> (DEFAULT_BSS_EXPIRATION_AGE), defined here:
> https://w1.fi/cgit/hostap/tree/wpa_supplicant/config.h
>
> ConnMan have a delay of 300 seconds maximum between two scan, so the
> list maybe empty.
>
> Increasing the delay between two scan may reduce the bandwidth or can
> cause beacon miss.
>
> Up to your choice for your application, reducing the maximum scan time
> of the autoscan
> (used when not connected to any WiFi network) may be a good idea.
> If you want to scan more often when connected change
> the BGSCAN_DEFAULT macro to something lower than 180.
> (look at plugins/wifi.c)
>
> You can also change wpa_supplicant configuration to increase expiration
> age.
>
> If your list should be complete at some moment, like configuration purpose.
> Launch manually a scan using ConnMan dbus interface net.connman.Technology.
>
> And yeah I agree with Daniel this WiFi plugin code is terrible,
> especially about scanning.
> Can't wait to give a try to iwd, and hope this scan mess is better handled.
>
> Best Regards,
> Julien
>
> --
>
>
> *This email and any attachment thereto are confidential and intended
> solely for the use of the individual or entity to whom they are addressed.
>
> If you are not the intended recipient, please be advised that disclosing,
> copying, distributing or taking any action in reliance on the contents of
> this email is strictly prohibited. In such case, please immediately advise
> the sender, and delete all copies and attachment from your system.
> This
> email shall not be construed and is not tantamount to an offer, an
> acceptance of offer, or an agreement by SoftBank Robotics Europe on any
> discussion or contractual document whatsoever. No employee or agent is
> authorized to represent or bind SoftBank Robotics Europe to third parties
> by email, or act on behalf of SoftBank Robotics Europe by email, without
> express written confirmation by SoftBank Robotics Europe? duly authorized
> representatives.
> *
>
>
>
> *Ce message ?lectronique et ?ventuelles pi?ces
> jointes sont confidentiels, et exclusivement destin?s ? la personne ou
> l'entit? ? qui ils sont adress?s.
> Si vous n'?tes pas le destinataire vis?,
> vous ?tes pri? de ne pas divulguer, copier, distribuer ou prendre toute
> d?cision sur la foi de ce message ?lectronique. Merci d'en aviser
> imm?diatement l'exp?diteur et de supprimer toutes les copies et
> ?ventuelles
> pi?ces jointes de votre syst?me.
> Ce message ?lectronique n'?quivaut pas ?
> une offre, ? une acceptation d?offre, ou ? un accord de SoftBank Robotics
> Europe sur toute discussion ou document contractuel quel qu?il soit, et ne
> peut ?tre interpr?t? comme tel. Aucun employ? ou agent de SoftBank
> Robotics
> Europe n'est autoris? ? repr?senter ou ? engager la soci?t? par email, ou
> ?
> agir au nom et pour le compte de la soci?t? par email, sans qu?une
> confirmation ?crite soit donn?e par le repr?sentant l?gal de SoftBank
> Robotics Europe ou par toute autre personne ayant re?u d?l?gation de
> pouvoir appropri?e.
> *
>
> **
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://lists.01.org/pipermail/connman/attachments/20180831/4998ec3c/attachment-0001.html>

------------------------------

Message: 2
Date: Fri, 31 Aug 2018 11:06:14 +0000
From: <[email protected]>
To: <[email protected]>
Cc: <[email protected]>, <[email protected]>,
        <[email protected]>
Subject: RE: [PATCH] add WPS patch
Message-ID:
        <[email protected]>
Content-Type: text/plain; charset="us-ascii"

Hi Daniel,

Sorry for my late reply.

> 1) The patch adds a basic start/cancel WPS API to the technology API.
> The technology API doesn't give you any control over one device instead
> it is a global API. So that renders the WPS API proposal to a global API
> as well. So there is no additional control what device or frequency band
> what so ever.
> 
> So how does the Mulit-Band, Mutlti-Credentia "Unconfigured" and Multiple
> APs arguments fit into this proposal?
> 
> I think I get the problem about the ordering of WPS transactions. And we
> might need a global start/cancel WPS API.
> 
> It seems I miss the point for Issue 2. Can you elaborate (maybe sequence
> diagram) between the current design and the new API? I really wonder why
> we can't handle errors via the agent as well.
> 
> 2) The new proposed API seems to send D-Bus signals like PIN invalid
> etc. (documentation missing?) Generally we avoid sending global signals,
> instead we use a subscriber model (e.g. Agent API).

First, my proposed new API implementation followed the design of 
the original patch
(https://lists.01.org/pipermail/connman/2018-January/022367.html).
So that's the reason why I added the APIs to technology API and 
used global signal.

So how does the Mulit-Band, Mutlti-Credentia "Unconfigured" and
Multiple APs arguments fit into this proposal? 

To my understanding, current 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.

Here is the summery of my proposal:
* 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.

> 3) The patch contains adds code to the wifi and supplicant driver. I
> suggest you split this part of your work into separate patch series.
Thank you for your suggestion. I split my patch into gsupplicant,
wifi_plugin, connmanctl and technology part.

> 4) Please have a look at the coding style guidance and run your patch
> through checkpatch.pl There are some easy to catch formatting issues
> in your patch.
Thanks, I've run checkpatch.pl for my patch, then fixed all errors and
many warnings.

I'll send new patch series after this mail.

Regards,
n-itaya.



------------------------------

Message: 3
Date: Fri, 31 Aug 2018 11:10:00 +0000
From: <[email protected]>
To: <[email protected]>
Cc: <[email protected]>, <[email protected]>,
        <[email protected]>
Subject: [PATCH v2 1/4] 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 +-
 doc/agent-api.txt      |   6 ++
 doc/technology-api.txt |  43 ++++++++++++++
 4 files changed, 176 insertions(+), 1 deletion(-)

diff --git a/client/commands.c b/client/commands.c
index 05b93162..75a5a1de 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 = "Start_STA_WPS";
+       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 = "Start_AP_WPS";
+               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", "Cancel_WPS",
+                               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)
diff --git a/doc/agent-api.txt b/doc/agent-api.txt
index e3c1dcde..24b7f762 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.Start_STA_WPS and Technology.Start_AP_WPS
+                       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..75c1091d 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 Start_AP_WPS(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 Start_STA_WPS(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 Cancel_WPS()
+
+                       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



------------------------------

Subject: Digest Footer

_______________________________________________
connman mailing list
[email protected]
https://lists.01.org/mailman/listinfo/connman


------------------------------

End of connman Digest, Vol 34, Issue 22
***************************************

Reply via email to