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 426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
437 // advertisement can unregister itself at any time by calling its unregister | 437 // advertisement can unregister itself at any time by calling its unregister |
438 // function. | 438 // function. |
439 virtual void RegisterAdvertisement( | 439 virtual void RegisterAdvertisement( |
440 std::unique_ptr<BluetoothAdvertisement::Data> advertisement_data, | 440 std::unique_ptr<BluetoothAdvertisement::Data> advertisement_data, |
441 const CreateAdvertisementCallback& callback, | 441 const CreateAdvertisementCallback& callback, |
442 const AdvertisementErrorCallback& error_callback) = 0; | 442 const AdvertisementErrorCallback& error_callback) = 0; |
443 | 443 |
444 #if defined(OS_CHROMEOS) || defined(OS_LINUX) | 444 #if defined(OS_CHROMEOS) || defined(OS_LINUX) |
445 // Sets the interval between two consecutive advertisements. Valid ranges | 445 // Sets the interval between two consecutive advertisements. Valid ranges |
446 // for the interval are from 20ms to 10.24 seconds, with min <= max. | 446 // for the interval are from 20ms to 10.24 seconds, with min <= max. |
| 447 // Note: This is a best effort. The actual interval may vary non-trivially |
| 448 // from the requested intervals. On some hardware, there is a minimum |
| 449 // interval of 100ms. The minimum and maximum values are specified by the |
| 450 // Core 4.2 Spec, Vol 2, Part E, Section 7.8.5. |
447 virtual void SetAdvertisingInterval( | 451 virtual void SetAdvertisingInterval( |
448 const base::TimeDelta& min, | 452 const base::TimeDelta& min, |
449 const base::TimeDelta& max, | 453 const base::TimeDelta& max, |
450 const base::Closure& callback, | 454 const base::Closure& callback, |
451 const AdvertisementErrorCallback& error_callback) = 0; | 455 const AdvertisementErrorCallback& error_callback) = 0; |
452 #endif | 456 #endif |
453 | 457 |
454 // Returns the local GATT services associated with this adapter with the | 458 // Returns the local GATT services associated with this adapter with the |
455 // given identifier. Returns NULL if the service doesn't exist. | 459 // given identifier. Returns NULL if the service doesn't exist. |
456 virtual BluetoothLocalGattService* GetGattService( | 460 virtual BluetoothLocalGattService* GetGattService( |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
624 std::set<BluetoothDiscoverySession*> discovery_sessions_; | 628 std::set<BluetoothDiscoverySession*> discovery_sessions_; |
625 | 629 |
626 // Note: This should remain the last member so it'll be destroyed and | 630 // Note: This should remain the last member so it'll be destroyed and |
627 // invalidate its weak pointers before any other members are destroyed. | 631 // invalidate its weak pointers before any other members are destroyed. |
628 base::WeakPtrFactory<BluetoothAdapter> weak_ptr_factory_; | 632 base::WeakPtrFactory<BluetoothAdapter> weak_ptr_factory_; |
629 }; | 633 }; |
630 | 634 |
631 } // namespace device | 635 } // namespace device |
632 | 636 |
633 #endif // DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_H_ | 637 #endif // DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_H_ |
OLD | NEW |