summaryrefslogtreecommitdiffstats
path: root/device/bluetooth/bluetooth_device.cc
diff options
context:
space:
mode:
authoreduardo.lima@intel.com <eduardo.lima@intel.com@0039d316-1c4b-4281-b951-d872f2087c98>2014-05-19 14:33:57 +0000
committereduardo.lima@intel.com <eduardo.lima@intel.com@0039d316-1c4b-4281-b951-d872f2087c98>2014-05-19 14:33:57 +0000
commit7a9d42e479d395d31981ea94f9ce8bb70b24a92a (patch)
treeadf94df35ba4b7fa3fa8f05803c789fda478c11c /device/bluetooth/bluetooth_device.cc
parent4469e721788046f7d02989d5117a69358516fa44 (diff)
downloadchromium_src-7a9d42e479d395d31981ea94f9ce8bb70b24a92a.zip
chromium_src-7a9d42e479d395d31981ea94f9ce8bb70b24a92a.tar.gz
chromium_src-7a9d42e479d395d31981ea94f9ce8bb70b24a92a.tar.bz2
bluetooth_device: Support for Playstation DualShock3 joystick
This device does not require pairing. It is necessary to connect it to a USB port so it will become available. When disconnected from the USB, the device will try to connect via Bluetooth, at this time it is marked as trusted. Signed-off-by: Eduardo Lima (Etrunko) <eduardo.lima@intel.com> R=keybuk@chromium.org BUG=366356 Review URL: https://codereview.chromium.org/287073003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@271377 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'device/bluetooth/bluetooth_device.cc')
-rw-r--r--device/bluetooth/bluetooth_device.cc13
1 files changed, 13 insertions, 0 deletions
diff --git a/device/bluetooth/bluetooth_device.cc b/device/bluetooth/bluetooth_device.cc
index ede5382..87c1190 100644
--- a/device/bluetooth/bluetooth_device.cc
+++ b/device/bluetooth/bluetooth_device.cc
@@ -167,11 +167,24 @@ bool BluetoothDevice::IsPairable() const {
// Microsoft "Microsoft Bluetooth Notebook Mouse 5000", model X807028-001
if (type == DEVICE_MOUSE && vendor == "7C:ED:8D")
return false;
+ // Sony PlayStation Dualshock3
+ if (IsTrustable())
+ return false;
+
// TODO: Move this database into a config file.
return true;
}
+bool BluetoothDevice::IsTrustable() const {
+ // Sony PlayStation Dualshock3
+ if ((GetVendorID() == 0x054c && GetProductID() == 0x0268 &&
+ GetDeviceName() == "PLAYSTATION(R)3 Controller"))
+ return true;
+
+ return false;
+}
+
std::vector<BluetoothGattService*>
BluetoothDevice::GetGattServices() const {
std::vector<BluetoothGattService*> services;