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

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

Issue 2369423003: bluetooth: Expose service data from BlueZ (Closed)
Patch Set: More comment Created 4 years, 2 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
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 417ed161d40b86266ffbb43cea208a835ae1a5ec..50f15ebd401bc3ff07019dadb5edb22be2c1983c 100644
--- a/device/bluetooth/bluez/bluetooth_device_bluez.cc
+++ b/device/bluetooth/bluez/bluetooth_device_bluez.cc
@@ -595,6 +595,20 @@ void BluetoothDeviceBlueZ::GetServiceRecords(
weak_ptr_factory_.GetWeakPtr(), error_callback));
}
+void BluetoothDeviceBlueZ::UpdateServiceData() {
+ bluez::BluetoothDeviceClient::Properties* properties =
+ bluez::BluezDBusManager::Get()->GetBluetoothDeviceClient()->GetProperties(
+ object_path_);
+ DCHECK(properties);
+ DCHECK(properties->service_data.is_valid());
+
+ service_data_.clear();
+ for (const auto& pair : properties->service_data.value()) {
+ service_data_.insert(std::pair<BluetoothUUID, std::vector<uint8_t>>(
ortuno 2016/10/06 02:09:01 optional nit: You could do service_data_[Bluetoot
puthik_chromium 2016/10/06 02:26:12 Done.
+ BluetoothUUID(pair.first), pair.second));
+ }
+}
+
BluetoothPairingBlueZ* BluetoothDeviceBlueZ::BeginPairing(
BluetoothDevice::PairingDelegate* pairing_delegate) {
pairing_.reset(new BluetoothPairingBlueZ(this, pairing_delegate));

Powered by Google App Engine
This is Rietveld 408576698