OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "device/bluetooth/bluez/bluetooth_service_record_bluez.h" | 5 #include "device/bluetooth/bluez/bluetooth_service_record_bluez.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/values.h" | 9 #include "base/values.h" |
10 | 10 |
(...skipping 27 matching lines...) Expand all Loading... |
38 void BluetoothServiceRecordBlueZ::AddRecordEntry( | 38 void BluetoothServiceRecordBlueZ::AddRecordEntry( |
39 uint16_t id, | 39 uint16_t id, |
40 const BluetoothServiceAttributeValueBlueZ& value) { | 40 const BluetoothServiceAttributeValueBlueZ& value) { |
41 auto it = attributes_.find(id); | 41 auto it = attributes_.find(id); |
42 if (it != attributes_.end()) | 42 if (it != attributes_.end()) |
43 attributes_.erase(it); | 43 attributes_.erase(it); |
44 attributes_.insert( | 44 attributes_.insert( |
45 std::pair<uint16_t, BluetoothServiceAttributeValueBlueZ>(id, value)); | 45 std::pair<uint16_t, BluetoothServiceAttributeValueBlueZ>(id, value)); |
46 } | 46 } |
47 | 47 |
| 48 bool BluetoothServiceRecordBlueZ::IsAttributePresented(uint16_t id) { |
| 49 return attributes_.find(id) != attributes_.end(); |
| 50 } |
| 51 |
48 } // namespace bluez | 52 } // namespace bluez |
OLD | NEW |