gsupplicant notifies the wifi plugin relevantly when such information
has changed, thus it's only a matter for the wifi plugin to update the
peer accordingly.
---
plugins/wifi.c | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/plugins/wifi.c b/plugins/wifi.c
index 8fde1e3..cd6316b 100644
--- a/plugins/wifi.c
+++ b/plugins/wifi.c
@@ -2625,6 +2625,23 @@ static void network_changed(GSupplicantNetwork *network,
const char *property)
}
}
+static void apply_peer_services(GSupplicantPeer *peer,
+ struct connman_peer *connman_peer)
+{
+ const unsigned char *data;
+ int length;
+
+ DBG("");
+
+ connman_peer_reset_services(connman_peer);
+
+ data = g_supplicant_peer_get_widi_ies(peer, &length);
+ if (data) {
+ connman_peer_add_service(connman_peer,
+ CONNMAN_PEER_SERVICE_WIFI_DISPLAY, data, length);
+ }
+}
+
static void peer_found(GSupplicantPeer *peer)
{
GSupplicantInterface *iface = g_supplicant_peer_get_interface(peer);
@@ -2645,6 +2662,7 @@ static void peer_found(GSupplicantPeer *peer)
connman_peer = connman_peer_create(identifier);
connman_peer_set_name(connman_peer, name);
connman_peer_set_device(connman_peer, wifi->device);
+ apply_peer_services(peer, connman_peer);
ret = connman_peer_register(connman_peer);
if (ret < 0 && ret != -EALREADY)
@@ -2696,6 +2714,8 @@ static void peer_changed(GSupplicantPeer *peer,
GSupplicantPeerState state)
switch (state) {
case G_SUPPLICANT_PEER_SERVICES_CHANGED:
+ apply_peer_services(peer, connman_peer);
+ connman_peer_services_changed(connman_peer);
return;
case G_SUPPLICANT_PEER_GROUP_CHANGED:
if (!g_supplicant_peer_is_in_a_group(peer))
--
1.8.5.5
_______________________________________________
connman mailing list
[email protected]
https://lists.connman.net/mailman/listinfo/connman