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

Side by Side Diff: device/bluetooth/test/fake_le_central_observer_manager.h

Issue 2853433002: bluetooth: Implement simulateCentral (Closed)
Patch Set: even moar cleanup Created 3 years, 7 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
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 #ifndef DEVICE_BLUETOOTH_TEST_FAKE_LE_CENTRAL_OBSERVER_MANAGER_H_
5 #define DEVICE_BLUETOOTH_TEST_FAKE_LE_CENTRAL_OBSERVER_MANAGER_H_
6
7 #include "base/compiler_specific.h"
8 #include "device/bluetooth/bluetooth_adapter.h"
9 #include "device/bluetooth/public/interfaces/test/fake_bluetooth.mojom.h"
10 #include "mojo/public/cpp/bindings/binding.h"
11
12 namespace bluetooth {
13
14 // Implementation of FakeLECentralObserverManager in
15 // src/device/bluetooth/public/interfaces/test/fake_bluetooth.mojom.
16 // Implemented on top of the C++ device/bluetooth API, mainly
17 // device/bluetooth/bluetooth_adapter.h.
18 class FakeLECentralObserverManager
19 : NON_EXPORTED_BASE(public mojom::FakeLECentralObserverManager),
20 public device::BluetoothAdapter {
21 public:
22 FakeLECentralObserverManager(
23 mojom::LECentralObserverManagerState state,
24 mojom::FakeLECentralObserverManagerRequest request);
25
26 // BluetoothAdapter overrides:
27 std::string GetAddress() const override;
28 std::string GetName() const override;
29 void SetName(const std::string& name,
30 const base::Closure& callback,
31 const ErrorCallback& error_callback) override;
32 bool IsInitialized() const override;
33 bool IsPresent() const override;
34 bool IsPowered() const override;
35 void SetPowered(bool powered,
36 const base::Closure& callback,
37 const ErrorCallback& error_callback) override;
38 bool IsDiscoverable() const override;
39 void SetDiscoverable(bool discoverable,
40 const base::Closure& callback,
41 const ErrorCallback& error_callback) override;
42 bool IsDiscovering() const override;
43 UUIDList GetUUIDs() const override;
44 void CreateRfcommService(
45 const device::BluetoothUUID& uuid,
46 const ServiceOptions& options,
47 const CreateServiceCallback& callback,
48 const CreateServiceErrorCallback& error_callback) override;
49 void CreateL2capService(
50 const device::BluetoothUUID& uuid,
51 const ServiceOptions& options,
52 const CreateServiceCallback& callback,
53 const CreateServiceErrorCallback& error_callback) override;
54 void RegisterAdvertisement(
55 std::unique_ptr<device::BluetoothAdvertisement::Data> advertisement_data,
56 const CreateAdvertisementCallback& callback,
57 const AdvertisementErrorCallback& error_callback) override;
58 #if defined(OS_CHROMEOS) || defined(OS_LINUX)
59 void SetAdvertisingInterval(
60 const base::TimeDelta& min,
61 const base::TimeDelta& max,
62 const base::Closure& callback,
63 const AdvertisementErrorCallback& error_callback) override;
64 #endif
65 device::BluetoothLocalGattService* GetGattService(
66 const std::string& identifier) const override;
67 void AddDiscoverySession(
68 device::BluetoothDiscoveryFilter* discovery_filter,
69 const base::Closure& callback,
70 const DiscoverySessionErrorCallback& error_callback) override;
71 void RemoveDiscoverySession(
72 device::BluetoothDiscoveryFilter* discovery_filter,
73 const base::Closure& callback,
74 const DiscoverySessionErrorCallback& error_callback) override;
75 void SetDiscoveryFilter(
76 std::unique_ptr<device::BluetoothDiscoveryFilter> discovery_filter,
77 const base::Closure& callback,
78 const DiscoverySessionErrorCallback& error_callback) override;
79 void RemovePairingDelegateInternal(
80 device::BluetoothDevice::PairingDelegate* pairing_delegate) override;
81
82 private:
83 ~FakeLECentralObserverManager() override;
84
85 mojom::LECentralObserverManagerState state_;
86 mojo::Binding<mojom::FakeLECentralObserverManager> binding_;
87 };
88
89 } // namespace bluetooth
90
91 #endif // DEVICE_BLUETOOTH_TEST_FAKE_LE_CENTRAL_OBSERVER_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698