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. [PATCH 0/2] Generate PropertyChanged signal on WPS changes
      and update service API documentation (Robert Tiemann)
   2. [PATCH 1/2] service: Generate PropertyChanged signal on WPS
      changes (Robert Tiemann)
   3. [PATCH 2/2] doc: Update Security values for services
      (Robert Tiemann)
   4. Re: [PATCH 0/3] Fixes and extensions for WPS support
      (Robert Tiemann)


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

Message: 1
Date: Tue, 23 Jan 2018 14:44:35 +0100
From: Robert Tiemann <[email protected]>
To: [email protected]
Subject: [PATCH 0/2] Generate PropertyChanged signal on WPS changes
        and update service API documentation
Message-ID: <[email protected]>
Content-Type: text/plain; charset=utf-8

Two more WPS patches for D-Bus client signaling and documentation.

Robert Tiemann (2):
  service: Generate PropertyChanged signal on WPS changes
  doc: Update Security values for services

 doc/service-api.txt | 11 +++++++++--
 src/service.c       | 42 ++++++++++++++++++++++++++++++++----------
 2 files changed, 41 insertions(+), 12 deletions(-)

-- 
1.9.1



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

Message: 2
Date: Tue, 23 Jan 2018 14:45:50 +0100
From: Robert Tiemann <[email protected]>
To: [email protected]
Subject: [PATCH 1/2] service: Generate PropertyChanged signal on WPS
        changes
Message-ID: <[email protected]>
Content-Type: text/plain; charset=utf-8

D-Bus clients get notified whenever a WiFi service's WPS capability or
WPS advertising state changes.
---
 src/service.c | 42 ++++++++++++++++++++++++++++++++----------
 1 file changed, 32 insertions(+), 10 deletions(-)

diff --git a/src/service.c b/src/service.c
index 9951cce..79dfd68 100644
--- a/src/service.c
+++ b/src/service.c
@@ -1674,6 +1674,19 @@ static void append_security(DBusMessageIter *iter, void 
*user_data)
        }
 }
 
+static void security_changed(struct connman_service *service)
+{
+       if (!service->path)
+               return;
+
+       if (!allow_property_changed(service))
+               return;
+
+       connman_dbus_property_changed_array(service->path,
+                               CONNMAN_SERVICE_INTERFACE, "Security",
+                               DBUS_TYPE_STRING, append_security, service);
+}
+
 static void append_ethernet(DBusMessageIter *iter, void *user_data)
 {
        struct connman_service *service = user_data;
@@ -6991,6 +7004,21 @@ static enum connman_service_security 
convert_wifi_security(const char *security)
                return CONNMAN_SERVICE_SECURITY_UNKNOWN;
 }
 
+static void update_wps_values(struct connman_service *service,
+                               struct connman_network *network)
+{
+       bool wps = connman_network_get_bool(network, "WiFi.WPS");
+       bool wps_advertising = connman_network_get_bool(network,
+                                                       "WiFi.WPSAdvertising");
+
+       if (service->wps != wps ||
+                       service->wps_advertizing != wps_advertising) {
+               service->wps = wps;
+               service->wps_advertizing = wps_advertising;
+               security_changed(service);
+       }
+}
+
 static void update_from_network(struct connman_service *service,
                                        struct connman_network *network)
 {
@@ -7030,11 +7058,8 @@ static void update_from_network(struct connman_service 
*service,
        str = connman_network_get_string(network, "WiFi.Security");
        service->security = convert_wifi_security(str);
 
-       if (service->type == CONNMAN_SERVICE_TYPE_WIFI) {
-               service->wps = connman_network_get_bool(network, "WiFi.WPS");
-               service->wps_advertizing = connman_network_get_bool(network,
-                                                       "WiFi.WPSAdvertising");
-       }
+       if (service->type == CONNMAN_SERVICE_TYPE_WIFI)
+               update_wps_values(service, network);
 
        if (service->strength > strength && service->network) {
                connman_network_unref(service->network);
@@ -7202,11 +7227,8 @@ void __connman_service_update_from_network(struct 
connman_network *network)
                                        DBUS_TYPE_STRING, &service->name);
        }
 
-       if (service->type == CONNMAN_SERVICE_TYPE_WIFI) {
-               service->wps = connman_network_get_bool(network, "WiFi.WPS");
-               service->wps_advertizing = connman_network_get_bool(network,
-                                                       "WiFi.WPSAdvertising");
-       }
+       if (service->type == CONNMAN_SERVICE_TYPE_WIFI)
+               update_wps_values(service, network);
 
        strength = connman_network_get_strength(service->network);
        if (strength == service->strength)
-- 
1.9.1



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

Message: 3
Date: Tue, 23 Jan 2018 14:46:38 +0100
From: Robert Tiemann <[email protected]>
To: [email protected]
Subject: [PATCH 2/2] doc: Update Security values for services
Message-ID: <[email protected]>
Content-Type: text/plain; charset=utf-8

---
 doc/service-api.txt | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/doc/service-api.txt b/doc/service-api.txt
index b5b4fab..4026e7e 100644
--- a/doc/service-api.txt
+++ b/doc/service-api.txt
@@ -187,8 +187,15 @@ Properties string State [readonly]
                        present and contains the list of security methods
                        or key management settings.
 
-                       Possible values are "none", "wep", "psk", "ieee8021x"
-                       and also "wps".
+                       Possible values are "none", "wep", "psk", "ieee8021x",
+                       and also "wps" and "wps_advertising".
+
+                       Value "wps" means that the service supports WPS. A
+                       service advertising itself as WPS registrar contains
+                       the additional value "wps_advertising" for as long as
+                       it is advertising. That is, while "wps_advertising" is
+                       listed, WPS is active and it should be possible to
+                       connect to the corresponding service via WPS.
 
                        This property might be only present for WiFi
                        services.
-- 
1.9.1



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

Message: 4
Date: Tue, 23 Jan 2018 15:02:13 +0100
From: Robert Tiemann <[email protected]>
To: Jose Blanquicet <[email protected]>
Cc: [email protected], Daniel Wagner <[email protected]>
Subject: Re: [PATCH 0/3] Fixes and extensions for WPS support
Message-ID: <[email protected]>
Content-Type: text/plain; charset=utf-8

On 01/21/2018 05:50 PM, Jose Blanquicet wrote:
>> My current client code constantly scans
>> for WLANs and reads out all data of all services on _any_ change
>> reported. Not very efficient, but it turned out to be the most
>> reliable way to keep up with changes.
> 
> I would say that avoid doing that is exactly the reason why signals are used 
> :)

I know, earlier versions of my client relied on signals, and I'd
prefer it this way.

It turned out, however, that some information were missing from the
signals. That is, I have often received a set of changes by signal,
but when reading out all services and checking for changes manually,
I've found more changes that were never reported by signal.

This was with ConnMan v1.33, about one year ago. I don't remember
which properties were missing from the signals, but I had trouble
getting my client going when relying only on D-Bus signals. The
steamroller approach of reading out everything on any signal fixed
this for me...

Maybe things have changed in later ConnMan versions.

>> Shall I prepare two patches (one for the signal, one for the docs)?
> 
> Yes, please divide it into two patches.

Done.

> Thanks,
> 
> Jose

Regards,
Robert


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

Subject: Digest Footer

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


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

End of connman Digest, Vol 27, Issue 19
***************************************

Reply via email to