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

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

Issue 2102093003: Implement BluetoothDeviceBlueZ::GetServiceRecords. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 6 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_service_record_bluez.cc
diff --git a/device/bluetooth/bluez/bluetooth_service_record_bluez.cc b/device/bluetooth/bluez/bluetooth_service_record_bluez.cc
index 5a3178f2616d169524f084900ccbf6120becb4ae..262e4e1c3254c2305397df6c91e110adee555ab2 100644
--- a/device/bluetooth/bluez/bluetooth_service_record_bluez.cc
+++ b/device/bluetooth/bluez/bluetooth_service_record_bluez.cc
@@ -4,13 +4,13 @@
#include "device/bluetooth/bluez/bluetooth_service_record_bluez.h"
+#include <utility>
+
#include "base/values.h"
namespace bluez {
-BluetoothServiceRecordBlueZ::BluetoothServiceRecordBlueZ(
- const std::map<uint16_t, BluetoothServiceAttributeValueBlueZ>& attributes)
- : attributes_(attributes) {}
+BluetoothServiceRecordBlueZ::BluetoothServiceRecordBlueZ() {}
BluetoothServiceRecordBlueZ::BluetoothServiceRecordBlueZ(
const BluetoothServiceRecordBlueZ& record) {
@@ -35,4 +35,14 @@ BluetoothServiceRecordBlueZ::GetAttributeValue(uint16_t attribute_id) const {
return it->second;
}
+void BluetoothServiceRecordBlueZ::AddRecordEntry(
+ uint16_t id,
+ const BluetoothServiceAttributeValueBlueZ& value) {
+ auto it = attributes_.find(id);
+ if (it != attributes_.end())
+ attributes_.erase(it);
+ attributes_.insert(
+ std::pair<uint16_t, BluetoothServiceAttributeValueBlueZ>(id, value));
+}
+
} // namespace bluez

Powered by Google App Engine
This is Rietveld 408576698