linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Marcel Holtmann <marcel@holtmann.org>
To: Scott James Remnant <scott@netsplit.com>
Cc: linux-bluetooth@vger.kernel.org, keybuk@chromium.org
Subject: Re: [RFC PATCH 2/3] agent: add DisplayPinCode method
Date: Sat, 21 Jan 2012 17:36:21 +0100	[thread overview]
Message-ID: <1327163781.1955.48.camel@aeonflux> (raw)
In-Reply-To: <1327100744-28782-3-git-send-email-scott@netsplit.com>

Hi Scott,

> Add a second notification type that requests the agent displays a
> string PinCode rather than the numeric Passkey.
> ---
>  doc/agent-api.txt |   12 ++++++++++++
>  src/agent.c       |   27 +++++++++++++++++++++++++++
>  src/agent.h       |    2 ++
>  src/device.c      |   24 ++++++++++++++++--------
>  src/device.h      |    5 +++--
>  src/event.c       |   10 +++++-----
>  test/simple-agent |    5 +++++
>  7 files changed, 70 insertions(+), 15 deletions(-)

as a general rule, please split documentation patches from actual
implementation. That way we can do API review a lot simpler.

Same applies to code and test scripts.

> diff --git a/doc/agent-api.txt b/doc/agent-api.txt
> index 9ab2063..0b32d70 100644
> --- a/doc/agent-api.txt
> +++ b/doc/agent-api.txt
> @@ -61,6 +61,18 @@ Methods		void Release()
>  			so the display should be zero-padded at the start if
>  			the value contains less than 6 digits.
>  
> +		void DisplayPinCode(object device, string pincode)
> +
> +			This method gets called when the service daemon
> +			needs to display a pincode for an authentication.
> +
> +			An empty reply should be returned. When the pincode
> +			needs no longer to be displayed, the Cancel method
> +			of the agent will be called.
> +
> +			During the pairing process this method might be
> +			called multiple times to update the entered value.
> +

I am a little bit concerned here since we are using legacy pairing. I
have not looked at the implementation, but I think we should only reply
with the random PIN code to the controller once this method got returned
with a positive reply.

And in addition I prefer if we handle a negative/reject or non reply at
all to make this work with older agents as well. That way the core can
fallback to just RequestPinCode if this gets rejected.

In addition to that, I am not sure we can actually nicely emulate the
"entered" feature from SSP. I know you mentioned that Apple does
something like this, but it is nowhere near a standard. So do we really
wanna call this method multiple times or just accept that it will be
only called once and if it gets rejected, we fall back to requesting the
PIN code.

Regards

Marcel



  reply	other threads:[~2012-01-21 16:36 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-20 23:05 [RFC PATCH 0/3] Generate PIN for keyboards inside bluetoothd Scott James Remnant
2012-01-20 23:05 ` [RFC PATCH 1/3] lib: add header of device class constants Scott James Remnant
2012-01-21 16:30   ` Marcel Holtmann
2012-01-21 17:29     ` Scott James Remnant
2012-01-20 23:05 ` [RFC PATCH 2/3] agent: add DisplayPinCode method Scott James Remnant
2012-01-21 16:36   ` Marcel Holtmann [this message]
2012-01-23  6:08     ` Scott James Remnant
2012-01-20 23:05 ` [RFC PATCH 3/3] Implement HID profile recommendation for keyboards Scott James Remnant
2012-01-23 12:14 ` [RFC PATCH 0/3] Generate PIN for keyboards inside bluetoothd Bastien Nocera
2012-01-23 15:37   ` Scott James Remnant
2012-01-23 16:03     ` Bastien Nocera
2012-01-23 16:10       ` Scott James Remnant
2012-01-23 16:24         ` Bastien Nocera
2012-01-23 16:26           ` Scott James Remnant

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=1327163781.1955.48.camel@aeonflux \
    --to=marcel@holtmann.org \
    --cc=keybuk@chromium.org \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=scott@netsplit.com \
    /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).