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 v2] peer: Update Connected Propererty of P2P
      Technology (Jose Blanquicet)


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

Message: 1
Date: Thu, 19 May 2016 17:09:56 +0200
From: Jose Blanquicet <[email protected]>
To: [email protected]
Subject: [PATCH v2] peer: Update Connected Propererty of P2P
        Technology
Message-ID: <[email protected]>

Currently the property Connected is not used for P2P Technology thus it 
always remains False. This patch aims to keep it updated in order to 
make easier for the UI to show if P2P technology has an active P2P 
connection or not.

This implementation has a limitation in cases of complex systems where 
multiple P2P interfaces are present and can be connected simultaneously, 
it is because the disconnection of one of those interfaces will cause 
that the property becomes False even if there is another interface still 
connected. But let say that such a complex systems are not very common.

---
 doc/technology-api.txt | 3 +++
 src/peer.c             | 3 ++-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/doc/technology-api.txt b/doc/technology-api.txt
index f3703c0..f22e9b2 100644
--- a/doc/technology-api.txt
+++ b/doc/technology-api.txt
@@ -63,6 +63,9 @@ Properties    boolean Powered [readwrite]
                        If this property is True it means that at least one
                        service of this technology is in ready state.
 
+                       In case of P2P technology, this property indicates
+                       if the peer is fully connected to another peer.
+
                string Name [readonly]
 
                        Name of this technology.
diff --git a/src/peer.c b/src/peer.c
index 8a380c9..ad4e445 100644
--- a/src/peer.c
+++ b/src/peer.c
@@ -905,6 +905,7 @@ int connman_peer_set_state(struct connman_peer *peer,
                break;
        case CONNMAN_PEER_STATE_READY:
                reply_pending(peer, 0);
+               __connman_technology_set_connected(CONNMAN_SERVICE_TYPE_P2P, 
true);
                break;
        case CONNMAN_PEER_STATE_DISCONNECT:
                if (peer->connection_master)
@@ -913,7 +914,7 @@ int connman_peer_set_state(struct connman_peer *peer,
                        __connman_dhcp_stop(peer->ipconfig);
                peer->connection_master = false;
                peer->sub_device = NULL;
-
+               __connman_technology_set_connected(CONNMAN_SERVICE_TYPE_P2P, 
false);
                break;
        case CONNMAN_PEER_STATE_FAILURE:
                if (manage_peer_error(peer) == 0)
-- 
1.9.1



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

Subject: Digest Footer

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


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

End of connman Digest, Vol 7, Issue 10
**************************************

Reply via email to