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/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
271 DBusThreadManager::Get()->GetBluetoothDeviceClient()-> | 271 DBusThreadManager::Get()->GetBluetoothDeviceClient()-> |
272 GetProperties(object_path_); | 272 GetProperties(object_path_); |
273 DCHECK(properties); | 273 DCHECK(properties); |
274 | 274 |
275 if (!properties->rssi.is_valid()) | 275 if (!properties->rssi.is_valid()) |
276 return kUnknownPower; | 276 return kUnknownPower; |
277 | 277 |
278 return properties->rssi.value(); | 278 return properties->rssi.value(); |
279 } | 279 } |
280 | 280 |
| 281 int16 BluetoothDeviceChromeOS::GetInquiryTxPower() const { |
| 282 BluetoothDeviceClient::Properties* properties = |
| 283 DBusThreadManager::Get()->GetBluetoothDeviceClient()-> |
| 284 GetProperties(object_path_); |
| 285 DCHECK(properties); |
| 286 |
| 287 if (!properties->tx_power.is_valid()) |
| 288 return kUnknownPower; |
| 289 |
| 290 return properties->tx_power.value(); |
| 291 } |
| 292 |
281 bool BluetoothDeviceChromeOS::ExpectingPinCode() const { | 293 bool BluetoothDeviceChromeOS::ExpectingPinCode() const { |
282 return pairing_.get() && pairing_->ExpectingPinCode(); | 294 return pairing_.get() && pairing_->ExpectingPinCode(); |
283 } | 295 } |
284 | 296 |
285 bool BluetoothDeviceChromeOS::ExpectingPasskey() const { | 297 bool BluetoothDeviceChromeOS::ExpectingPasskey() const { |
286 return pairing_.get() && pairing_->ExpectingPasskey(); | 298 return pairing_.get() && pairing_->ExpectingPasskey(); |
287 } | 299 } |
288 | 300 |
289 bool BluetoothDeviceChromeOS::ExpectingConfirmation() const { | 301 bool BluetoothDeviceChromeOS::ExpectingConfirmation() const { |
290 return pairing_.get() && pairing_->ExpectingConfirmation(); | 302 return pairing_.get() && pairing_->ExpectingConfirmation(); |
(...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
700 void BluetoothDeviceChromeOS::OnForgetError( | 712 void BluetoothDeviceChromeOS::OnForgetError( |
701 const ErrorCallback& error_callback, | 713 const ErrorCallback& error_callback, |
702 const std::string& error_name, | 714 const std::string& error_name, |
703 const std::string& error_message) { | 715 const std::string& error_message) { |
704 LOG(WARNING) << object_path_.value() << ": Failed to remove device: " | 716 LOG(WARNING) << object_path_.value() << ": Failed to remove device: " |
705 << error_name << ": " << error_message; | 717 << error_name << ": " << error_message; |
706 error_callback.Run(); | 718 error_callback.Run(); |
707 } | 719 } |
708 | 720 |
709 } // namespace chromeos | 721 } // namespace chromeos |
OLD | NEW |