OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 COMPONENTS_ARC_BLUETOOTH_ARC_BLUETOOTH_BRIDGE_H_ | 5 #ifndef COMPONENTS_ARC_BLUETOOTH_ARC_BLUETOOTH_BRIDGE_H_ |
6 #define COMPONENTS_ARC_BLUETOOTH_ARC_BLUETOOTH_BRIDGE_H_ | 6 #define COMPONENTS_ARC_BLUETOOTH_ARC_BLUETOOTH_BRIDGE_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <map> | 10 #include <map> |
(...skipping 14 matching lines...) Expand all Loading... |
25 #include "device/bluetooth/bluetooth_remote_gatt_service.h" | 25 #include "device/bluetooth/bluetooth_remote_gatt_service.h" |
26 #include "device/bluetooth/bluez/bluetooth_adapter_bluez.h" | 26 #include "device/bluetooth/bluez/bluetooth_adapter_bluez.h" |
27 #include "mojo/public/cpp/bindings/binding.h" | 27 #include "mojo/public/cpp/bindings/binding.h" |
28 | 28 |
29 namespace arc { | 29 namespace arc { |
30 | 30 |
31 class ArcBridgeService; | 31 class ArcBridgeService; |
32 | 32 |
33 class ArcBluetoothBridge | 33 class ArcBluetoothBridge |
34 : public ArcService, | 34 : public ArcService, |
35 public ArcBridgeService::Observer, | 35 public ArcBridgeService::InstanceObserver<mojom::BluetoothInstance>, |
36 public device::BluetoothAdapter::Observer, | 36 public device::BluetoothAdapter::Observer, |
37 public device::BluetoothAdapterFactory::AdapterCallback, | 37 public device::BluetoothAdapterFactory::AdapterCallback, |
38 public mojom::BluetoothHost { | 38 public mojom::BluetoothHost { |
39 public: | 39 public: |
40 explicit ArcBluetoothBridge(ArcBridgeService* bridge_service); | 40 explicit ArcBluetoothBridge(ArcBridgeService* bridge_service); |
41 ~ArcBluetoothBridge() override; | 41 ~ArcBluetoothBridge() override; |
42 | 42 |
43 // Overridden from ArcBridgeService::Observer: | 43 // Overridden from |
44 void OnBluetoothInstanceReady() override; | 44 // ArcBridgeService::InstanceObserver<mojom::BluetoothInstance>: |
| 45 void OnInstanceReady(mojom::BluetoothInstance* bluetooth_instance, |
| 46 uint32_t version) override; |
45 | 47 |
46 void OnAdapterInitialized(scoped_refptr<device::BluetoothAdapter> adapter); | 48 void OnAdapterInitialized(scoped_refptr<device::BluetoothAdapter> adapter); |
47 | 49 |
48 // Overridden from device::BluetoothAdadpter::Observer | 50 // Overridden from device::BluetoothAdadpter::Observer |
49 void AdapterPresentChanged(device::BluetoothAdapter* adapter, | 51 void AdapterPresentChanged(device::BluetoothAdapter* adapter, |
50 bool present) override; | 52 bool present) override; |
51 | 53 |
52 void AdapterPoweredChanged(device::BluetoothAdapter* adapter, | 54 void AdapterPoweredChanged(device::BluetoothAdapter* adapter, |
53 bool powered) override; | 55 bool powered) override; |
54 | 56 |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
257 mojo::Array<mojom::BluetoothPropertyPtr> GetDeviceProperties( | 259 mojo::Array<mojom::BluetoothPropertyPtr> GetDeviceProperties( |
258 mojom::BluetoothPropertyType type, | 260 mojom::BluetoothPropertyType type, |
259 device::BluetoothDevice* device) const; | 261 device::BluetoothDevice* device) const; |
260 mojo::Array<mojom::BluetoothPropertyPtr> GetAdapterProperties( | 262 mojo::Array<mojom::BluetoothPropertyPtr> GetAdapterProperties( |
261 mojom::BluetoothPropertyType type) const; | 263 mojom::BluetoothPropertyType type) const; |
262 mojo::Array<mojom::BluetoothAdvertisingDataPtr> GetAdvertisingData( | 264 mojo::Array<mojom::BluetoothAdvertisingDataPtr> GetAdvertisingData( |
263 device::BluetoothDevice* device) const; | 265 device::BluetoothDevice* device) const; |
264 | 266 |
265 void SendCachedDevicesFound() const; | 267 void SendCachedDevicesFound() const; |
266 bool HasBluetoothInstance() const; | 268 bool HasBluetoothInstance() const; |
267 bool CheckBluetoothInstanceVersion(int32_t version_need) const; | 269 bool CheckBluetoothInstanceVersion(uint32_t version_need) const; |
268 | 270 |
269 template <class T> | 271 template <class T> |
270 T* FindGattObjectFromUuid(const std::vector<T*> objs, | 272 T* FindGattObjectFromUuid(const std::vector<T*> objs, |
271 const device::BluetoothUUID uuid) const; | 273 const device::BluetoothUUID uuid) const; |
272 device::BluetoothRemoteGattCharacteristic* FindGattCharacteristic( | 274 device::BluetoothRemoteGattCharacteristic* FindGattCharacteristic( |
273 mojom::BluetoothAddressPtr remote_addr, | 275 mojom::BluetoothAddressPtr remote_addr, |
274 mojom::BluetoothGattServiceIDPtr service_id, | 276 mojom::BluetoothGattServiceIDPtr service_id, |
275 mojom::BluetoothGattIDPtr char_id) const; | 277 mojom::BluetoothGattIDPtr char_id) const; |
276 | 278 |
277 device::BluetoothRemoteGattDescriptor* FindGattDescriptor( | 279 device::BluetoothRemoteGattDescriptor* FindGattDescriptor( |
(...skipping 15 matching lines...) Expand all Loading... |
293 | 295 |
294 // WeakPtrFactory to use for callbacks. | 296 // WeakPtrFactory to use for callbacks. |
295 base::WeakPtrFactory<ArcBluetoothBridge> weak_factory_; | 297 base::WeakPtrFactory<ArcBluetoothBridge> weak_factory_; |
296 | 298 |
297 DISALLOW_COPY_AND_ASSIGN(ArcBluetoothBridge); | 299 DISALLOW_COPY_AND_ASSIGN(ArcBluetoothBridge); |
298 }; | 300 }; |
299 | 301 |
300 } // namespace arc | 302 } // namespace arc |
301 | 303 |
302 #endif // COMPONENTS_ARC_BLUETOOTH_ARC_BLUETOOTH_BRIDGE_H_ | 304 #endif // COMPONENTS_ARC_BLUETOOTH_ARC_BLUETOOTH_BRIDGE_H_ |
OLD | NEW |