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 #ifndef DEVICE_BLUETOOTH_BLUEZ_BLUETOOTH_SERVICE_RECORD_BLUEZ_H_ | 5 #ifndef DEVICE_BLUETOOTH_BLUEZ_BLUETOOTH_SERVICE_RECORD_BLUEZ_H_ |
6 #define DEVICE_BLUETOOTH_BLUEZ_BLUETOOTH_SERVICE_RECORD_BLUEZ_H_ | 6 #define DEVICE_BLUETOOTH_BLUEZ_BLUETOOTH_SERVICE_RECORD_BLUEZ_H_ |
7 | 7 |
8 #include <cstdint> | 8 #include <cstdint> |
9 #include <map> | 9 #include <map> |
10 #include <vector> | 10 #include <vector> |
(...skipping 24 matching lines...) Expand all Loading... |
35 BluetoothServiceRecordBlueZ(); | 35 BluetoothServiceRecordBlueZ(); |
36 BluetoothServiceRecordBlueZ(const BluetoothServiceRecordBlueZ& record); | 36 BluetoothServiceRecordBlueZ(const BluetoothServiceRecordBlueZ& record); |
37 ~BluetoothServiceRecordBlueZ(); | 37 ~BluetoothServiceRecordBlueZ(); |
38 | 38 |
39 // Returns a list of Attribute IDs that exist within this service record. | 39 // Returns a list of Attribute IDs that exist within this service record. |
40 const std::vector<uint16_t> GetAttributeIds() const; | 40 const std::vector<uint16_t> GetAttributeIds() const; |
41 // Returns the value associated with a given attribute ID in |value|. | 41 // Returns the value associated with a given attribute ID in |value|. |
42 const BluetoothServiceAttributeValueBlueZ& GetAttributeValue( | 42 const BluetoothServiceAttributeValueBlueZ& GetAttributeValue( |
43 uint16_t attribute_id) const; | 43 uint16_t attribute_id) const; |
44 | 44 |
45 // Add an an entry to this service record. If a record with the given ID | 45 // Adds an entry to this service record. If a record with the given ID already |
46 // already exists, it is replaced. | 46 // exists, it is replaced. |
47 void AddRecordEntry(uint16_t id, | 47 void AddRecordEntry(uint16_t id, |
48 const BluetoothServiceAttributeValueBlueZ& value); | 48 const BluetoothServiceAttributeValueBlueZ& value); |
49 | 49 |
| 50 // Returns true if the given attribute ID is found in the attribute map, false |
| 51 // otherwise. |
| 52 bool IsAttributePresented(uint16_t id); |
| 53 |
50 private: | 54 private: |
51 std::map<uint16_t, BluetoothServiceAttributeValueBlueZ> attributes_; | 55 std::map<uint16_t, BluetoothServiceAttributeValueBlueZ> attributes_; |
52 }; | 56 }; |
53 | 57 |
54 } // namespace bluez | 58 } // namespace bluez |
55 | 59 |
56 #endif // DEVICE_BLUETOOTH_BLUEZ_BLUETOOTH_SERVICE_RECORD_BLUEZ_H_ | 60 #endif // DEVICE_BLUETOOTH_BLUEZ_BLUETOOTH_SERVICE_RECORD_BLUEZ_H_ |
OLD | NEW |