diff options
author | Bastien Nocera <hadess@hadess.net> | 2017-11-27 16:26:51 +0100 |
---|---|---|
committer | Szymon Janc <szymon.janc@codecoup.pl> | 2019-03-26 11:48:56 +0100 |
commit | a5958b5ba40ec5dd0678b7c1d6b6e2eb21b156b1 (patch) | |
tree | 3bce46b41dd5d5f82a8f67d69f358cddafc0b0bc /plugins/autopair.c | |
parent | c8ef6d8abe61f2b6c8a2a53677b91ba8759b0065 (diff) | |
download | bluez-a5958b5ba40ec5dd0678b7c1d6b6e2eb21b156b1.tar.gz |
autopair: Add pin codes to try for gaming input devices
As well as remote controls.
Diffstat (limited to 'plugins/autopair.c')
-rw-r--r-- | plugins/autopair.c | 12 |
1 files changed, 12 insertions, 0 deletions
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 |