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

Unified Diff: components/arc/common/bluetooth.mojom

Issue 2149713002: arc: bluetooth: Add SDP host side support (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: arc: bluetooth: Add SDP host side support Created 4 years, 4 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: components/arc/common/bluetooth.mojom
diff --git a/components/arc/common/bluetooth.mojom b/components/arc/common/bluetooth.mojom
index 9d05a469d47496397bfca6a1958746dc668fe76c..22cccc662e71ea22367305c163af773f3f37ea17 100644
--- a/components/arc/common/bluetooth.mojom
+++ b/components/arc/common/bluetooth.mojom
@@ -2,10 +2,12 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Next MinVersion: 5
+// Next MinVersion: 6
module arc.mojom;
+import "mojo/common/common_custom_types.mojom";
+
[Extensible]
enum BluetoothAdapterState {
OFF = 0,
@@ -231,6 +233,62 @@ struct BluetoothGattDBElement {
uint8 properties;
};
+// Bluetooth SDP types
+[Extensible]
+enum BluetoothSdpAttributeType {
+ NULLTYPE = 0,
+ UINT,
+ INT,
+ UUID,
+ STRING,
+ BOOL,
+ SEQUENCE,
+ URL,
+};
+
+/*
+ * In order to address security concern on infinite recursion of constructing
+ * SDP attribute sequence when Android gets compromised, we use
+ * BluetoothSdpAttribute, BluetoothSdpAttributeLayer1 and
+ BluetoothSdpAttributeLayer2 to represent three possible structures.
+ * 0) value
+ * 1) sequence{value}
+ * 2) sequence{sequence{value}}
+ *
+ * Note that union is not adopted here to store either value or sequence, since
+ * the generated mojom.cc cause build errors when setting value due to the
+ * private assignment operator.
+ */
+struct BluetoothSdpAttribute {
+ BluetoothSdpAttributeType type;
+ uint32 type_size;
+ mojo.common.mojom.ListValue? value;
+ array<BluetoothSdpAttributeLayer1>? sequence;
+};
+
+struct BluetoothSdpAttributeLayer1 {
+ BluetoothSdpAttributeType type;
+ uint32 type_size;
+ mojo.common.mojom.ListValue? value;
+ array<BluetoothSdpAttributeLayer2>? sequence;
+};
+
+struct BluetoothSdpAttributeLayer2 {
+ BluetoothSdpAttributeType type;
+ uint32 type_size;
+ mojo.common.mojom.ListValue value;
+};
+
+struct BluetoothSdpRecord {
+ map<uint16, BluetoothSdpAttribute> attrs;
+};
+
+struct BluetoothCreateSdpRecordResult {
+ BluetoothStatus status;
+ uint32 service_handle;
+};
+
+// Next Method ID: 40
interface BluetoothHost {
EnableAdapter@0() => (BluetoothAdapterState state);
DisableAdapter@1() => (BluetoothAdapterState state);
@@ -322,9 +380,17 @@ interface BluetoothHost {
bool confirm,
array<uint8> value)
=> (BluetoothGattStatus status);
+
+ // Bluetooth SDP functions
+ [MinVersion=5] GetSdpRecords@37(BluetoothAddress remote_addr,
+ BluetoothUUID target_uuid);
+ [MinVersion=5] CreateSdpRecord@38(BluetoothSdpRecord record)
+ => (BluetoothCreateSdpRecordResult result);
+ [MinVersion=5] RemoveSdpRecord@39(uint32 service_handle)
+ => (BluetoothStatus status);
};
-// Next Method ID: 17
+// Next Method ID: 18
interface BluetoothInstance {
Init@0(BluetoothHost host_ptr);
@@ -376,4 +442,10 @@ interface BluetoothInstance {
int32 offset,
array<uint8> value)
=> (BluetoothGattStatus status);
+
+ // Bluetooth SDP function
+ [MinVersion=5] OnGetSdpRecords@17(BluetoothStatus status,
+ BluetoothAddress remove_addr,
+ BluetoothUUID target_uuid,
+ array<BluetoothSdpRecord> records);
};

Powered by Google App Engine
This is Rietveld 408576698