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

Unified Diff: device/bluetooth/dbus/bluetooth_gatt_characteristic_client.cc

Issue 2016023002: bluetooth: Add option dict to ReadValue/WriteValue dbus call (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add descriptor Created 4 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 | « no previous file | device/bluetooth/dbus/bluetooth_gatt_descriptor_client.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/bluetooth/dbus/bluetooth_gatt_characteristic_client.cc
diff --git a/device/bluetooth/dbus/bluetooth_gatt_characteristic_client.cc b/device/bluetooth/dbus/bluetooth_gatt_characteristic_client.cc
index 0002ddbb03d0267a135a64cc41eedb81fe24e9d9..4fd8a253185cc87ee112b43664126a93bc415a1b 100644
--- a/device/bluetooth/dbus/bluetooth_gatt_characteristic_client.cc
+++ b/device/bluetooth/dbus/bluetooth_gatt_characteristic_client.cc
@@ -95,6 +95,21 @@ class BluetoothGattCharacteristicClientImpl
bluetooth_gatt_characteristic::kBluetoothGattCharacteristicInterface,
bluetooth_gatt_characteristic::kReadValue);
+ // Write offset option
+ dbus::MessageWriter writer(&method_call);
+ dbus::MessageWriter array_writer(NULL);
+ dbus::MessageWriter dict_entry_writer(NULL);
+ dbus::MessageWriter variant_writer(NULL);
+ writer.OpenArray("{sv}", &array_writer);
+ array_writer.OpenDictEntry(&dict_entry_writer);
+ dict_entry_writer.AppendString(
+ bluetooth_gatt_characteristic::kOptionOffset);
rkc 2016/05/27 04:01:12 The whole purpose of having an options/flags dicti
+ dict_entry_writer.OpenVariant("as", &variant_writer);
+ variant_writer.AppendInt16(0);
+ dict_entry_writer.CloseContainer(&variant_writer);
+ array_writer.CloseContainer(&dict_entry_writer);
+ writer.CloseContainer(&array_writer);
+
object_proxy->CallMethodWithErrorCallback(
&method_call, dbus::ObjectProxy::TIMEOUT_USE_DEFAULT,
base::Bind(&BluetoothGattCharacteristicClientImpl::OnValueSuccess,
@@ -121,6 +136,20 @@ class BluetoothGattCharacteristicClientImpl
dbus::MessageWriter writer(&method_call);
writer.AppendArrayOfBytes(value.data(), value.size());
+ // Write offset option
+ dbus::MessageWriter array_writer(NULL);
+ dbus::MessageWriter dict_entry_writer(NULL);
+ dbus::MessageWriter variant_writer(NULL);
+ writer.OpenArray("{sv}", &array_writer);
+ array_writer.OpenDictEntry(&dict_entry_writer);
+ dict_entry_writer.AppendString(
+ bluetooth_gatt_characteristic::kOptionOffset);
+ dict_entry_writer.OpenVariant("as", &variant_writer);
+ variant_writer.AppendInt16(0);
+ dict_entry_writer.CloseContainer(&variant_writer);
+ array_writer.CloseContainer(&dict_entry_writer);
+ writer.CloseContainer(&array_writer);
+
object_proxy->CallMethodWithErrorCallback(
&method_call, dbus::ObjectProxy::TIMEOUT_USE_DEFAULT,
base::Bind(&BluetoothGattCharacteristicClientImpl::OnSuccess,
« no previous file with comments | « no previous file | device/bluetooth/dbus/bluetooth_gatt_descriptor_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698