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

Side by Side 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, 3 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 unified diff | Download patch
OLDNEW
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 // Next MinVersion: 5 5 // Next MinVersion: 6
6 6
7 module arc.mojom; 7 module arc.mojom;
8 8
9 import "mojo/common/common_custom_types.mojom";
10
9 [Extensible] 11 [Extensible]
10 enum BluetoothAdapterState { 12 enum BluetoothAdapterState {
11 OFF = 0, 13 OFF = 0,
12 ON 14 ON
13 }; 15 };
14 16
15 [Extensible] 17 [Extensible]
16 enum BluetoothDiscoveryState { 18 enum BluetoothDiscoveryState {
17 STOPPED, 19 STOPPED,
18 STARTED 20 STARTED
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 uint16 start_handle; 226 uint16 start_handle;
225 uint16 end_handle; 227 uint16 end_handle;
226 228
227 /* 229 /*
228 * If |type| is |BTGATT_DB_CHARACTERISTIC|, this contains the properties of 230 * If |type| is |BTGATT_DB_CHARACTERISTIC|, this contains the properties of
229 * the characteristic. 231 * the characteristic.
230 */ 232 */
231 uint8 properties; 233 uint8 properties;
232 }; 234 };
233 235
236 // Bluetooth SDP types
237 [Extensible]
238 enum BluetoothSdpAttributeType {
239 NULLTYPE = 0,
240 UINT,
241 INT,
242 UUID,
243 STRING,
244 BOOL,
245 SEQUENCE,
246 URL,
247 };
248
249 /*
250 * In order to address security concern on infinite recursion of constructing
251 * SDP attribute sequence when Android gets compromised, we use
252 * BluetoothSdpAttribute, BluetoothSdpAttributeLayer1 and
253 BluetoothSdpAttributeLayer2 to represent three possible structures.
254 * 0) value
255 * 1) sequence{value}
256 * 2) sequence{sequence{value}}
257 *
258 * Note that union is not adopted here to store either value or sequence, since
259 * the generated mojom.cc cause build errors when setting value due to the
260 * private assignment operator.
261 */
262 struct BluetoothSdpAttribute {
263 BluetoothSdpAttributeType type;
264 uint32 type_size;
265 mojo.common.mojom.ListValue? value;
266 array<BluetoothSdpAttributeLayer1>? sequence;
267 };
268
269 struct BluetoothSdpAttributeLayer1 {
270 BluetoothSdpAttributeType type;
271 uint32 type_size;
272 mojo.common.mojom.ListValue? value;
273 array<BluetoothSdpAttributeLayer2>? sequence;
274 };
275
276 struct BluetoothSdpAttributeLayer2 {
277 BluetoothSdpAttributeType type;
278 uint32 type_size;
279 mojo.common.mojom.ListValue value;
280 };
281
282 struct BluetoothSdpRecord {
283 map<uint16, BluetoothSdpAttribute> attrs;
284 };
285
286 struct BluetoothCreateSdpRecordResult {
287 BluetoothStatus status;
288 uint32 service_handle;
289 };
290
291 // Next Method ID: 40
234 interface BluetoothHost { 292 interface BluetoothHost {
235 EnableAdapter@0() => (BluetoothAdapterState state); 293 EnableAdapter@0() => (BluetoothAdapterState state);
236 DisableAdapter@1() => (BluetoothAdapterState state); 294 DisableAdapter@1() => (BluetoothAdapterState state);
237 GetAdapterProperty@2(BluetoothPropertyType type); 295 GetAdapterProperty@2(BluetoothPropertyType type);
238 SetAdapterProperty@3(BluetoothProperty property); 296 SetAdapterProperty@3(BluetoothProperty property);
239 GetRemoteDeviceProperty@4(BluetoothAddress remote_addr, 297 GetRemoteDeviceProperty@4(BluetoothAddress remote_addr,
240 BluetoothPropertyType type); 298 BluetoothPropertyType type);
241 SetRemoteDeviceProperty@5(BluetoothAddress remote_addr, 299 SetRemoteDeviceProperty@5(BluetoothAddress remote_addr,
242 BluetoothProperty property); 300 BluetoothProperty property);
243 GetRemoteServiceRecord@6(BluetoothAddress remote_addr, 301 GetRemoteServiceRecord@6(BluetoothAddress remote_addr,
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
315 => (BluetoothGattStatus status); 373 => (BluetoothGattStatus status);
316 [MinVersion=3] StopService@34(int32 service_handle) 374 [MinVersion=3] StopService@34(int32 service_handle)
317 => (BluetoothGattStatus status); 375 => (BluetoothGattStatus status);
318 [MinVersion=3] DeleteService@35(int32 service_handle) 376 [MinVersion=3] DeleteService@35(int32 service_handle)
319 => (BluetoothGattStatus status); 377 => (BluetoothGattStatus status);
320 [MinVersion=3] SendIndication@36(int32 attribute_handle, 378 [MinVersion=3] SendIndication@36(int32 attribute_handle,
321 BluetoothAddress address, 379 BluetoothAddress address,
322 bool confirm, 380 bool confirm,
323 array<uint8> value) 381 array<uint8> value)
324 => (BluetoothGattStatus status); 382 => (BluetoothGattStatus status);
383
384 // Bluetooth SDP functions
385 [MinVersion=5] GetSdpRecords@37(BluetoothAddress remote_addr,
386 BluetoothUUID target_uuid);
387 [MinVersion=5] CreateSdpRecord@38(BluetoothSdpRecord record)
388 => (BluetoothCreateSdpRecordResult result);
389 [MinVersion=5] RemoveSdpRecord@39(uint32 service_handle)
390 => (BluetoothStatus status);
325 }; 391 };
326 392
327 // Next Method ID: 17 393 // Next Method ID: 18
328 interface BluetoothInstance { 394 interface BluetoothInstance {
329 Init@0(BluetoothHost host_ptr); 395 Init@0(BluetoothHost host_ptr);
330 396
331 OnAdapterProperties@1(BluetoothStatus status, 397 OnAdapterProperties@1(BluetoothStatus status,
332 array<BluetoothProperty> properties); 398 array<BluetoothProperty> properties);
333 OnRemoteDeviceProperties@2(BluetoothStatus status, 399 OnRemoteDeviceProperties@2(BluetoothStatus status,
334 BluetoothAddress address, 400 BluetoothAddress address,
335 array<BluetoothProperty> properties); 401 array<BluetoothProperty> properties);
336 OnDeviceFound@3(array<BluetoothProperty> properties); 402 OnDeviceFound@3(array<BluetoothProperty> properties);
337 OnDiscoveryStateChanged@4(BluetoothDiscoveryState state); 403 OnDiscoveryStateChanged@4(BluetoothDiscoveryState state);
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
369 [MinVersion=3] RequestGattRead@14(BluetoothAddress address, 435 [MinVersion=3] RequestGattRead@14(BluetoothAddress address,
370 int32 attribute_handle, 436 int32 attribute_handle,
371 int32 offset, 437 int32 offset,
372 bool is_long) 438 bool is_long)
373 => (BluetoothGattStatus status, array<uint8> value); 439 => (BluetoothGattStatus status, array<uint8> value);
374 [MinVersion=3] RequestGattWrite@15(BluetoothAddress address, 440 [MinVersion=3] RequestGattWrite@15(BluetoothAddress address,
375 int32 attribute_handle, 441 int32 attribute_handle,
376 int32 offset, 442 int32 offset,
377 array<uint8> value) 443 array<uint8> value)
378 => (BluetoothGattStatus status); 444 => (BluetoothGattStatus status);
445
446 // Bluetooth SDP function
447 [MinVersion=5] OnGetSdpRecords@17(BluetoothStatus status,
448 BluetoothAddress remove_addr,
449 BluetoothUUID target_uuid,
450 array<BluetoothSdpRecord> records);
379 }; 451 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698