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

Unified Diff: device/bluetooth/bluez/bluetooth_device_bluez.cc

Issue 2421713002: arc: bluetooth: Expose missing advertise data. (Closed)
Patch Set: Add BlueZ unittests / more comment Created 4 years, 1 month 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 | « device/bluetooth/bluez/bluetooth_device_bluez.h ('k') | device/bluetooth/dbus/bluetooth_device_client.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/bluetooth/bluez/bluetooth_device_bluez.cc
diff --git a/device/bluetooth/bluez/bluetooth_device_bluez.cc b/device/bluetooth/bluez/bluetooth_device_bluez.cc
index 9f1b448fea9e7b8f2de36bcf3856c9ea3b5ed762..17f3522dc02451ce041f9f90d328dedec6eb9699 100644
--- a/device/bluetooth/bluez/bluetooth_device_bluez.cc
+++ b/device/bluetooth/bluez/bluetooth_device_bluez.cc
@@ -607,6 +607,34 @@ void BluetoothDeviceBlueZ::UpdateServiceData() {
service_data_[BluetoothUUID(pair.first)] = pair.second;
}
+void BluetoothDeviceBlueZ::UpdateManufacturerData() {
+ bluez::BluetoothDeviceClient::Properties* properties =
+ bluez::BluezDBusManager::Get()->GetBluetoothDeviceClient()->GetProperties(
+ object_path_);
+ DCHECK(properties);
+ manufacturer_data_.clear();
+
+ if (properties->manufacturer_data.is_valid()) {
+ for (const auto& pair : properties->manufacturer_data.value())
+ manufacturer_data_[pair.first] = pair.second;
+ }
+}
+
+void BluetoothDeviceBlueZ::UpdateAdvertisingDataFlags() {
+ bluez::BluetoothDeviceClient::Properties* properties =
+ bluez::BluezDBusManager::Get()->GetBluetoothDeviceClient()->GetProperties(
+ object_path_);
+ DCHECK(properties);
+ advertising_data_flags_ = base::nullopt;
+
+ // The advertising data flags property is a vector<uint8> because the
+ // Supplement to Bluetooth Core Specification Version 6 page 13 said that
+ // "The Flags field may be zero or more octets long." However, only the first
+ // byte of that is needed because there is only 5 bits of data defined there.
+ if (properties->advertising_data_flags.is_valid())
+ advertising_data_flags_ = properties->advertising_data_flags.value()[0];
+}
+
BluetoothPairingBlueZ* BluetoothDeviceBlueZ::BeginPairing(
BluetoothDevice::PairingDelegate* pairing_delegate) {
pairing_.reset(new BluetoothPairingBlueZ(this, pairing_delegate));
« no previous file with comments | « device/bluetooth/bluez/bluetooth_device_bluez.h ('k') | device/bluetooth/dbus/bluetooth_device_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698