From: Bastien Nocera <hadess@hadess.net>
To: linux-bluetooth@vger.kernel.org
Cc: Bastien Nocera <hadess@hadess.net>
Subject: [PATCH v2 2/2] autopair: Add pin codes to try for gaming input devices
Date: Mon, 27 Nov 2017 16:26:51 +0100 [thread overview]
Message-ID: <20171127152651.18997-2-hadess@hadess.net> (raw)
In-Reply-To: <20171127152651.18997-1-hadess@hadess.net>
As well as remote controls.
---
plugins/autopair.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/plugins/autopair.c b/plugins/autopair.c
index 70e19930e..043bd9b9d 100644
--- a/plugins/autopair.c
+++ b/plugins/autopair.c
@@ -111,6 +111,18 @@ static ssize_t autopair_pincb(struct btd_adapter *adapter,
case 0x05: /* Peripheral */
switch ((class & 0xc0) >> 6) {
+ case 0x00:
+ switch ((class & 0x1e) >> 2) {
+ case 0x01: /* Joystick */
+ case 0x02: /* Gamepad */
+ case 0x03: /* Remote Control */
+ if (attempt > 1)
+ return 0;
+ memcpy(pinbuf, "0000", 4);
+ return 4;
+ }
+
+ break;
case 0x01: /* Keyboard */
case 0x03: /* Combo keyboard/pointing device */
/* For keyboards rejecting the first random code
--
2.14.3
next prev parent reply other threads:[~2017-11-27 15:26 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-27 15:26 [PATCH v2 1/2] autopair: Add more common PIN codes for audio devices Bastien Nocera
2017-11-27 15:26 ` Bastien Nocera [this message]
2017-11-27 15:28 ` Bastien Nocera
2019-03-25 11:10 ` Bastien Nocera
2019-03-26 10:53 ` Szymon Janc
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=20171127152651.18997-2-hadess@hadess.net \
--to=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 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).