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

Unified Diff: chromeos/dbus/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: fix clang warnings, test flakiness, and bluetooth.connect should succeed even if monitor fails 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
« no previous file with comments | « chromeos/dbus/bluetooth_device_client.h ('k') | chromeos/dbus/fake_bluetooth_device_client.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/dbus/bluetooth_device_client.cc
diff --git a/chromeos/dbus/bluetooth_device_client.cc b/chromeos/dbus/bluetooth_device_client.cc
index 033daf38548302f1e826c48b4d3ce22a73dcef99..b505401d2f3b91efb7120672fa74cfbd444a64ab 100644
--- a/chromeos/dbus/bluetooth_device_client.cc
+++ b/chromeos/dbus/bluetooth_device_client.cc
@@ -41,6 +41,10 @@ BluetoothDeviceClient::Properties::Properties(
RegisterProperty(bluetooth_device::kLegacyPairingProperty, &legacy_pairing);
RegisterProperty(bluetooth_device::kModaliasProperty, &modalias);
RegisterProperty(bluetooth_device::kRSSIProperty, &rssi);
+ RegisterProperty(bluetooth_device::kConnectionRSSI, &connection_rssi);
+ RegisterProperty(bluetooth_device::kConnectionTXPower, &connection_tx_power);
+ RegisterProperty(bluetooth_device::kConnectionTXPowerMax,
+ &connection_tx_power_max);
}
BluetoothDeviceClient::Properties::~Properties() {
@@ -267,6 +271,56 @@ class BluetoothDeviceClientImpl
weak_ptr_factory_.GetWeakPtr(), error_callback));
}
+ // BluetoothDeviceClient override.
+ virtual void StartConnectionMonitor(
+ const dbus::ObjectPath& object_path,
+ const base::Closure& callback,
+ const ErrorCallback& error_callback) OVERRIDE {
+ dbus::MethodCall method_call(bluetooth_device::kBluetoothDeviceInterface,
+ bluetooth_device::kStartConnectionMonitor);
+
+ dbus::ObjectProxy* object_proxy =
+ object_manager_->GetObjectProxy(object_path);
+ if (!object_proxy) {
+ error_callback.Run(kUnknownDeviceError, "");
+ return;
+ }
+ object_proxy->CallMethodWithErrorCallback(
+ &method_call,
+ dbus::ObjectProxy::TIMEOUT_USE_DEFAULT,
+ base::Bind(&BluetoothDeviceClientImpl::OnSuccess,
+ weak_ptr_factory_.GetWeakPtr(),
+ callback),
+ base::Bind(&BluetoothDeviceClientImpl::OnError,
+ weak_ptr_factory_.GetWeakPtr(),
+ error_callback));
+ }
+
+ // BluetoothDeviceClient override.
+ virtual void StopConnectionMonitor(
+ const dbus::ObjectPath& object_path,
+ const base::Closure& callback,
+ const ErrorCallback& error_callback) OVERRIDE {
+ dbus::MethodCall method_call(bluetooth_device::kBluetoothDeviceInterface,
+ bluetooth_device::kStopConnectionMonitor);
+
+ dbus::ObjectProxy* object_proxy =
+ object_manager_->GetObjectProxy(object_path);
+ if (!object_proxy) {
+ error_callback.Run(kUnknownDeviceError, "");
+ return;
+ }
+ object_proxy->CallMethodWithErrorCallback(
+ &method_call,
+ dbus::ObjectProxy::TIMEOUT_USE_DEFAULT,
+ base::Bind(&BluetoothDeviceClientImpl::OnSuccess,
+ weak_ptr_factory_.GetWeakPtr(),
+ callback),
+ base::Bind(&BluetoothDeviceClientImpl::OnError,
+ weak_ptr_factory_.GetWeakPtr(),
+ error_callback));
+ }
+
protected:
virtual void Init(dbus::Bus* bus) OVERRIDE {
object_manager_ = bus->GetObjectManager(
« no previous file with comments | « chromeos/dbus/bluetooth_device_client.h ('k') | chromeos/dbus/fake_bluetooth_device_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698