diff options
author | Szymon Janc <szymon.janc@codecoup.pl> | 2021-02-11 16:39:13 +0100 |
---|---|---|
committer | Szymon Janc <szymon.janc@codecoup.pl> | 2021-02-22 09:22:59 +0100 |
commit | 61745d2bb8b5f534278db49faf8e2cdb7e894529 (patch) | |
tree | c5d77b7c3301864c66d27917bbcdb787a362b57e /plugins | |
parent | dc7a726aa71b21fa1b279bd635df367c8fb716ce (diff) | |
download | bluez-61745d2bb8b5f534278db49faf8e2cdb7e894529.tar.gz |
sixaxis: Fix Bluetooth PS3 clone joypad being named like the original
When cable pairing a PS3 clone device, we should try and keep the USB device
name to create a new btd_device so that the joypad is named after its USB name
when connecting through Bluetooth.
If that isn't done, "Shanwan" clone joypads are named like the genuine joypads, and
kernel Bluetooth quirks aren't applied.
gh-issue: https://github.com/bluez/bluez/issues/46
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/sixaxis.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/plugins/sixaxis.c b/plugins/sixaxis.c index d693a86c0..517cecc47 100644 --- a/plugins/sixaxis.c +++ b/plugins/sixaxis.c @@ -387,6 +387,7 @@ get_pairing_type_for_device(struct udev_device *udevice, uint16_t *bus, char **sysfs_path) { struct udev_device *hid_parent; + const char *hid_name; const char *hid_id; const struct cable_pairing *cp; uint16_t vid, pid; @@ -401,7 +402,9 @@ get_pairing_type_for_device(struct udev_device *udevice, uint16_t *bus, if (!hid_id || sscanf(hid_id, "%hx:%hx:%hx", bus, &vid, &pid) != 3) return NULL; - cp = get_pairing(vid, pid); + hid_name = udev_device_get_property_value(hid_parent, "HID_NAME"); + + cp = get_pairing(vid, pid, hid_name); *sysfs_path = g_strdup(udev_device_get_syspath(udevice)); return cp; |