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

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

Issue 2084463002: BlueZ + DBus implementations of create/remove service record functions. (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.h
diff --git a/device/bluetooth/bluez/bluetooth_service_record_bluez.h b/device/bluetooth/bluez/bluetooth_service_record_bluez.h
index 720444a4c03a52ed80d565b3ba4f3df03802bc71..c4a8630929ead7e65904eb1284ced55fb02ac198 100644
--- a/device/bluetooth/bluez/bluetooth_service_record_bluez.h
+++ b/device/bluetooth/bluez/bluetooth_service_record_bluez.h
@@ -5,11 +5,13 @@
#ifndef DEVICE_BLUETOOTH_BLUEZ_BLUETOOTH_SERVICE_RECORD_BLUEZ_H_
#define DEVICE_BLUETOOTH_BLUEZ_BLUETOOTH_SERVICE_RECORD_BLUEZ_H_
-#include <stdint.h>
+#include <cstdint>
+#include <map>
#include <vector>
#include "base/macros.h"
#include "device/bluetooth/bluetooth_export.h"
+#include "device/bluetooth/bluez/bluetooth_service_attribute_value_bluez.h"
namespace base {
class Value;
@@ -23,22 +25,27 @@ class DEVICE_BLUETOOTH_EXPORT BluetoothServiceRecordBlueZ {
// records.
enum ErrorCode {
ERROR_ADAPTER_NOT_READY,
- ERROR_RECORD_EXISTS,
+ ERROR_RECORD_ALREADY_EXISTS,
ERROR_RECORD_DOES_NOT_EXIST,
ERROR_DEVICE_DISCONNECTED,
+ ERROR_INVALID_ARGUMENTS,
UNKNOWN
};
- BluetoothServiceRecordBlueZ();
+ explicit BluetoothServiceRecordBlueZ(
+ const std::map<uint16_t, BluetoothServiceAttributeValueBlueZ>&
+ attributes);
+ BluetoothServiceRecordBlueZ(const BluetoothServiceRecordBlueZ& record);
~BluetoothServiceRecordBlueZ();
// Returns a list of Attribute IDs that exist within this service record.
- std::vector<uint16_t> GetAttributeIds();
- // Returns the value associated with a given attribute ID.
- base::Value* GetAttributeValue(uint16_t attribute_id);
+ const std::vector<uint16_t> GetAttributeIds() const;
+ // Returns the value associated with a given attribute ID in |value|.
+ const BluetoothServiceAttributeValueBlueZ& GetAttributeValue(
+ uint16_t attribute_id) const;
private:
- DISALLOW_COPY_AND_ASSIGN(BluetoothServiceRecordBlueZ);
+ std::map<uint16_t, BluetoothServiceAttributeValueBlueZ> attributes_;
};
} // namespace bluez

Powered by Google App Engine
This is Rietveld 408576698