From: Szymon Janc <szymon.janc@codecoup.pl>
To: Bastien Nocera <hadess@hadess.net>
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH] autopair: Don't handle the iCade
Date: Tue, 17 Oct 2017 11:53:23 +0200 [thread overview]
Message-ID: <3018510.RSqAULb6OW@ix> (raw)
In-Reply-To: <20170904175446.4798-1-hadess@hadess.net>
Hi Bastien,
On Monday, 4 September 2017 19:54:46 CEST Bastien Nocera wrote:
> We can't easily enter digits other than 1 through 4 (inclusive)
> so leave it up to the agent to figure out a good passcode
> for the iCade.
>
> Note that we can not use the VID/PID of the device, as it is not
> yet known at that point.
> ---
> plugins/autopair.c | 13 ++++++++++++-
> 1 file changed, 12 insertions(+), 1 deletion(-)
>
> diff --git a/plugins/autopair.c b/plugins/autopair.c
> index d44cf539b..a9d2a930a 100644
> --- a/plugins/autopair.c
> +++ b/plugins/autopair.c
> @@ -60,13 +60,24 @@ static ssize_t autopair_pincb(struct btd_adapter
> *adapter, {
> char addr[18];
> char pinstr[7];
> + char name[25];
> uint32_t class;
>
> ba2str(device_get_address(device), addr);
>
> class = btd_device_get_class(device);
>
> - DBG("device %s 0x%x", addr, class);
> + device_get_name(device, name, sizeof(name));
> + name[sizeof(name) - 1] = 0;
> +
> + DBG("device '%s' (%s) class: 0x%x vid/pid: 0x%X/0x%X",
> + name, addr, class,
> + btd_device_get_vendor (device),
> + btd_device_get_product (device));
> +
> + /* The iCade shouldn't use random PINs like normal keyboards */
> + if (name != NULL && strstr(name, "iCade") != NULL)
> + return 0;
>
> /* This is a class-based pincode guesser. Ignore devices with an
> * unknown class.
Applied, thanks.
--
pozdrawiam
Szymon Janc
next prev parent reply other threads:[~2017-10-17 9:53 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-04 17:54 [PATCH] autopair: Don't handle the iCade Bastien Nocera
2017-09-07 7:46 ` ERAMOTO Masaya
2017-09-07 12:05 ` Bastien Nocera
2017-10-17 9:53 ` Szymon Janc [this message]
-- strict thread matches above, loose matches on Subject: below --
2013-12-09 17:08 Bastien Nocera
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=3018510.RSqAULb6OW@ix \
--to=szymon.janc@codecoup.pl \
--cc=hadess@hadess.net \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.