| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "device/bluetooth/bluetooth_device_chromeos.h" | 5 #include "device/bluetooth/bluetooth_device_chromeos.h" |
| 6 | 6 |
| 7 #include <stdio.h> | 7 #include <stdio.h> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 205 ParseModalias(object_path_, NULL, NULL, &product_id, NULL); | 205 ParseModalias(object_path_, NULL, NULL, &product_id, NULL); |
| 206 return product_id; | 206 return product_id; |
| 207 } | 207 } |
| 208 | 208 |
| 209 uint16 BluetoothDeviceChromeOS::GetDeviceID() const { | 209 uint16 BluetoothDeviceChromeOS::GetDeviceID() const { |
| 210 uint16 device_id = 0; | 210 uint16 device_id = 0; |
| 211 ParseModalias(object_path_, NULL, NULL, NULL, &device_id); | 211 ParseModalias(object_path_, NULL, NULL, NULL, &device_id); |
| 212 return device_id; | 212 return device_id; |
| 213 } | 213 } |
| 214 | 214 |
| 215 int BluetoothDeviceChromeOS::GetRSSI() const { |
| 216 NOTIMPLEMENTED(); |
| 217 return 0; |
| 218 } |
| 219 |
| 215 bool BluetoothDeviceChromeOS::IsPaired() const { | 220 bool BluetoothDeviceChromeOS::IsPaired() const { |
| 216 BluetoothDeviceClient::Properties* properties = | 221 BluetoothDeviceClient::Properties* properties = |
| 217 DBusThreadManager::Get()->GetBluetoothDeviceClient()-> | 222 DBusThreadManager::Get()->GetBluetoothDeviceClient()-> |
| 218 GetProperties(object_path_); | 223 GetProperties(object_path_); |
| 219 DCHECK(properties); | 224 DCHECK(properties); |
| 220 | 225 |
| 221 // Trusted devices are devices that don't support pairing but that the | 226 // Trusted devices are devices that don't support pairing but that the |
| 222 // user has explicitly connected; it makes no sense for UI purposes to | 227 // user has explicitly connected; it makes no sense for UI purposes to |
| 223 // treat them differently from each other. | 228 // treat them differently from each other. |
| 224 return properties->paired.value() || properties->trusted.value(); | 229 return properties->paired.value() || properties->trusted.value(); |
| (...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 662 const std::string& error_message) { | 667 const std::string& error_message) { |
| 663 BluetoothProfileChromeOS* profile_chromeos = | 668 BluetoothProfileChromeOS* profile_chromeos = |
| 664 static_cast<BluetoothProfileChromeOS*>(profile); | 669 static_cast<BluetoothProfileChromeOS*>(profile); |
| 665 VLOG(1) << object_path_.value() << ": Profile connection failed: " | 670 VLOG(1) << object_path_.value() << ": Profile connection failed: " |
| 666 << profile_chromeos->uuid().canonical_value() << ": " | 671 << profile_chromeos->uuid().canonical_value() << ": " |
| 667 << error_name << ": " << error_message; | 672 << error_name << ": " << error_message; |
| 668 error_callback.Run(error_message); | 673 error_callback.Run(error_message); |
| 669 } | 674 } |
| 670 | 675 |
| 671 } // namespace chromeos | 676 } // namespace chromeos |
| OLD | NEW |