linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Gustavo Padovan <gustavo@padovan.org>
To: linux-bluetooth@vger.kernel.org
Cc: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Subject: [RFC v1 5/9] doc: add RequestPairingSession() and ReleasePairingSession()
Date: Tue, 11 Jun 2013 01:03:27 +0100	[thread overview]
Message-ID: <1370909011-19315-5-git-send-email-gustavo@padovan.org> (raw)
In-Reply-To: <1370909011-19315-1-git-send-email-gustavo@padovan.org>

From: Gustavo Padovan <gustavo.padovan@collabora.co.uk>

Those methods improve the tracking of the Discoverable and Pairable
properties for Pairing purposes. One could call RequestPairingSession()
to get a Pairing session.

ReleasePairingSession() releases a session. If the client exits without
calling the ReleasePairingSession() the session is also released.
When the last session is released both Discoverable and Pairing goes back
the their original value.

The Pairing property tracks if the there is a ongoing Pairing session.
---
 doc/adapter-api.txt | 47 +++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 47 insertions(+)

diff --git a/doc/adapter-api.txt b/doc/adapter-api.txt
index 74d235a..4d205f2 100644
--- a/doc/adapter-api.txt
+++ b/doc/adapter-api.txt
@@ -35,6 +35,37 @@ Methods		void StartDiscovery()
 					 org.bluez.Error.Failed
 					 org.bluez.Error.NotAuthorized
 
+		void RequestPairingSession()
+
+			This method starts a Pairing session, it enables both
+			Discoverable and Pairable properties and tracks the
+			lifetime of the client that requested it. The client can
+			release the session by calling ReleasePairingSession().
+			The session is also released if the clients exits
+			unexpectedly.
+
+			Many sessions can be created by different clients. When
+			last session is released Discoverable and Pairable are
+			set back to wherever value they had before the request
+			of the first session.
+
+			The Pairing property show if there is a ongoing session
+			or not.
+
+			Possible errors: org.bluez.Error.NotReady
+					 org.bluez.Error.Failed
+
+		void ReleasePairingSession()
+
+			This method removes a Pairing session. When called
+			it will remove the session and if it is the last session
+			Discoverable and Pairable will be set to the value they
+			had before the beginning of the first session.
+
+			Possible errors: org.bluez.Error.NotReady
+					 org.bluez.Error.Failed
+					 org.bluez.Error.NotAuthorized
+
 		void RemoveDevice(object device)
 
 			This removes the remote device object at the given
@@ -111,6 +142,9 @@ Properties	string Address [readonly]
 
 			For any new adapter this settings defaults to false.
 
+			This property will become readonly if a Pairing session
+			is ongoing.
+
 		boolean Pairable [readwrite]
 
 			Switch an adapter to pairable or non-pairable. This is
@@ -122,6 +156,9 @@ Properties	string Address [readonly]
 
 			For any new adapter this settings defaults to true.
 
+			This property will become readonly if a Pairing session
+			is ongoing.
+
 		uint32 PairableTimeout [readwrite]
 
 			The pairable timeout in seconds. A value of zero
@@ -131,6 +168,9 @@ Properties	string Address [readonly]
 			The default value for pairable timeout should be
 			disabled (value 0).
 
+			This property will become readonly if a Pairing session
+			is ongoing.
+
 		uint32 DiscoverableTimeout [readwrite]
 
 			The discoverable timeout in seconds. A value of zero
@@ -140,10 +180,17 @@ Properties	string Address [readonly]
 			The default value for the discoverable timeout should
 			be 180 seconds (3 minutes).
 
+			This property will become readonly if a Pairing session
+			is ongoing.
+
 		boolean Discovering [readonly]
 
 			Indicates that a device discovery procedure is active.
 
+		boolean Pairing [readonly]
+
+			Indicates that one or more pairing session is active.
+
 		array{string} UUIDs [readonly]
 
 			List of 128-bit UUIDs that represents the available
-- 
1.8.1.4


  parent reply	other threads:[~2013-06-11  0:03 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-11  0:03 [RFC v1 1/9] adapter: fix setting of discoverable timeout Gustavo Padovan
2013-06-11  0:03 ` [RFC v1 2/9] adapter: remove unused toggle_discoverable Gustavo Padovan
2013-06-11  0:03 ` [RFC v1 3/9] adapter: rename discovery_client to watch_client Gustavo Padovan
2013-06-11  0:03 ` [RFC v1 4/9] adapter: rename compare_discovery_sender Gustavo Padovan
2013-06-11  0:03 ` Gustavo Padovan [this message]
2013-06-11  1:22   ` [RFC v1 5/9] doc: add RequestPairingSession() and ReleasePairingSession() Marcel Holtmann
2013-06-11 10:00   ` Bastien Nocera
2013-06-11 10:07     ` Gustavo Padovan
2013-06-11 10:14       ` Bastien Nocera
2013-06-11  0:03 ` [RFC v1 6/9] adapter: " Gustavo Padovan
2013-06-11  0:03 ` [RFC v1 7/9] adapter: add Pairing property to report ongoing Pairing Session Gustavo Padovan
2013-06-11  0:03 ` [RFC v1 8/9] adapter: forbid properties to be set during " Gustavo Padovan
2013-06-11  0:03 ` [RFC v1 9/9] test: add pairing command to test-adapter Gustavo Padovan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1370909011-19315-5-git-send-email-gustavo@padovan.org \
    --to=gustavo@padovan.org \
    --cc=gustavo.padovan@collabora.co.uk \
    --cc=linux-bluetooth@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).