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

Unified Diff: chromeos/dbus/fake_bluetooth_device_client.cc

Issue 273953002: Hook up RSSI and host transmit power Bluetooth device properties for ChromeOS. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
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 44b9a0b5a407c01a8cab726157522e528e16cbc0..ffe01f094ef4742113715c78f8c85558d0db636e 100644
--- a/chromeos/dbus/fake_bluetooth_device_client.cc
+++ b/chromeos/dbus/fake_bluetooth_device_client.cc
@@ -220,7 +220,8 @@ FakeBluetoothDeviceClient::FakeBluetoothDeviceClient()
: simulation_interval_ms_(kSimulationIntervalMs),
discovery_simulation_step_(0),
incoming_pairing_simulation_step_(0),
- pairing_cancelled_(false) {
+ pairing_cancelled_(false),
+ connection_monitor_started_(false) {
Properties* properties = new Properties(base::Bind(
&FakeBluetoothDeviceClient::OnPropertyChanged,
base::Unretained(this),
@@ -459,6 +460,22 @@ void FakeBluetoothDeviceClient::CancelPairing(
callback.Run();
}
+void FakeBluetoothDeviceClient::StartConnectionMonitor(
+ const dbus::ObjectPath& object_path,
+ const base::Closure& callback,
+ const ErrorCallback& error_callback) {
+ VLOG(1) << "StartConnectionMonitor: " << object_path.value();
+ connection_monitor_started_ = true;
+ callback.Run();
+}
+
+void FakeBluetoothDeviceClient::StopConnectionMonitor(
+ const dbus::ObjectPath& object_path,
+ const base::Closure& callback,
+ const ErrorCallback& error_callback) {
+ connection_monitor_started_ = false;
+ callback.Run();
+}
void FakeBluetoothDeviceClient::BeginDiscoverySimulation(
const dbus::ObjectPath& adapter_path) {
@@ -681,22 +698,22 @@ void FakeBluetoothDeviceClient::DiscoverySimulationTimer() {
dbus::ObjectPath(kDisplayPinCodePath));
CreateDevice(dbus::ObjectPath(FakeBluetoothAdapterClient::kAdapterPath),
dbus::ObjectPath(kVanishingDevicePath));
- UpdateDeviceRSSI(dbus::ObjectPath(kLowEnergyPath),
- base::RandInt(kMinRSSI, kMaxRSSI));
+ UpdateInquiryRSSI(dbus::ObjectPath(kLowEnergyPath),
+ base::RandInt(kMinRSSI, kMaxRSSI));
} else if (discovery_simulation_step_ == 7) {
CreateDevice(dbus::ObjectPath(FakeBluetoothAdapterClient::kAdapterPath),
dbus::ObjectPath(kConnectUnpairablePath));
- UpdateDeviceRSSI(dbus::ObjectPath(kLowEnergyPath),
- base::RandInt(kMinRSSI, kMaxRSSI));
+ UpdateInquiryRSSI(dbus::ObjectPath(kLowEnergyPath),
+ base::RandInt(kMinRSSI, kMaxRSSI));
} else if (discovery_simulation_step_ == 8) {
CreateDevice(dbus::ObjectPath(FakeBluetoothAdapterClient::kAdapterPath),
dbus::ObjectPath(kDisplayPasskeyPath));
CreateDevice(dbus::ObjectPath(FakeBluetoothAdapterClient::kAdapterPath),
dbus::ObjectPath(kRequestPinCodePath));
- UpdateDeviceRSSI(dbus::ObjectPath(kLowEnergyPath),
- base::RandInt(kMinRSSI, kMaxRSSI));
+ UpdateInquiryRSSI(dbus::ObjectPath(kLowEnergyPath),
+ base::RandInt(kMinRSSI, kMaxRSSI));
} else if (discovery_simulation_step_ == 10) {
CreateDevice(dbus::ObjectPath(FakeBluetoothAdapterClient::kAdapterPath),
@@ -709,18 +726,18 @@ void FakeBluetoothDeviceClient::DiscoverySimulationTimer() {
dbus::ObjectPath(kUnpairableDevicePath));
CreateDevice(dbus::ObjectPath(FakeBluetoothAdapterClient::kAdapterPath),
dbus::ObjectPath(kJustWorksPath));
- UpdateDeviceRSSI(dbus::ObjectPath(kLowEnergyPath),
- base::RandInt(kMinRSSI, kMaxRSSI));
+ UpdateInquiryRSSI(dbus::ObjectPath(kLowEnergyPath),
+ base::RandInt(kMinRSSI, kMaxRSSI));
} else if (discovery_simulation_step_ == 13) {
RemoveDevice(dbus::ObjectPath(FakeBluetoothAdapterClient::kAdapterPath),
dbus::ObjectPath(kVanishingDevicePath));
- UpdateDeviceRSSI(dbus::ObjectPath(kLowEnergyPath),
- base::RandInt(kMinRSSI, kMaxRSSI));
+ UpdateInquiryRSSI(dbus::ObjectPath(kLowEnergyPath),
+ base::RandInt(kMinRSSI, kMaxRSSI));
} else if (discovery_simulation_step_ == 14) {
- UpdateDeviceRSSI(dbus::ObjectPath(kLowEnergyPath),
- base::RandInt(kMinRSSI, kMaxRSSI));
+ UpdateInquiryRSSI(dbus::ObjectPath(kLowEnergyPath),
+ base::RandInt(kMinRSSI, kMaxRSSI));
return;
}
@@ -988,7 +1005,7 @@ void FakeBluetoothDeviceClient::AddInputDeviceIfNeeded(
fake_bluetooth_input_client->AddInputDevice(object_path);
}
-void FakeBluetoothDeviceClient::UpdateDeviceRSSI(
+void FakeBluetoothDeviceClient::UpdateInquiryRSSI(
const dbus::ObjectPath& object_path,
int16 rssi) {
PropertiesMap::iterator iter = properties_map_.find(object_path);
@@ -998,7 +1015,7 @@ void FakeBluetoothDeviceClient::UpdateDeviceRSSI(
}
Properties* properties = iter->second;
DCHECK(properties);
- properties->rssi.ReplaceValue(rssi);
+ properties->inquiry_rssi.ReplaceValue(rssi);
}
void FakeBluetoothDeviceClient::PinCodeCallback(

Powered by Google App Engine
This is Rietveld 408576698