OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 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 | 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 #include "device/bluetooth/test/fake_peripheral.h" | 5 #include "device/bluetooth/test/fake_peripheral.h" |
6 | 6 |
7 namespace bluetooth { | 7 namespace bluetooth { |
8 | 8 |
9 FakePeripheral::FakePeripheral(FakeCentral* fake_central, | 9 FakePeripheral::FakePeripheral(FakeCentral* fake_central, |
10 const std::string& address) | 10 const std::string& address) |
11 : device::BluetoothDevice(fake_central), | 11 : device::BluetoothDevice(fake_central), |
12 address_(address), | 12 address_(address), |
13 gatt_connected_(false) {} | 13 gatt_connected_(false) {} |
14 | 14 |
15 FakePeripheral::~FakePeripheral() {} | 15 FakePeripheral::~FakePeripheral() {} |
16 | 16 |
17 void FakePeripheral::SetName(base::Optional<std::string> name) { | 17 void FakePeripheral::SetName(base::Optional<std::string> name) { |
18 name_ = name; | 18 name_ = std::move(name); |
19 } | 19 } |
20 | 20 |
21 void FakePeripheral::SetGattConnected(bool connected) { | 21 void FakePeripheral::SetGattConnected(bool connected) { |
22 gatt_connected_ = connected; | 22 gatt_connected_ = connected; |
23 } | 23 } |
24 | 24 |
| 25 void FakePeripheral::SetServiceUUIDs(UUIDSet service_uuids) { |
| 26 service_uuids_ = std::move(service_uuids); |
| 27 } |
| 28 |
25 uint32_t FakePeripheral::GetBluetoothClass() const { | 29 uint32_t FakePeripheral::GetBluetoothClass() const { |
26 NOTREACHED(); | 30 NOTREACHED(); |
27 return 0; | 31 return 0; |
28 } | 32 } |
29 | 33 |
30 #if defined(OS_CHROMEOS) || defined(OS_LINUX) | 34 #if defined(OS_CHROMEOS) || defined(OS_LINUX) |
31 device::BluetoothTransport FakePeripheral::GetType() const { | 35 device::BluetoothTransport FakePeripheral::GetType() const { |
32 NOTREACHED(); | 36 NOTREACHED(); |
33 return device::BLUETOOTH_TRANSPORT_INVALID; | 37 return device::BLUETOOTH_TRANSPORT_INVALID; |
34 } | 38 } |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 NOTREACHED(); | 99 NOTREACHED(); |
96 return false; | 100 return false; |
97 } | 101 } |
98 | 102 |
99 bool FakePeripheral::IsConnecting() const { | 103 bool FakePeripheral::IsConnecting() const { |
100 NOTREACHED(); | 104 NOTREACHED(); |
101 return false; | 105 return false; |
102 } | 106 } |
103 | 107 |
104 device::BluetoothDevice::UUIDSet FakePeripheral::GetUUIDs() const { | 108 device::BluetoothDevice::UUIDSet FakePeripheral::GetUUIDs() const { |
105 return UUIDSet(); | 109 return service_uuids_; |
106 } | 110 } |
107 | 111 |
108 bool FakePeripheral::ExpectingPinCode() const { | 112 bool FakePeripheral::ExpectingPinCode() const { |
109 NOTREACHED(); | 113 NOTREACHED(); |
110 return false; | 114 return false; |
111 } | 115 } |
112 | 116 |
113 bool FakePeripheral::ExpectingPasskey() const { | 117 bool FakePeripheral::ExpectingPasskey() const { |
114 NOTREACHED(); | 118 NOTREACHED(); |
115 return false; | 119 return false; |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 } | 179 } |
176 | 180 |
177 void FakePeripheral::CreateGattConnectionImpl() { | 181 void FakePeripheral::CreateGattConnectionImpl() { |
178 NOTREACHED(); | 182 NOTREACHED(); |
179 } | 183 } |
180 | 184 |
181 void FakePeripheral::DisconnectGatt() { | 185 void FakePeripheral::DisconnectGatt() { |
182 NOTREACHED(); | 186 NOTREACHED(); |
183 } | 187 } |
184 } // namespace bluetooth | 188 } // namespace bluetooth |
OLD | NEW |