summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorBastien Nocera <hadess@hadess.net>2017-11-08 20:38:28 +0100
committerSzymon Janc <szymon.janc@codecoup.pl>2017-11-09 09:52:01 +0100
commit1629c39ededef07988a5403b27331e0e317f1e08 (patch)
tree46c93c9a6834290675fe0c92385c8ba64628cca3 /plugins
parent6da6a8360bd00e09a0bf098d970fe472e6e1d39f (diff)
downloadbluez-1629c39ededef07988a5403b27331e0e317f1e08.tar.gz
plugins/sixaxis: Provide DualShock 3 SDP record while adding new device
This allows to skip SDP search for DualShock 3 devices, since some DS3 clones do not provide any SDP record. This allows them to operate nonetheless. The HID SDP record is lifted straight off an original DualShock 3 controller. The PNPID SDP record is not set as not required to provide a working device. Tested with a "SHANWAN" clone controller.
Diffstat (limited to 'plugins')
-rw-r--r--plugins/sixaxis.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/plugins/sixaxis.c b/plugins/sixaxis.c
index 6e60aa821..5ef2c1a21 100644
--- a/plugins/sixaxis.c
+++ b/plugins/sixaxis.c
@@ -71,6 +71,20 @@ static guint watch_id = 0;
/* key = sysfs_path (const str), value = auth_closure */
static GHashTable *pending_auths = NULL;
+#define SIXAXIS_HID_SDP_RECORD "3601920900000A000100000900013503191124090004"\
+ "350D35061901000900113503190011090006350909656E09006A090100090009350"\
+ "8350619112409010009000D350F350D350619010009001335031900110901002513"\
+ "576972656C65737320436F6E74726F6C6C65720901012513576972656C657373204"\
+ "36F6E74726F6C6C6572090102251B536F6E7920436F6D707574657220456E746572"\
+ "7461696E6D656E74090200090100090201090100090202080009020308210902042"\
+ "8010902052801090206359A35980822259405010904A101A1028501750895011500"\
+ "26FF00810375019513150025013500450105091901291381027501950D0600FF810"\
+ "3150026FF0005010901A10075089504350046FF0009300931093209358102C00501"\
+ "75089527090181027508953009019102750895300901B102C0A1028502750895300"\
+ "901B102C0A10285EE750895300901B102C0A10285EF750895300901B102C0C00902"\
+ "07350835060904090901000902082800090209280109020A280109020B090100090"\
+ "20C093E8009020D280009020E2800"
+
/* Make sure to unset auth_id if already handled */
static void auth_closure_destroy(struct authentication_closure *closure,
bool remove_device)
@@ -295,6 +309,10 @@ static void agent_auth_cb(DBusError *derr, void *user_data)
btd_device_set_trusted(closure->device, true);
btd_device_set_temporary(closure->device, false);
+ if (closure->type == CABLE_PAIRING_SIXAXIS)
+ btd_device_set_record(closure->device, HID_UUID,
+ SIXAXIS_HID_SDP_RECORD);
+
ba2str(&closure->bdaddr, device_addr);
ba2str(&master_bdaddr, master_addr);
ba2str(adapter_bdaddr, adapter_addr);