| 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 #include "device/bluetooth/dbus/fake_bluetooth_device_client.h" | 5 #include "device/bluetooth/dbus/fake_bluetooth_device_client.h" |
| 6 | 6 |
| 7 #include <fcntl.h> | 7 #include <fcntl.h> |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <sys/socket.h> | 9 #include <sys/socket.h> |
| 10 #include <sys/types.h> | 10 #include <sys/types.h> |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 #include "device/bluetooth/dbus/fake_bluetooth_input_client.h" | 35 #include "device/bluetooth/dbus/fake_bluetooth_input_client.h" |
| 36 #include "device/bluetooth/dbus/fake_bluetooth_profile_manager_client.h" | 36 #include "device/bluetooth/dbus/fake_bluetooth_profile_manager_client.h" |
| 37 #include "device/bluetooth/dbus/fake_bluetooth_profile_service_provider.h" | 37 #include "device/bluetooth/dbus/fake_bluetooth_profile_service_provider.h" |
| 38 #include "third_party/cros_system_api/dbus/service_constants.h" | 38 #include "third_party/cros_system_api/dbus/service_constants.h" |
| 39 | 39 |
| 40 namespace bluez { | 40 namespace bluez { |
| 41 | 41 |
| 42 namespace { | 42 namespace { |
| 43 | 43 |
| 44 // Default interval between simulated events. | 44 // Default interval between simulated events. |
| 45 const int kSimulationIntervalMs = 750; | 45 const int kSimulationIntervalMs = 500; |
| 46 | 46 |
| 47 // Minimum and maximum bounds for randomly generated RSSI values. | 47 // Minimum and maximum bounds for randomly generated RSSI values. |
| 48 const int kMinRSSI = -90; | 48 const int kMinRSSI = -90; |
| 49 const int kMaxRSSI = -30; | 49 const int kMaxRSSI = -30; |
| 50 | 50 |
| 51 // The default value of connection info properties from GetConnInfo(). | 51 // The default value of connection info properties from GetConnInfo(). |
| 52 const int kUnkownPower = 127; | 52 const int kUnkownPower = 127; |
| 53 | 53 |
| 54 // This is meant to delay the removal of a pre defined device until the | 54 // This is meant to delay the removal of a pre defined device until the |
| 55 // developer has time to see it. | 55 // developer has time to see it. |
| 56 const int kVanishingDevicePairTimeMultiplier = 4; | 56 const int kVanishingDevicePairTimeMultiplier = 4; |
| 57 | 57 |
| 58 // Meant to delay a pair request for an observable amount of time. | 58 // Meant to delay a pair request for an observable amount of time. |
| 59 const int kIncomingSimulationPairTimeMultiplier = 45; | 59 const int kIncomingSimulationPairTimeMultiplier = 5; |
| 60 | 60 |
| 61 // Meant to delay a request that asks for pair requests for an observable | 61 // Meant to delay a request that asks for pair requests for an observable |
| 62 // amount of time. | 62 // amount of time. |
| 63 const int kIncomingSimulationStartPairTimeMultiplier = 30; | 63 const int kIncomingSimulationStartPairTimeMultiplier = 10; |
| 64 | 64 |
| 65 // This allows the PIN code dialog to be shown for a long enough time to see | 65 // This allows the PIN code dialog to be shown for a long enough time to see |
| 66 // the PIN code UI in detail. | 66 // the PIN code UI in detail. |
| 67 const int kPinCodeDevicePairTimeMultiplier = 7; | 67 const int kPinCodeDevicePairTimeMultiplier = 7; |
| 68 | 68 |
| 69 // This allows the pairing dialog to be shown for a long enough time to see | 69 // This allows the pairing dialog to be shown for a long enough time to see |
| 70 // its UI in detail. | 70 // its UI in detail. |
| 71 const int kSimulateNormalPairTimeMultiplier = 3; | 71 const int kSimulateNormalPairTimeMultiplier = 3; |
| 72 | 72 |
| 73 void SimulatedProfileSocket(int fd) { | 73 void SimulatedProfileSocket(int fd) { |
| (...skipping 1736 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1810 } | 1810 } |
| 1811 properties->type.set_valid(true); | 1811 properties->type.set_valid(true); |
| 1812 | 1812 |
| 1813 properties_map_.insert(std::make_pair(device_path, std::move(properties))); | 1813 properties_map_.insert(std::make_pair(device_path, std::move(properties))); |
| 1814 device_list_.push_back(device_path); | 1814 device_list_.push_back(device_path); |
| 1815 for (auto& observer : observers_) | 1815 for (auto& observer : observers_) |
| 1816 observer.DeviceAdded(device_path); | 1816 observer.DeviceAdded(device_path); |
| 1817 } | 1817 } |
| 1818 | 1818 |
| 1819 } // namespace bluez | 1819 } // namespace bluez |
| OLD | NEW |