Linux bluetooth development
 help / color / mirror / Atom feed
* [PATCH 0/6] The Autopair strikes back
@ 2013-03-21  4:10 Alex Deymo
  2013-03-21  4:10 ` [PATCH 1/6] core: Convert the pincode callback to an interable list Alex Deymo
                   ` (8 more replies)
  0 siblings, 9 replies; 19+ messages in thread
From: Alex Deymo @ 2013-03-21  4:10 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: keybuk, marcel, Alex Deymo

Hello!
This is a rework of the autopair.c plugin we had at some point in BlueZ 4.

The goal of this patch set is to make the pairing process easier for 
devices that have a fixed and dumb pincode (like 0000 or 1234) or that
accept any pincode as long as the same pincode is entered on the device
(keyboards/combos). The goal is:
 * Don't ask the user (i.e. the agent) a question if we know the right answer.
This makes the user happier. =)

The covered constraints and scenarios are:
1. If the device has a well known pincode we should pair to it without
   asking the agent for a pin code (no RequestPincode call). Comon case are 
   mice and other devices with very limited input.
2. If the device accepts any pincode (as long as it is also entered in the
   device), we should provide the agent a random pincode (calling
   DisplayPincode) avoiding the unnecessary step of asking the agent for a
   [random] pincode (with RequestPincode). Comon case are keyboards/combos.
3. Don't return a failed error because we failed to guess the pincode. Retry
   instead until is not our fault (i.e., the device is out of range, the
   agent provided a wrong code, etc)
4. If the device accepts only a fixed pincode (and we don't know it) we
   should ask the agent for the pincode and be able to pair with the device.
   Read this as: don't break any compatibility.

The implemented logic is:
For each new org.bluez.Device1.Pair call that ends in a pin request (not SSP)
we *iterate* the list of pincode callbacks from plugins trying every callback
until it returns 0 (no pincode). For each pincode in this iteration, we try
to use it for the pin request. If it fails with an auth_failed, then we try
again with the next one until we reach the end of the list.
When we reach the end of the list, we try again but this time asking the
agent, thus following the current normal course (i.e. failing if there isn't
an agent registered, etc).

I'm open to hear your comments and look forward to have this patch set in.
If you find a problem or a device that doesn't work with this patch, please
let me know.
Thanks!

Alex Deymo (6):
  core: Convert the pincode callback to an interable list.
  plugins: Extend the pin code callback with the call number
  core: Add support for retrying a bonding
  core: retry bonding attempt until the iterator reachs the end.
  core: Add device_get_class to the public interface.
  autopair: Add the autopair plugin.

 Makefile.plugins   |   3 ++
 plugins/autopair.c | 145 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 plugins/wiimote.c  |   7 ++-
 src/adapter.c      | 125 +++++++++++++++++++++++++++++++++++++--------
 src/adapter.h      |  10 +++-
 src/device.c       |  82 ++++++++++++++++++++++++++++--
 src/device.h       |   5 ++
 7 files changed, 350 insertions(+), 27 deletions(-)
 create mode 100644 plugins/autopair.c

-- 
1.8.1.3

^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2013-03-22 17:36 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-21  4:10 [PATCH 0/6] The Autopair strikes back Alex Deymo
2013-03-21  4:10 ` [PATCH 1/6] core: Convert the pincode callback to an interable list Alex Deymo
2013-03-21  4:10 ` [PATCH 2/6] plugins: Extend the pin code callback with the call number Alex Deymo
2013-03-21 23:12   ` Scott James Remnant
2013-03-22 10:06     ` David Herrmann
2013-03-21  4:10 ` [PATCH 3/6] core: Add support for retrying a bonding Alex Deymo
2013-03-21  4:10 ` [PATCH 4/6] core: retry bonding attempt until the iterator reachs the end Alex Deymo
2013-03-21  4:10 ` [PATCH 5/6] core: Add device_get_class to the public interface Alex Deymo
2013-03-21  4:10 ` [PATCH 6/6] autopair: Add the autopair plugin Alex Deymo
2013-03-21 23:13   ` Scott James Remnant
2013-03-21  7:49 ` [PATCH 0/6] The Autopair strikes back Bastien Nocera
2013-03-21 23:07   ` Scott James Remnant
2013-03-22  8:23     ` Bastien Nocera
2013-03-22  8:52       ` Bastien Nocera
2013-03-21  9:11 ` Szymon Janc
2013-03-21 15:30   ` Luiz Augusto von Dentz
2013-03-21 15:35     ` Luiz Augusto von Dentz
2013-03-22 17:36       ` Alex Deymo
2013-03-21 23:10 ` Scott James Remnant

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox