| 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_adapter_bluez.h" | 5 #include "device/bluetooth/bluez/bluetooth_adapter_bluez.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 346 | 346 |
| 347 bluez::BluezDBusManager::Get() | 347 bluez::BluezDBusManager::Get() |
| 348 ->GetBluetoothAdapterClient() | 348 ->GetBluetoothAdapterClient() |
| 349 ->GetProperties(object_path_) | 349 ->GetProperties(object_path_) |
| 350 ->discoverable.Set( | 350 ->discoverable.Set( |
| 351 discoverable, | 351 discoverable, |
| 352 base::Bind(&BluetoothAdapterBlueZ::OnSetDiscoverable, | 352 base::Bind(&BluetoothAdapterBlueZ::OnSetDiscoverable, |
| 353 weak_ptr_factory_.GetWeakPtr(), callback, error_callback)); | 353 weak_ptr_factory_.GetWeakPtr(), callback, error_callback)); |
| 354 } | 354 } |
| 355 | 355 |
| 356 uint32_t BluetoothAdapterBlueZ::GetDiscoverableTimeout() const { |
| 357 if (!IsPresent()) |
| 358 return 0; |
| 359 |
| 360 bluez::BluetoothAdapterClient::Properties* properties = |
| 361 bluez::BluezDBusManager::Get() |
| 362 ->GetBluetoothAdapterClient() |
| 363 ->GetProperties(object_path_); |
| 364 |
| 365 return properties->discoverable_timeout.value(); |
| 366 } |
| 367 |
| 356 bool BluetoothAdapterBlueZ::IsDiscovering() const { | 368 bool BluetoothAdapterBlueZ::IsDiscovering() const { |
| 357 if (!IsPresent()) | 369 if (!IsPresent()) |
| 358 return false; | 370 return false; |
| 359 | 371 |
| 360 bluez::BluetoothAdapterClient::Properties* properties = | 372 bluez::BluetoothAdapterClient::Properties* properties = |
| 361 bluez::BluezDBusManager::Get() | 373 bluez::BluezDBusManager::Get() |
| 362 ->GetBluetoothAdapterClient() | 374 ->GetBluetoothAdapterClient() |
| 363 ->GetProperties(object_path_); | 375 ->GetProperties(object_path_); |
| 364 | 376 |
| 365 return properties->discovering.value(); | 377 return properties->discovering.value(); |
| (...skipping 1276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1642 | 1654 |
| 1643 void BluetoothAdapterBlueZ::RegisterApplicationOnError( | 1655 void BluetoothAdapterBlueZ::RegisterApplicationOnError( |
| 1644 const base::Closure& callback, | 1656 const base::Closure& callback, |
| 1645 const device::BluetoothGattService::ErrorCallback& error_callback, | 1657 const device::BluetoothGattService::ErrorCallback& error_callback, |
| 1646 const std::string& /* error_name */, | 1658 const std::string& /* error_name */, |
| 1647 const std::string& /* error_message */) { | 1659 const std::string& /* error_message */) { |
| 1648 RegisterApplication(callback, error_callback); | 1660 RegisterApplication(callback, error_callback); |
| 1649 } | 1661 } |
| 1650 | 1662 |
| 1651 } // namespace bluez | 1663 } // namespace bluez |
| OLD | NEW |