Chromium Code Reviews| Index: chromeos/dbus/fake_bluetooth_device_client.cc |
| diff --git a/chromeos/dbus/fake_bluetooth_device_client.cc b/chromeos/dbus/fake_bluetooth_device_client.cc |
| index 87b6591d9315fdfbf17977704b8ef125e4414c1b..4ec8ce0342cf0033fb33313a0069b819d773d296 100644 |
| --- a/chromeos/dbus/fake_bluetooth_device_client.cc |
| +++ b/chromeos/dbus/fake_bluetooth_device_client.cc |
| @@ -221,7 +221,9 @@ FakeBluetoothDeviceClient::FakeBluetoothDeviceClient() |
| discovery_simulation_step_(0), |
| incoming_pairing_simulation_step_(0), |
| pairing_cancelled_(false), |
| - connection_monitor_started_(false) { |
| + connection_rssi_(0), |
| + transmit_power_(0), |
| + max_transmit_power_(0) { |
|
armansito
2015/01/06 20:36:07
Want to set these to 127 by default?
Tim Song
2015/01/06 22:30:50
Done.
|
| Properties* properties = new Properties(base::Bind( |
| &FakeBluetoothDeviceClient::OnPropertyChanged, |
| base::Unretained(this), |
| @@ -461,21 +463,17 @@ void FakeBluetoothDeviceClient::CancelPairing( |
| callback.Run(); |
| } |
| -void FakeBluetoothDeviceClient::StartConnectionMonitor( |
| +void FakeBluetoothDeviceClient::GetConnInfo( |
| const dbus::ObjectPath& object_path, |
| - const base::Closure& callback, |
| + const ConnInfoCallback& callback, |
| const ErrorCallback& error_callback) { |
| - VLOG(1) << "StartConnectionMonitor: " << object_path.value(); |
| - connection_monitor_started_ = true; |
| - callback.Run(); |
| -} |
| + Properties* properties = GetProperties(object_path); |
| + if (!properties->connected.value()) { |
| + error_callback.Run("org.bluez.Error.NotConnected", "Not Connected"); |
| + return; |
| + } |
| -void FakeBluetoothDeviceClient::StopConnectionMonitor( |
| - const dbus::ObjectPath& object_path, |
| - const base::Closure& callback, |
| - const ErrorCallback& error_callback) { |
| - connection_monitor_started_ = false; |
| - callback.Run(); |
| + callback.Run(connection_rssi_, transmit_power_, max_transmit_power_); |
| } |
| void FakeBluetoothDeviceClient::BeginDiscoverySimulation( |
| @@ -1019,6 +1017,15 @@ void FakeBluetoothDeviceClient::UpdateDeviceRSSI( |
| properties->rssi.ReplaceValue(rssi); |
| } |
| +void FakeBluetoothDeviceClient::UpdateConnectionInfo( |
| + uint16 connection_rssi, |
| + uint16 transmit_power, |
| + uint16 max_transmit_power) { |
| + connection_rssi_ = connection_rssi; |
| + transmit_power_ = transmit_power; |
| + max_transmit_power_ = max_transmit_power; |
| +} |
| + |
| void FakeBluetoothDeviceClient::PinCodeCallback( |
| const dbus::ObjectPath& object_path, |
| const base::Closure& callback, |