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 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
391 const AcquiredCallback& callback, | 391 const AcquiredCallback& callback, |
392 const BluetoothAudioSink::ErrorCallback& error_callback) = 0; | 392 const BluetoothAudioSink::ErrorCallback& error_callback) = 0; |
393 | 393 |
394 // Creates and registers an advertisement for broadcast over the LE channel. | 394 // Creates and registers an advertisement for broadcast over the LE channel. |
395 // The created advertisement will be returned via the success callback. | 395 // The created advertisement will be returned via the success callback. |
396 virtual void RegisterAdvertisement( | 396 virtual void RegisterAdvertisement( |
397 scoped_ptr<BluetoothAdvertisement::Data> advertisement_data, | 397 scoped_ptr<BluetoothAdvertisement::Data> advertisement_data, |
398 const CreateAdvertisementCallback& callback, | 398 const CreateAdvertisementCallback& callback, |
399 const CreateAdvertisementErrorCallback& error_callback) = 0; | 399 const CreateAdvertisementErrorCallback& error_callback) = 0; |
400 | 400 |
| 401 // The following methods are used to send various GATT observer events to |
| 402 // observers. |
| 403 void NotifyGattServiceAdded(BluetoothGattService* service); |
| 404 void NotifyGattServiceRemoved(BluetoothGattService* service); |
| 405 void NotifyGattServiceChanged(BluetoothGattService* service); |
| 406 void NotifyGattServicesDiscovered(BluetoothDevice* device); |
| 407 void NotifyGattDiscoveryComplete(BluetoothGattService* service); |
| 408 void NotifyGattCharacteristicAdded( |
| 409 BluetoothGattCharacteristic* characteristic); |
| 410 void NotifyGattCharacteristicRemoved( |
| 411 BluetoothGattCharacteristic* characteristic); |
| 412 void NotifyGattDescriptorAdded(BluetoothGattDescriptor* descriptor); |
| 413 void NotifyGattDescriptorRemoved(BluetoothGattDescriptor* descriptor); |
| 414 void NotifyGattCharacteristicValueChanged( |
| 415 BluetoothGattCharacteristic* characteristic, |
| 416 const std::vector<uint8_t>& value); |
| 417 void NotifyGattDescriptorValueChanged(BluetoothGattDescriptor* descriptor, |
| 418 const std::vector<uint8_t>& value); |
| 419 |
401 protected: | 420 protected: |
402 friend class base::RefCounted<BluetoothAdapter>; | 421 friend class base::RefCounted<BluetoothAdapter>; |
403 friend class BluetoothDiscoverySession; | 422 friend class BluetoothDiscoverySession; |
404 friend class BluetoothTestBase; | 423 friend class BluetoothTestBase; |
405 | 424 |
406 typedef base::ScopedPtrHashMap<std::string, scoped_ptr<BluetoothDevice>> | 425 typedef base::ScopedPtrHashMap<std::string, scoped_ptr<BluetoothDevice>> |
407 DevicesMap; | 426 DevicesMap; |
408 typedef std::pair<BluetoothDevice::PairingDelegate*, PairingDelegatePriority> | 427 typedef std::pair<BluetoothDevice::PairingDelegate*, PairingDelegatePriority> |
409 PairingDelegatePair; | 428 PairingDelegatePair; |
410 typedef base::Callback<void(UMABluetoothDiscoverySessionOutcome)> | 429 typedef base::Callback<void(UMABluetoothDiscoverySessionOutcome)> |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
529 std::set<BluetoothDiscoverySession*> discovery_sessions_; | 548 std::set<BluetoothDiscoverySession*> discovery_sessions_; |
530 | 549 |
531 // Note: This should remain the last member so it'll be destroyed and | 550 // Note: This should remain the last member so it'll be destroyed and |
532 // invalidate its weak pointers before any other members are destroyed. | 551 // invalidate its weak pointers before any other members are destroyed. |
533 base::WeakPtrFactory<BluetoothAdapter> weak_ptr_factory_; | 552 base::WeakPtrFactory<BluetoothAdapter> weak_ptr_factory_; |
534 }; | 553 }; |
535 | 554 |
536 } // namespace device | 555 } // namespace device |
537 | 556 |
538 #endif // DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_H_ | 557 #endif // DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_H_ |
OLD | NEW |