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 // 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 Loading... |
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 * A BluetoothSdpAttribute contains either a value or a sequence, where a |
| 251 * sequence is an array of BluetoothSdpAttribute. A multi-layered attribute |
| 252 * design is intended. The user of this structure should pay extra attention to |
| 253 * check the depth of included layers. |
| 254 */ |
| 255 struct BluetoothSdpAttribute { |
| 256 BluetoothSdpAttributeType type; |
| 257 uint32 type_size; |
| 258 mojo.common.mojom.ListValue? value; |
| 259 array<BluetoothSdpAttribute>? sequence; |
| 260 }; |
| 261 |
| 262 struct BluetoothSdpRecord { |
| 263 map<uint16, BluetoothSdpAttribute> attrs; |
| 264 }; |
| 265 |
| 266 struct BluetoothCreateSdpRecordResult { |
| 267 BluetoothStatus status; |
| 268 uint32 service_handle; |
| 269 }; |
| 270 |
| 271 // Next Method ID: 40 |
234 interface BluetoothHost { | 272 interface BluetoothHost { |
235 EnableAdapter@0() => (BluetoothAdapterState state); | 273 EnableAdapter@0() => (BluetoothAdapterState state); |
236 DisableAdapter@1() => (BluetoothAdapterState state); | 274 DisableAdapter@1() => (BluetoothAdapterState state); |
237 GetAdapterProperty@2(BluetoothPropertyType type); | 275 GetAdapterProperty@2(BluetoothPropertyType type); |
238 SetAdapterProperty@3(BluetoothProperty property); | 276 SetAdapterProperty@3(BluetoothProperty property); |
239 GetRemoteDeviceProperty@4(BluetoothAddress remote_addr, | 277 GetRemoteDeviceProperty@4(BluetoothAddress remote_addr, |
240 BluetoothPropertyType type); | 278 BluetoothPropertyType type); |
241 SetRemoteDeviceProperty@5(BluetoothAddress remote_addr, | 279 SetRemoteDeviceProperty@5(BluetoothAddress remote_addr, |
242 BluetoothProperty property); | 280 BluetoothProperty property); |
243 GetRemoteServiceRecord@6(BluetoothAddress remote_addr, | 281 GetRemoteServiceRecord@6(BluetoothAddress remote_addr, |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
315 => (BluetoothGattStatus status); | 353 => (BluetoothGattStatus status); |
316 [MinVersion=3] StopService@34(int32 service_handle) | 354 [MinVersion=3] StopService@34(int32 service_handle) |
317 => (BluetoothGattStatus status); | 355 => (BluetoothGattStatus status); |
318 [MinVersion=3] DeleteService@35(int32 service_handle) | 356 [MinVersion=3] DeleteService@35(int32 service_handle) |
319 => (BluetoothGattStatus status); | 357 => (BluetoothGattStatus status); |
320 [MinVersion=3] SendIndication@36(int32 attribute_handle, | 358 [MinVersion=3] SendIndication@36(int32 attribute_handle, |
321 BluetoothAddress address, | 359 BluetoothAddress address, |
322 bool confirm, | 360 bool confirm, |
323 array<uint8> value) | 361 array<uint8> value) |
324 => (BluetoothGattStatus status); | 362 => (BluetoothGattStatus status); |
| 363 |
| 364 // Bluetooth SDP functions |
| 365 [MinVersion=5] GetSdpRecords@37(BluetoothAddress remote_addr, |
| 366 BluetoothUUID target_uuid); |
| 367 [MinVersion=5] CreateSdpRecord@38(BluetoothSdpRecord record) |
| 368 => (BluetoothCreateSdpRecordResult result); |
| 369 [MinVersion=5] RemoveSdpRecord@39(uint32 service_handle) |
| 370 => (BluetoothStatus status); |
325 }; | 371 }; |
326 | 372 |
327 // Next Method ID: 17 | 373 // Next Method ID: 18 |
328 interface BluetoothInstance { | 374 interface BluetoothInstance { |
329 Init@0(BluetoothHost host_ptr); | 375 Init@0(BluetoothHost host_ptr); |
330 | 376 |
331 OnAdapterProperties@1(BluetoothStatus status, | 377 OnAdapterProperties@1(BluetoothStatus status, |
332 array<BluetoothProperty> properties); | 378 array<BluetoothProperty> properties); |
333 OnRemoteDeviceProperties@2(BluetoothStatus status, | 379 OnRemoteDeviceProperties@2(BluetoothStatus status, |
334 BluetoothAddress address, | 380 BluetoothAddress address, |
335 array<BluetoothProperty> properties); | 381 array<BluetoothProperty> properties); |
336 OnDeviceFound@3(array<BluetoothProperty> properties); | 382 OnDeviceFound@3(array<BluetoothProperty> properties); |
337 OnDiscoveryStateChanged@4(BluetoothDiscoveryState state); | 383 OnDiscoveryStateChanged@4(BluetoothDiscoveryState state); |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
369 [MinVersion=3] RequestGattRead@14(BluetoothAddress address, | 415 [MinVersion=3] RequestGattRead@14(BluetoothAddress address, |
370 int32 attribute_handle, | 416 int32 attribute_handle, |
371 int32 offset, | 417 int32 offset, |
372 bool is_long) | 418 bool is_long) |
373 => (BluetoothGattStatus status, array<uint8> value); | 419 => (BluetoothGattStatus status, array<uint8> value); |
374 [MinVersion=3] RequestGattWrite@15(BluetoothAddress address, | 420 [MinVersion=3] RequestGattWrite@15(BluetoothAddress address, |
375 int32 attribute_handle, | 421 int32 attribute_handle, |
376 int32 offset, | 422 int32 offset, |
377 array<uint8> value) | 423 array<uint8> value) |
378 => (BluetoothGattStatus status); | 424 => (BluetoothGattStatus status); |
| 425 |
| 426 // Bluetooth SDP function |
| 427 [MinVersion=5] OnGetSdpRecords@17(BluetoothStatus status, |
| 428 BluetoothAddress remove_addr, |
| 429 BluetoothUUID target_uuid, |
| 430 array<BluetoothSdpRecord> records); |
379 }; | 431 }; |
OLD | NEW |