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> |
11 #include <memory> | 11 #include <memory> |
12 #include <string> | 12 #include <string> |
13 #include <vector> | 13 #include <vector> |
14 | 14 |
15 #include "base/callback.h" | 15 #include "base/callback.h" |
16 #include "components/arc/arc_bridge_service.h" | 16 #include "components/arc/arc_bridge_service.h" |
17 #include "components/arc/arc_service.h" | 17 #include "components/arc/arc_service.h" |
18 #include "components/arc/common/bluetooth.mojom.h" | 18 #include "components/arc/common/bluetooth.mojom.h" |
19 #include "device/bluetooth/bluetooth_adapter.h" | 19 #include "device/bluetooth/bluetooth_adapter.h" |
20 #include "device/bluetooth/bluetooth_adapter_factory.h" | 20 #include "device/bluetooth/bluetooth_adapter_factory.h" |
21 #include "device/bluetooth/bluetooth_device.h" | 21 #include "device/bluetooth/bluetooth_device.h" |
22 #include "device/bluetooth/bluetooth_discovery_session.h" | 22 #include "device/bluetooth/bluetooth_discovery_session.h" |
23 #include "device/bluetooth/bluetooth_remote_gatt_characteristic.h" | 23 #include "device/bluetooth/bluetooth_remote_gatt_characteristic.h" |
24 #include "device/bluetooth/bluetooth_remote_gatt_descriptor.h" | 24 #include "device/bluetooth/bluetooth_remote_gatt_descriptor.h" |
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 "device/bluetooth/bluez/bluetooth_service_record_bluez.h" |
27 #include "mojo/public/cpp/bindings/binding.h" | 28 #include "mojo/public/cpp/bindings/binding.h" |
28 | 29 |
29 namespace arc { | 30 namespace arc { |
30 | 31 |
31 class ArcBridgeService; | 32 class ArcBridgeService; |
32 | 33 |
33 class ArcBluetoothBridge | 34 class ArcBluetoothBridge |
34 : public ArcService, | 35 : public ArcService, |
35 public ArcBridgeService::Observer, | 36 public ArcBridgeService::Observer, |
36 public device::BluetoothAdapter::Observer, | 37 public device::BluetoothAdapter::Observer, |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 mojom::BluetoothGattIDPtr char_id, | 184 mojom::BluetoothGattIDPtr char_id, |
184 const RegisterForGattNotificationCallback& callback) override; | 185 const RegisterForGattNotificationCallback& callback) override; |
185 void DeregisterForGattNotification( | 186 void DeregisterForGattNotification( |
186 mojom::BluetoothAddressPtr remote_addr, | 187 mojom::BluetoothAddressPtr remote_addr, |
187 mojom::BluetoothGattServiceIDPtr service_id, | 188 mojom::BluetoothGattServiceIDPtr service_id, |
188 mojom::BluetoothGattIDPtr char_id, | 189 mojom::BluetoothGattIDPtr char_id, |
189 const DeregisterForGattNotificationCallback& callback) override; | 190 const DeregisterForGattNotificationCallback& callback) override; |
190 void ReadRemoteRssi(mojom::BluetoothAddressPtr remote_addr, | 191 void ReadRemoteRssi(mojom::BluetoothAddressPtr remote_addr, |
191 const ReadRemoteRssiCallback& callback) override; | 192 const ReadRemoteRssiCallback& callback) override; |
192 | 193 |
| 194 // Bluetooth Mojo host interface - Bluetooth SDP functions |
| 195 void GetSdpRecords(mojom::BluetoothAddressPtr remote_addr, |
| 196 const GetSdpRecordsCallback& callback) override; |
| 197 void CreateSdpRecord(mojom::BluetoothSdpRecordPtr record, |
| 198 const CreateSdpRecordCallback& callback) override; |
| 199 void RemoveSdpRecord(uint32_t service_handle, |
| 200 const RemoveSdpRecordCallback& callback) override; |
| 201 |
193 // Chrome observer callbacks | 202 // Chrome observer callbacks |
194 void OnPoweredOn( | 203 void OnPoweredOn( |
195 const base::Callback<void(mojom::BluetoothAdapterState)>& callback) const; | 204 const base::Callback<void(mojom::BluetoothAdapterState)>& callback) const; |
196 void OnPoweredOff( | 205 void OnPoweredOff( |
197 const base::Callback<void(mojom::BluetoothAdapterState)>& callback) const; | 206 const base::Callback<void(mojom::BluetoothAdapterState)>& callback) const; |
198 void OnPoweredError( | 207 void OnPoweredError( |
199 const base::Callback<void(mojom::BluetoothAdapterState)>& callback) const; | 208 const base::Callback<void(mojom::BluetoothAdapterState)>& callback) const; |
200 void OnDiscoveryStarted( | 209 void OnDiscoveryStarted( |
201 std::unique_ptr<device::BluetoothDiscoverySession> session); | 210 std::unique_ptr<device::BluetoothDiscoverySession> session); |
202 void OnDiscoveryStopped(); | 211 void OnDiscoveryStopped(); |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
293 | 302 |
294 // WeakPtrFactory to use for callbacks. | 303 // WeakPtrFactory to use for callbacks. |
295 base::WeakPtrFactory<ArcBluetoothBridge> weak_factory_; | 304 base::WeakPtrFactory<ArcBluetoothBridge> weak_factory_; |
296 | 305 |
297 DISALLOW_COPY_AND_ASSIGN(ArcBluetoothBridge); | 306 DISALLOW_COPY_AND_ASSIGN(ArcBluetoothBridge); |
298 }; | 307 }; |
299 | 308 |
300 } // namespace arc | 309 } // namespace arc |
301 | 310 |
302 #endif // COMPONENTS_ARC_BLUETOOTH_ARC_BLUETOOTH_BRIDGE_H_ | 311 #endif // COMPONENTS_ARC_BLUETOOTH_ARC_BLUETOOTH_BRIDGE_H_ |
OLD | NEW |