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 BluetoothSdpAttrType { |
| 239 NULLTYPE = 0, |
| 240 UINT, |
| 241 INT, |
| 242 UUID, |
| 243 STRING, |
| 244 BOOL, |
| 245 SEQUENCE, |
| 246 URL, |
| 247 }; |
| 248 |
| 249 struct BluetoothSdpServiceAttr { |
| 250 BluetoothSdpAttrType type; |
| 251 uint32 type_size; |
| 252 mojo.common.mojom.ListValue value; |
| 253 array<BluetoothSdpServiceAttr> sequence; |
| 254 }; |
| 255 |
| 256 struct BluetoothSdpRecord { |
| 257 map<uint16, BluetoothSdpServiceAttr> attrs; |
| 258 }; |
| 259 |
| 260 struct BluetoothCreateSdpRecordResult { |
| 261 BluetoothStatus status; |
| 262 uint32 service_handle; |
| 263 }; |
| 264 |
| 265 // Next Method ID: 40 |
234 interface BluetoothHost { | 266 interface BluetoothHost { |
235 EnableAdapter@0() => (BluetoothAdapterState state); | 267 EnableAdapter@0() => (BluetoothAdapterState state); |
236 DisableAdapter@1() => (BluetoothAdapterState state); | 268 DisableAdapter@1() => (BluetoothAdapterState state); |
237 GetAdapterProperty@2(BluetoothPropertyType type); | 269 GetAdapterProperty@2(BluetoothPropertyType type); |
238 SetAdapterProperty@3(BluetoothProperty property); | 270 SetAdapterProperty@3(BluetoothProperty property); |
239 GetRemoteDeviceProperty@4(BluetoothAddress remote_addr, | 271 GetRemoteDeviceProperty@4(BluetoothAddress remote_addr, |
240 BluetoothPropertyType type); | 272 BluetoothPropertyType type); |
241 SetRemoteDeviceProperty@5(BluetoothAddress remote_addr, | 273 SetRemoteDeviceProperty@5(BluetoothAddress remote_addr, |
242 BluetoothProperty property); | 274 BluetoothProperty property); |
243 GetRemoteServiceRecord@6(BluetoothAddress remote_addr, | 275 GetRemoteServiceRecord@6(BluetoothAddress remote_addr, |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
315 => (BluetoothGattStatus status); | 347 => (BluetoothGattStatus status); |
316 [MinVersion=3] StopService@34(int32 service_handle) | 348 [MinVersion=3] StopService@34(int32 service_handle) |
317 => (BluetoothGattStatus status); | 349 => (BluetoothGattStatus status); |
318 [MinVersion=3] DeleteService@35(int32 service_handle) | 350 [MinVersion=3] DeleteService@35(int32 service_handle) |
319 => (BluetoothGattStatus status); | 351 => (BluetoothGattStatus status); |
320 [MinVersion=3] SendIndication@36(int32 attribute_handle, | 352 [MinVersion=3] SendIndication@36(int32 attribute_handle, |
321 BluetoothAddress address, | 353 BluetoothAddress address, |
322 bool confirm, | 354 bool confirm, |
323 array<uint8> value) | 355 array<uint8> value) |
324 => (BluetoothGattStatus status); | 356 => (BluetoothGattStatus status); |
| 357 |
| 358 // Bluetooth SDP functions |
| 359 [MinVersion=5] GetSdpRecords@37(BluetoothAddress remote_addr, |
| 360 BluetoothUUID target_uuid); |
| 361 [MinVersion=5] CreateSdpRecord@38(BluetoothSdpRecord record) |
| 362 => (BluetoothCreateSdpRecordResult result); |
| 363 [MinVersion=5] RemoveSdpRecord@39(uint32 service_handle) |
| 364 => (BluetoothStatus status); |
325 }; | 365 }; |
326 | 366 |
327 // Next Method ID: 17 | 367 // Next Method ID: 18 |
328 interface BluetoothInstance { | 368 interface BluetoothInstance { |
329 Init@0(BluetoothHost host_ptr); | 369 Init@0(BluetoothHost host_ptr); |
330 | 370 |
331 OnAdapterProperties@1(BluetoothStatus status, | 371 OnAdapterProperties@1(BluetoothStatus status, |
332 array<BluetoothProperty> properties); | 372 array<BluetoothProperty> properties); |
333 OnRemoteDeviceProperties@2(BluetoothStatus status, | 373 OnRemoteDeviceProperties@2(BluetoothStatus status, |
334 BluetoothAddress address, | 374 BluetoothAddress address, |
335 array<BluetoothProperty> properties); | 375 array<BluetoothProperty> properties); |
336 OnDeviceFound@3(array<BluetoothProperty> properties); | 376 OnDeviceFound@3(array<BluetoothProperty> properties); |
337 OnDiscoveryStateChanged@4(BluetoothDiscoveryState state); | 377 OnDiscoveryStateChanged@4(BluetoothDiscoveryState state); |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
369 [MinVersion=3] RequestGattRead@14(BluetoothAddress address, | 409 [MinVersion=3] RequestGattRead@14(BluetoothAddress address, |
370 int32 attribute_handle, | 410 int32 attribute_handle, |
371 int32 offset, | 411 int32 offset, |
372 bool is_long) | 412 bool is_long) |
373 => (BluetoothGattStatus status, array<uint8> value); | 413 => (BluetoothGattStatus status, array<uint8> value); |
374 [MinVersion=3] RequestGattWrite@15(BluetoothAddress address, | 414 [MinVersion=3] RequestGattWrite@15(BluetoothAddress address, |
375 int32 attribute_handle, | 415 int32 attribute_handle, |
376 int32 offset, | 416 int32 offset, |
377 array<uint8> value) | 417 array<uint8> value) |
378 => (BluetoothGattStatus status); | 418 => (BluetoothGattStatus status); |
| 419 |
| 420 // Bluetooth SDP function |
| 421 [MinVersion=5] OnGetSdpRecords@17(BluetoothStatus status, |
| 422 BluetoothAddress remove_addr, |
| 423 BluetoothUUID target_uuid, |
| 424 array<BluetoothSdpRecord> records); |
379 }; | 425 }; |
OLD | NEW |