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 438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
449 // for the interval are from 20ms to 10.24 seconds, with min <= max. | 449 // for the interval are from 20ms to 10.24 seconds, with min <= max. |
450 // Note: This is a best effort. The actual interval may vary non-trivially | 450 // Note: This is a best effort. The actual interval may vary non-trivially |
451 // from the requested intervals. On some hardware, there is a minimum | 451 // from the requested intervals. On some hardware, there is a minimum |
452 // interval of 100ms. The minimum and maximum values are specified by the | 452 // interval of 100ms. The minimum and maximum values are specified by the |
453 // Core 4.2 Spec, Vol 2, Part E, Section 7.8.5. | 453 // Core 4.2 Spec, Vol 2, Part E, Section 7.8.5. |
454 virtual void SetAdvertisingInterval( | 454 virtual void SetAdvertisingInterval( |
455 const base::TimeDelta& min, | 455 const base::TimeDelta& min, |
456 const base::TimeDelta& max, | 456 const base::TimeDelta& max, |
457 const base::Closure& callback, | 457 const base::Closure& callback, |
458 const AdvertisementErrorCallback& error_callback) = 0; | 458 const AdvertisementErrorCallback& error_callback) = 0; |
| 459 |
| 460 // Resets advertising on this adapter. This will unregister all existing |
| 461 // advertisements and will stop advertising them. |
| 462 virtual void ResetAdvertising( |
| 463 const base::Closure& callback, |
| 464 const AdvertisementErrorCallback& error_callback) = 0; |
459 #endif | 465 #endif |
460 | 466 |
461 // Returns the local GATT services associated with this adapter with the | 467 // Returns the local GATT services associated with this adapter with the |
462 // given identifier. Returns NULL if the service doesn't exist. | 468 // given identifier. Returns NULL if the service doesn't exist. |
463 virtual BluetoothLocalGattService* GetGattService( | 469 virtual BluetoothLocalGattService* GetGattService( |
464 const std::string& identifier) const = 0; | 470 const std::string& identifier) const = 0; |
465 | 471 |
466 // The following methods are used to send various events to observers. | 472 // The following methods are used to send various events to observers. |
467 void NotifyAdapterPoweredChanged(bool powered); | 473 void NotifyAdapterPoweredChanged(bool powered); |
468 void NotifyDeviceChanged(BluetoothDevice* device); | 474 void NotifyDeviceChanged(BluetoothDevice* device); |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
631 std::set<BluetoothDiscoverySession*> discovery_sessions_; | 637 std::set<BluetoothDiscoverySession*> discovery_sessions_; |
632 | 638 |
633 // Note: This should remain the last member so it'll be destroyed and | 639 // Note: This should remain the last member so it'll be destroyed and |
634 // invalidate its weak pointers before any other members are destroyed. | 640 // invalidate its weak pointers before any other members are destroyed. |
635 base::WeakPtrFactory<BluetoothAdapter> weak_ptr_factory_; | 641 base::WeakPtrFactory<BluetoothAdapter> weak_ptr_factory_; |
636 }; | 642 }; |
637 | 643 |
638 } // namespace device | 644 } // namespace device |
639 | 645 |
640 #endif // DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_H_ | 646 #endif // DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_H_ |
OLD | NEW |