| 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/bluez/bluetooth_device_bluez.h" | 5 #include "device/bluetooth/bluez/bluetooth_device_bluez.h" |
| 6 | 6 |
| 7 #include <stdio.h> | 7 #include <stdio.h> |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 281 bool BluetoothDeviceBlueZ::IsConnected() const { | 281 bool BluetoothDeviceBlueZ::IsConnected() const { |
| 282 bluez::BluetoothDeviceClient::Properties* properties = | 282 bluez::BluetoothDeviceClient::Properties* properties = |
| 283 bluez::BluezDBusManager::Get()->GetBluetoothDeviceClient()->GetProperties( | 283 bluez::BluezDBusManager::Get()->GetBluetoothDeviceClient()->GetProperties( |
| 284 object_path_); | 284 object_path_); |
| 285 DCHECK(properties); | 285 DCHECK(properties); |
| 286 | 286 |
| 287 return properties->connected.value(); | 287 return properties->connected.value(); |
| 288 } | 288 } |
| 289 | 289 |
| 290 bool BluetoothDeviceBlueZ::IsGattConnected() const { | 290 bool BluetoothDeviceBlueZ::IsGattConnected() const { |
| 291 NOTIMPLEMENTED(); | 291 // Bluez uses the same attribute for GATT Connections and Classic BT |
| 292 return false; | 292 // Connections. |
| 293 return IsConnected(); |
| 293 } | 294 } |
| 294 | 295 |
| 295 bool BluetoothDeviceBlueZ::IsConnectable() const { | 296 bool BluetoothDeviceBlueZ::IsConnectable() const { |
| 296 bluez::BluetoothInputClient::Properties* input_properties = | 297 bluez::BluetoothInputClient::Properties* input_properties = |
| 297 bluez::BluezDBusManager::Get()->GetBluetoothInputClient()->GetProperties( | 298 bluez::BluezDBusManager::Get()->GetBluetoothInputClient()->GetProperties( |
| 298 object_path_); | 299 object_path_); |
| 299 // GetProperties returns NULL when the device does not implement the given | 300 // GetProperties returns NULL when the device does not implement the given |
| 300 // interface. Non HID devices are normally connectable. | 301 // interface. Non HID devices are normally connectable. |
| 301 if (!input_properties) | 302 if (!input_properties) |
| 302 return true; | 303 return true; |
| (...skipping 536 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 839 void BluetoothDeviceBlueZ::OnForgetError(const ErrorCallback& error_callback, | 840 void BluetoothDeviceBlueZ::OnForgetError(const ErrorCallback& error_callback, |
| 840 const std::string& error_name, | 841 const std::string& error_name, |
| 841 const std::string& error_message) { | 842 const std::string& error_message) { |
| 842 LOG(WARNING) << object_path_.value() | 843 LOG(WARNING) << object_path_.value() |
| 843 << ": Failed to remove device: " << error_name << ": " | 844 << ": Failed to remove device: " << error_name << ": " |
| 844 << error_message; | 845 << error_message; |
| 845 error_callback.Run(); | 846 error_callback.Run(); |
| 846 } | 847 } |
| 847 | 848 |
| 848 } // namespace bluez | 849 } // namespace bluez |
| OLD | NEW |