Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(766)

Side by Side Diff: components/arc/bluetooth/arc_bluetooth_bridge.h

Issue 2149713002: arc: bluetooth: Add SDP host side support (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update bluetooth.mojom and change type converter accordingly Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 <memory> 10 #include <memory>
11 #include <string> 11 #include <string>
12 #include <unordered_map> 12 #include <unordered_map>
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 "components/arc/instance_holder.h" 19 #include "components/arc/instance_holder.h"
20 #include "device/bluetooth/bluetooth_adapter.h" 20 #include "device/bluetooth/bluetooth_adapter.h"
21 #include "device/bluetooth/bluetooth_adapter_factory.h" 21 #include "device/bluetooth/bluetooth_adapter_factory.h"
22 #include "device/bluetooth/bluetooth_device.h" 22 #include "device/bluetooth/bluetooth_device.h"
23 #include "device/bluetooth/bluetooth_discovery_session.h" 23 #include "device/bluetooth/bluetooth_discovery_session.h"
24 #include "device/bluetooth/bluetooth_local_gatt_service.h" 24 #include "device/bluetooth/bluetooth_local_gatt_service.h"
25 #include "device/bluetooth/bluetooth_remote_gatt_characteristic.h" 25 #include "device/bluetooth/bluetooth_remote_gatt_characteristic.h"
26 #include "device/bluetooth/bluetooth_remote_gatt_descriptor.h" 26 #include "device/bluetooth/bluetooth_remote_gatt_descriptor.h"
27 #include "device/bluetooth/bluetooth_remote_gatt_service.h" 27 #include "device/bluetooth/bluetooth_remote_gatt_service.h"
28 #include "device/bluetooth/bluez/bluetooth_adapter_bluez.h" 28 #include "device/bluetooth/bluez/bluetooth_adapter_bluez.h"
29 #include "device/bluetooth/bluez/bluetooth_service_record_bluez.h"
rkc 2016/07/27 01:34:56 Not needed?
Miao 2016/08/10 15:32:20 Done.
29 #include "mojo/public/cpp/bindings/binding.h" 30 #include "mojo/public/cpp/bindings/binding.h"
30 31
31 namespace arc { 32 namespace arc {
32 33
33 class ArcBridgeService; 34 class ArcBridgeService;
34 35
35 class ArcBluetoothBridge 36 class ArcBluetoothBridge
36 : public ArcService, 37 : public ArcService,
37 public InstanceHolder<mojom::BluetoothInstance>::Observer, 38 public InstanceHolder<mojom::BluetoothInstance>::Observer,
38 public device::BluetoothAdapter::Observer, 39 public device::BluetoothAdapter::Observer,
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 // Delete a local service. 259 // Delete a local service.
259 void DeleteService(int32_t service_handle, 260 void DeleteService(int32_t service_handle,
260 const DeleteServiceCallback& callback) override; 261 const DeleteServiceCallback& callback) override;
261 // Send value indication to a remote device. 262 // Send value indication to a remote device.
262 void SendIndication(int32_t attribute_handle, 263 void SendIndication(int32_t attribute_handle,
263 mojom::BluetoothAddressPtr address, 264 mojom::BluetoothAddressPtr address,
264 bool confirm, 265 bool confirm,
265 mojo::Array<uint8_t> value, 266 mojo::Array<uint8_t> value,
266 const SendIndicationCallback& callback) override; 267 const SendIndicationCallback& callback) override;
267 268
269 // Bluetooth Mojo host interface - Bluetooth SDP functions
270 void GetSdpRecords(mojom::BluetoothAddressPtr remote_addr,
271 const GetSdpRecordsCallback& callback) override;
272 void CreateSdpRecord(mojom::BluetoothSdpRecordPtr record,
273 const CreateSdpRecordCallback& callback) override;
274 void RemoveSdpRecord(uint32_t service_handle,
275 const RemoveSdpRecordCallback& callback) override;
276
268 // Chrome observer callbacks 277 // Chrome observer callbacks
269 void OnPoweredOn( 278 void OnPoweredOn(
270 const base::Callback<void(mojom::BluetoothAdapterState)>& callback) const; 279 const base::Callback<void(mojom::BluetoothAdapterState)>& callback) const;
271 void OnPoweredOff( 280 void OnPoweredOff(
272 const base::Callback<void(mojom::BluetoothAdapterState)>& callback) const; 281 const base::Callback<void(mojom::BluetoothAdapterState)>& callback) const;
273 void OnPoweredError( 282 void OnPoweredError(
274 const base::Callback<void(mojom::BluetoothAdapterState)>& callback) const; 283 const base::Callback<void(mojom::BluetoothAdapterState)>& callback) const;
275 void OnDiscoveryStarted( 284 void OnDiscoveryStarted(
276 std::unique_ptr<device::BluetoothDiscoverySession> session); 285 std::unique_ptr<device::BluetoothDiscoverySession> session);
277 void OnDiscoveryStopped(); 286 void OnDiscoveryStopped();
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
382 391
383 // WeakPtrFactory to use for callbacks. 392 // WeakPtrFactory to use for callbacks.
384 base::WeakPtrFactory<ArcBluetoothBridge> weak_factory_; 393 base::WeakPtrFactory<ArcBluetoothBridge> weak_factory_;
385 394
386 DISALLOW_COPY_AND_ASSIGN(ArcBluetoothBridge); 395 DISALLOW_COPY_AND_ASSIGN(ArcBluetoothBridge);
387 }; 396 };
388 397
389 } // namespace arc 398 } // namespace arc
390 399
391 #endif // COMPONENTS_ARC_BLUETOOTH_ARC_BLUETOOTH_BRIDGE_H_ 400 #endif // COMPONENTS_ARC_BLUETOOTH_ARC_BLUETOOTH_BRIDGE_H_
OLDNEW
« no previous file with comments | « no previous file | components/arc/bluetooth/arc_bluetooth_bridge.cc » ('j') | components/arc/bluetooth/arc_bluetooth_bridge.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698