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> |
| 9 |
8 #include <list> | 10 #include <list> |
9 #include <set> | 11 #include <set> |
10 #include <string> | 12 #include <string> |
11 #include <utility> | 13 #include <utility> |
12 | 14 |
13 #include "base/callback.h" | 15 #include "base/callback.h" |
14 #include "base/containers/scoped_ptr_hash_map.h" | 16 #include "base/containers/scoped_ptr_hash_map.h" |
15 #include "base/memory/ref_counted.h" | 17 #include "base/memory/ref_counted.h" |
16 #include "base/memory/weak_ptr.h" | 18 #include "base/memory/weak_ptr.h" |
| 19 #include "build/build_config.h" |
17 #include "device/bluetooth/bluetooth_advertisement.h" | 20 #include "device/bluetooth/bluetooth_advertisement.h" |
18 #include "device/bluetooth/bluetooth_audio_sink.h" | 21 #include "device/bluetooth/bluetooth_audio_sink.h" |
19 #include "device/bluetooth/bluetooth_device.h" | 22 #include "device/bluetooth/bluetooth_device.h" |
20 #include "device/bluetooth/bluetooth_export.h" | 23 #include "device/bluetooth/bluetooth_export.h" |
21 | 24 |
22 namespace device { | 25 namespace device { |
23 | 26 |
24 class BluetoothAdvertisement; | 27 class BluetoothAdvertisement; |
25 class BluetoothDiscoveryFilter; | 28 class BluetoothDiscoveryFilter; |
26 class BluetoothDiscoverySession; | 29 class BluetoothDiscoverySession; |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 // removed from the system. | 164 // removed from the system. |
162 virtual void GattDescriptorRemoved(BluetoothAdapter* adapter, | 165 virtual void GattDescriptorRemoved(BluetoothAdapter* adapter, |
163 BluetoothGattDescriptor* descriptor) {} | 166 BluetoothGattDescriptor* descriptor) {} |
164 | 167 |
165 // Called when the value of a characteristic has changed. This might be a | 168 // Called when the value of a characteristic has changed. This might be a |
166 // result of a read/write request to, or a notification/indication from, a | 169 // result of a read/write request to, or a notification/indication from, a |
167 // remote GATT characteristic. | 170 // remote GATT characteristic. |
168 virtual void GattCharacteristicValueChanged( | 171 virtual void GattCharacteristicValueChanged( |
169 BluetoothAdapter* adapter, | 172 BluetoothAdapter* adapter, |
170 BluetoothGattCharacteristic* characteristic, | 173 BluetoothGattCharacteristic* characteristic, |
171 const std::vector<uint8>& value) {} | 174 const std::vector<uint8_t>& value) {} |
172 | 175 |
173 // Called when the value of a characteristic descriptor has been updated. | 176 // Called when the value of a characteristic descriptor has been updated. |
174 virtual void GattDescriptorValueChanged(BluetoothAdapter* adapter, | 177 virtual void GattDescriptorValueChanged(BluetoothAdapter* adapter, |
175 BluetoothGattDescriptor* descriptor, | 178 BluetoothGattDescriptor* descriptor, |
176 const std::vector<uint8>& value) {} | 179 const std::vector<uint8_t>& value) { |
| 180 } |
177 }; | 181 }; |
178 | 182 |
179 // Used to configure a listening servie. | 183 // Used to configure a listening servie. |
180 struct DEVICE_BLUETOOTH_EXPORT ServiceOptions { | 184 struct DEVICE_BLUETOOTH_EXPORT ServiceOptions { |
181 ServiceOptions(); | 185 ServiceOptions(); |
182 ~ServiceOptions(); | 186 ~ServiceOptions(); |
183 | 187 |
184 scoped_ptr<int> channel; | 188 scoped_ptr<int> channel; |
185 scoped_ptr<int> psm; | 189 scoped_ptr<int> psm; |
186 scoped_ptr<std::string> name; | 190 scoped_ptr<std::string> name; |
(...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
525 std::set<BluetoothDiscoverySession*> discovery_sessions_; | 529 std::set<BluetoothDiscoverySession*> discovery_sessions_; |
526 | 530 |
527 // Note: This should remain the last member so it'll be destroyed and | 531 // Note: This should remain the last member so it'll be destroyed and |
528 // invalidate its weak pointers before any other members are destroyed. | 532 // invalidate its weak pointers before any other members are destroyed. |
529 base::WeakPtrFactory<BluetoothAdapter> weak_ptr_factory_; | 533 base::WeakPtrFactory<BluetoothAdapter> weak_ptr_factory_; |
530 }; | 534 }; |
531 | 535 |
532 } // namespace device | 536 } // namespace device |
533 | 537 |
534 #endif // DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_H_ | 538 #endif // DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_H_ |
OLD | NEW |