OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 DEVICE_BLUETOOTH_DBUS_FAKE_BLUETOOTH_DEVICE_CLIENT_H_ | 5 #ifndef DEVICE_BLUETOOTH_DBUS_FAKE_BLUETOOTH_DEVICE_CLIENT_H_ |
6 #define DEVICE_BLUETOOTH_DBUS_FAKE_BLUETOOTH_DEVICE_CLIENT_H_ | 6 #define DEVICE_BLUETOOTH_DBUS_FAKE_BLUETOOTH_DEVICE_CLIENT_H_ |
7 | 7 |
8 #include <cstdint> | 8 #include <cstdint> |
9 #include <map> | 9 #include <map> |
10 #include <memory> | 10 #include <memory> |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 // by GetConnInfo. | 149 // by GetConnInfo. |
150 void UpdateConnectionInfo(uint16_t connection_rssi, | 150 void UpdateConnectionInfo(uint16_t connection_rssi, |
151 uint16_t transmit_power, | 151 uint16_t transmit_power, |
152 uint16_t max_transmit_power); | 152 uint16_t max_transmit_power); |
153 | 153 |
154 // Test specific functions: | 154 // Test specific functions: |
155 // Remove all test devices from this client. | 155 // Remove all test devices from this client. |
156 void RemoveAllDevices(); | 156 void RemoveAllDevices(); |
157 | 157 |
158 // Create a test Bluetooth device with the given properties. | 158 // Create a test Bluetooth device with the given properties. |
159 void CreateTestDevice(const dbus::ObjectPath& adapter_path, | 159 void CreateTestDevice( |
160 const base::Optional<std::string> name, | 160 const dbus::ObjectPath& adapter_path, |
161 const std::string alias, | 161 const base::Optional<std::string> name, |
162 const std::string device_address, | 162 const std::string alias, |
163 const std::vector<std::string>& service_uuids, | 163 const std::string device_address, |
164 device::BluetoothTransport type); | 164 const std::vector<std::string>& service_uuids, |
| 165 device::BluetoothTransport type, |
| 166 const std::unordered_map<std::string, std::vector<uint8_t>>& |
| 167 service_data); |
165 | 168 |
166 void set_delay_start_discovery(bool value) { delay_start_discovery_ = value; } | 169 void set_delay_start_discovery(bool value) { delay_start_discovery_ = value; } |
167 | 170 |
168 // Updates the inquiry RSSI property of fake device with object path | 171 // Updates the inquiry RSSI property of fake device with object path |
169 // |object_path| to |rssi|, if the fake device exists. | 172 // |object_path| to |rssi|, if the fake device exists. |
170 void UpdateDeviceRSSI(const dbus::ObjectPath& object_path, int16_t rssi); | 173 void UpdateDeviceRSSI(const dbus::ObjectPath& object_path, int16_t rssi); |
171 | 174 |
| 175 // Updates the service data property of fake device with object path |
| 176 // |object_path| to merge |service_data| into the existing data, |
| 177 // if the fake device exists. |
| 178 void UpdateServiceData( |
| 179 const dbus::ObjectPath& object_path, |
| 180 const std::unordered_map<std::string, std::vector<uint8_t>>& |
| 181 service_data); |
| 182 |
172 static const char kTestPinCode[]; | 183 static const char kTestPinCode[]; |
173 static const int kTestPassKey; | 184 static const int kTestPassKey; |
174 | 185 |
175 static const char kPairingMethodNone[]; | 186 static const char kPairingMethodNone[]; |
176 static const char kPairingMethodPinCode[]; | 187 static const char kPairingMethodPinCode[]; |
177 static const char kPairingMethodPassKey[]; | 188 static const char kPairingMethodPassKey[]; |
178 | 189 |
179 static const char kPairingActionConfirmation[]; | 190 static const char kPairingActionConfirmation[]; |
180 static const char kPairingActionDisplay[]; | 191 static const char kPairingActionDisplay[]; |
181 static const char kPairingActionFail[]; | 192 static const char kPairingActionFail[]; |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
345 int16_t max_transmit_power_; | 356 int16_t max_transmit_power_; |
346 | 357 |
347 // Controls the fake behavior to allow more extensive UI testing without | 358 // Controls the fake behavior to allow more extensive UI testing without |
348 // having to cycle the discovery simulation. | 359 // having to cycle the discovery simulation. |
349 bool delay_start_discovery_; | 360 bool delay_start_discovery_; |
350 }; | 361 }; |
351 | 362 |
352 } // namespace bluez | 363 } // namespace bluez |
353 | 364 |
354 #endif // DEVICE_BLUETOOTH_DBUS_FAKE_BLUETOOTH_DEVICE_CLIENT_H_ | 365 #endif // DEVICE_BLUETOOTH_DBUS_FAKE_BLUETOOTH_DEVICE_CLIENT_H_ |
OLD | NEW |