OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_BLUEZ_BLUETOOTH_DEVICE_BLUEZ_H_ | 5 #ifndef DEVICE_BLUETOOTH_BLUEZ_BLUETOOTH_DEVICE_BLUEZ_H_ |
6 #define DEVICE_BLUETOOTH_BLUEZ_BLUETOOTH_DEVICE_BLUEZ_H_ | 6 #define DEVICE_BLUETOOTH_BLUEZ_BLUETOOTH_DEVICE_BLUEZ_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
11 #include <string> | 11 #include <string> |
| 12 #include <unordered_map> |
12 #include <unordered_set> | 13 #include <unordered_set> |
13 #include <vector> | 14 #include <vector> |
14 | 15 |
15 #include "base/macros.h" | 16 #include "base/macros.h" |
16 #include "base/memory/ref_counted.h" | 17 #include "base/memory/ref_counted.h" |
17 #include "base/memory/weak_ptr.h" | 18 #include "base/memory/weak_ptr.h" |
18 #include "base/sequenced_task_runner.h" | 19 #include "base/sequenced_task_runner.h" |
19 #include "dbus/object_path.h" | 20 #include "dbus/object_path.h" |
20 #include "device/bluetooth/bluetooth_common.h" | 21 #include "device/bluetooth/bluetooth_common.h" |
21 #include "device/bluetooth/bluetooth_device.h" | 22 #include "device/bluetooth/bluetooth_device.h" |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 // data even when a device stops advertising service data. | 113 // data even when a device stops advertising service data. |
113 // 2) BlueZ sends DevicePropertyChanged event separately for each UUID that | 114 // 2) BlueZ sends DevicePropertyChanged event separately for each UUID that |
114 // service data changed. Meaning that UpdateServiceData() might get called | 115 // service data changed. Meaning that UpdateServiceData() might get called |
115 // multiple times when there are multiple UUIDs that service data changed. | 116 // multiple times when there are multiple UUIDs that service data changed. |
116 // 3) When a device update service data for a UUID, BlueZ update data for that | 117 // 3) When a device update service data for a UUID, BlueZ update data for that |
117 // UUID if it is already exist. If not BlueZ adds that data for UUID. | 118 // UUID if it is already exist. If not BlueZ adds that data for UUID. |
118 // This means BlueZ won't remove service data even when a device stops | 119 // This means BlueZ won't remove service data even when a device stops |
119 // advertising service data for a UUID. | 120 // advertising service data for a UUID. |
120 void UpdateServiceData(); | 121 void UpdateServiceData(); |
121 | 122 |
| 123 // Called by BluetoothAdapterBlueZ to update manufacturer_data_ defined in |
| 124 // BluetoothDevice when receive DevicePropertyChanged event for the |
| 125 // manufacturer data property. Note that same BlueZ implementation detail from |
| 126 // UpdateServiceData() also applies here. |
| 127 void UpdateManufacturerData(); |
| 128 |
| 129 // Called by BluetoothAdapterBlueZ to update advertising_data_flags_ defined |
| 130 // in BluetoothDevice when receive DevicePropertyChanged event for the |
| 131 // advertising data flags property. Note that same BlueZ implementation detail |
| 132 // from UpdateServiceData() also applies here. |
| 133 void UpdateAdvertisingDataFlags(); |
| 134 |
122 // Creates a pairing object with the given delegate |pairing_delegate| and | 135 // Creates a pairing object with the given delegate |pairing_delegate| and |
123 // establishes it as the pairing context for this device. All pairing-related | 136 // establishes it as the pairing context for this device. All pairing-related |
124 // method calls will be forwarded to this object until it is released. | 137 // method calls will be forwarded to this object until it is released. |
125 BluetoothPairingBlueZ* BeginPairing( | 138 BluetoothPairingBlueZ* BeginPairing( |
126 BluetoothDevice::PairingDelegate* pairing_delegate); | 139 BluetoothDevice::PairingDelegate* pairing_delegate); |
127 | 140 |
128 // Releases the current pairing object, any pairing-related method calls will | 141 // Releases the current pairing object, any pairing-related method calls will |
129 // be ignored. | 142 // be ignored. |
130 void EndPairing(); | 143 void EndPairing(); |
131 | 144 |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
261 // Note: This should remain the last member so it'll be destroyed and | 274 // Note: This should remain the last member so it'll be destroyed and |
262 // invalidate its weak pointers before any other members are destroyed. | 275 // invalidate its weak pointers before any other members are destroyed. |
263 base::WeakPtrFactory<BluetoothDeviceBlueZ> weak_ptr_factory_; | 276 base::WeakPtrFactory<BluetoothDeviceBlueZ> weak_ptr_factory_; |
264 | 277 |
265 DISALLOW_COPY_AND_ASSIGN(BluetoothDeviceBlueZ); | 278 DISALLOW_COPY_AND_ASSIGN(BluetoothDeviceBlueZ); |
266 }; | 279 }; |
267 | 280 |
268 } // namespace bluez | 281 } // namespace bluez |
269 | 282 |
270 #endif // DEVICE_BLUETOOTH_BLUEZ_BLUETOOTH_DEVICE_BLUEZ_H_ | 283 #endif // DEVICE_BLUETOOTH_BLUEZ_BLUETOOTH_DEVICE_BLUEZ_H_ |
OLD | NEW |