Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(210)

Unified Diff: device/bluetooth/bluetooth_device.cc

Issue 287073003: bluetooth_device: Support for Playstation DualShock3 joystick (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « device/bluetooth/bluetooth_device.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/bluetooth/bluetooth_device.cc
diff --git a/device/bluetooth/bluetooth_device.cc b/device/bluetooth/bluetooth_device.cc
index 9cba011fc735f6aea35286a82951146daa2d3705..e554f09283dbc607023cab06fdb98f82613fbe68 100644
--- a/device/bluetooth/bluetooth_device.cc
+++ b/device/bluetooth/bluetooth_device.cc
@@ -166,11 +166,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;
« no previous file with comments | « device/bluetooth/bluetooth_device.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698