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

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

Issue 2907913002: Fix ManufacturerData and ServiceData DBus data type to match with bluez. (Closed)
Patch Set: Fix ManufacturerData and ServiceData DBus data type to match with bluez. Created 3 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/bluetooth/dbus/bluetooth_le_advertisement_service_provider.cc
diff --git a/device/bluetooth/dbus/bluetooth_le_advertisement_service_provider.cc b/device/bluetooth/dbus/bluetooth_le_advertisement_service_provider.cc
index 3cb67fc1409ac1ee7260d8b6d3ffc608726a1778..51494bb51b5f4a5e29209dbe61323979c4df089a 100644
--- a/device/bluetooth/dbus/bluetooth_le_advertisement_service_provider.cc
+++ b/device/bluetooth/dbus/bluetooth_le_advertisement_service_provider.cc
@@ -301,7 +301,7 @@ class BluetoothAdvertisementServiceProviderImpl
dict_entry_writer.AppendString(
bluetooth_advertisement::kManufacturerDataProperty);
dbus::MessageWriter variant_writer(NULL);
- dict_entry_writer.OpenVariant("a{qay}", &variant_writer);
+ dict_entry_writer.OpenVariant("a{qv}", &variant_writer);
AppendManufacturerDataVariant(&variant_writer);
dict_entry_writer.CloseContainer(&variant_writer);
array_writer->CloseContainer(&dict_entry_writer);
@@ -326,7 +326,7 @@ class BluetoothAdvertisementServiceProviderImpl
dict_entry_writer.AppendString(
bluetooth_advertisement::kServiceDataProperty);
dbus::MessageWriter variant_writer(NULL);
- dict_entry_writer.OpenVariant("a{say}", &variant_writer);
+ dict_entry_writer.OpenVariant("a{sv}", &variant_writer);
AppendServiceDataVariant(&variant_writer);
dict_entry_writer.CloseContainer(&variant_writer);
array_writer->CloseContainer(&dict_entry_writer);
@@ -335,14 +335,17 @@ class BluetoothAdvertisementServiceProviderImpl
void AppendManufacturerDataVariant(dbus::MessageWriter* writer) {
DCHECK(manufacturer_data_);
dbus::MessageWriter array_writer(NULL);
- writer->OpenArray("{qay}", &array_writer);
+ writer->OpenArray("{qv}", &array_writer);
for (const auto& m : *manufacturer_data_) {
dbus::MessageWriter entry_writer(NULL);
array_writer.OpenDictEntry(&entry_writer);
- entry_writer.AppendUint32(m.first);
- entry_writer.AppendArrayOfBytes(m.second.data(), m.second.size());
+ entry_writer.AppendUint16(m.first);
+ dbus::MessageWriter variant_writer(NULL);
+ entry_writer.OpenVariant("ay", &variant_writer);
+ variant_writer.AppendArrayOfBytes(m.second.data(), m.second.size());
+ entry_writer.CloseContainer(&variant_writer);
array_writer.CloseContainer(&entry_writer);
}
@@ -352,14 +355,17 @@ class BluetoothAdvertisementServiceProviderImpl
void AppendServiceDataVariant(dbus::MessageWriter* writer) {
DCHECK(service_data_);
dbus::MessageWriter array_writer(NULL);
- writer->OpenArray("{say}", &array_writer);
+ writer->OpenArray("{sv}", &array_writer);
for (const auto& m : *service_data_) {
dbus::MessageWriter entry_writer(NULL);
array_writer.OpenDictEntry(&entry_writer);
entry_writer.AppendString(m.first);
- entry_writer.AppendArrayOfBytes(m.second.data(), m.second.size());
+ dbus::MessageWriter variant_writer(NULL);
+ entry_writer.OpenVariant("ay", &variant_writer);
+ variant_writer.AppendArrayOfBytes(m.second.data(), m.second.size());
+ entry_writer.CloseContainer(&variant_writer);
array_writer.CloseContainer(&entry_writer);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698