OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #ifndef DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_H_ | 5 #ifndef DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_H_ |
6 #define DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_H_ | 6 #define DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <list> | 10 #include <list> |
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
303 virtual bool IsDiscoverable() const = 0; | 303 virtual bool IsDiscoverable() const = 0; |
304 | 304 |
305 // Requests that the adapter change its discoverability state. If | 305 // Requests that the adapter change its discoverability state. If |
306 // |discoverable| is true, then it will be discoverable by other Bluetooth | 306 // |discoverable| is true, then it will be discoverable by other Bluetooth |
307 // devices. On successfully changing the adapter's discoverability, |callback| | 307 // devices. On successfully changing the adapter's discoverability, |callback| |
308 // will be called. On failure, |error_callback| will be called. | 308 // will be called. On failure, |error_callback| will be called. |
309 virtual void SetDiscoverable(bool discoverable, | 309 virtual void SetDiscoverable(bool discoverable, |
310 const base::Closure& callback, | 310 const base::Closure& callback, |
311 const ErrorCallback& error_callback) = 0; | 311 const ErrorCallback& error_callback) = 0; |
312 | 312 |
313 #if defined(OS_CHROMEOS) || defined(OS_LINUX) | |
314 // Returns the timeout after which the adapter exits discoverable mode in | |
315 // seconds, or zero if the adapter is always discoverable. | |
316 virtual uint32_t GetDiscoverableTimeout() const = 0; | |
rkc
2016/06/23 23:53:05
Is this something other platforms may need or is i
| |
317 #endif | |
318 | |
313 // Indicates whether the adapter is currently discovering new devices. | 319 // Indicates whether the adapter is currently discovering new devices. |
314 virtual bool IsDiscovering() const = 0; | 320 virtual bool IsDiscovering() const = 0; |
315 | 321 |
316 // Requests the adapter to start a new discovery session. On success, a new | 322 // Requests the adapter to start a new discovery session. On success, a new |
317 // instance of BluetoothDiscoverySession will be returned to the caller via | 323 // instance of BluetoothDiscoverySession will be returned to the caller via |
318 // |callback| and the adapter will be discovering nearby Bluetooth devices. | 324 // |callback| and the adapter will be discovering nearby Bluetooth devices. |
319 // The returned BluetoothDiscoverySession is owned by the caller and it's the | 325 // The returned BluetoothDiscoverySession is owned by the caller and it's the |
320 // owner's responsibility to properly clean it up and stop the session when | 326 // owner's responsibility to properly clean it up and stop the session when |
321 // device discovery is no longer needed. | 327 // device discovery is no longer needed. |
322 // | 328 // |
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
598 std::set<BluetoothDiscoverySession*> discovery_sessions_; | 604 std::set<BluetoothDiscoverySession*> discovery_sessions_; |
599 | 605 |
600 // Note: This should remain the last member so it'll be destroyed and | 606 // Note: This should remain the last member so it'll be destroyed and |
601 // invalidate its weak pointers before any other members are destroyed. | 607 // invalidate its weak pointers before any other members are destroyed. |
602 base::WeakPtrFactory<BluetoothAdapter> weak_ptr_factory_; | 608 base::WeakPtrFactory<BluetoothAdapter> weak_ptr_factory_; |
603 }; | 609 }; |
604 | 610 |
605 } // namespace device | 611 } // namespace device |
606 | 612 |
607 #endif // DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_H_ | 613 #endif // DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_H_ |
OLD | NEW |