summaryrefslogtreecommitdiff
path: root/chromium/device/bluetooth/dbus/bluetooth_device_client.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/device/bluetooth/dbus/bluetooth_device_client.cc')
-rw-r--r--chromium/device/bluetooth/dbus/bluetooth_device_client.cc46
1 files changed, 46 insertions, 0 deletions
diff --git a/chromium/device/bluetooth/dbus/bluetooth_device_client.cc b/chromium/device/bluetooth/dbus/bluetooth_device_client.cc
index 9a69b3ef415..4ca96ede4dc 100644
--- a/chromium/device/bluetooth/dbus/bluetooth_device_client.cc
+++ b/chromium/device/bluetooth/dbus/bluetooth_device_client.cc
@@ -503,6 +503,52 @@ class BluetoothDeviceClientImpl : public BluetoothDeviceClient,
weak_ptr_factory_.GetWeakPtr(), error_callback));
}
+ void ExecuteWrite(const dbus::ObjectPath& object_path,
+ const base::Closure& callback,
+ const ErrorCallback& error_callback) override {
+ dbus::MethodCall method_call(bluetooth_device::kBluetoothDeviceInterface,
+ bluetooth_device::kExecuteWrite);
+
+ dbus::ObjectProxy* object_proxy =
+ object_manager_->GetObjectProxy(object_path);
+ if (!object_proxy) {
+ error_callback.Run(kUnknownDeviceError, "");
+ return;
+ }
+
+ dbus::MessageWriter writer(&method_call);
+ writer.AppendBool(true);
+ object_proxy->CallMethodWithErrorCallback(
+ &method_call, dbus::ObjectProxy::TIMEOUT_USE_DEFAULT,
+ base::BindOnce(&BluetoothDeviceClientImpl::OnSuccess,
+ weak_ptr_factory_.GetWeakPtr(), callback),
+ base::BindOnce(&BluetoothDeviceClientImpl::OnError,
+ weak_ptr_factory_.GetWeakPtr(), error_callback));
+ }
+
+ void AbortWrite(const dbus::ObjectPath& object_path,
+ const base::Closure& callback,
+ const ErrorCallback& error_callback) override {
+ dbus::MethodCall method_call(bluetooth_device::kBluetoothDeviceInterface,
+ bluetooth_device::kExecuteWrite);
+
+ dbus::ObjectProxy* object_proxy =
+ object_manager_->GetObjectProxy(object_path);
+ if (!object_proxy) {
+ error_callback.Run(kUnknownDeviceError, "");
+ return;
+ }
+
+ dbus::MessageWriter writer(&method_call);
+ writer.AppendBool(false);
+ object_proxy->CallMethodWithErrorCallback(
+ &method_call, dbus::ObjectProxy::TIMEOUT_USE_DEFAULT,
+ base::BindOnce(&BluetoothDeviceClientImpl::OnSuccess,
+ weak_ptr_factory_.GetWeakPtr(), callback),
+ base::BindOnce(&BluetoothDeviceClientImpl::OnError,
+ weak_ptr_factory_.GetWeakPtr(), error_callback));
+ }
+
protected:
void Init(dbus::Bus* bus,
const std::string& bluetooth_service_name) override {