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 module arc.mojom; | 5 module arc.mojom; |
6 | 6 |
7 [Extensible] | 7 [Extensible] |
8 enum BluetoothAdapterState { | 8 enum BluetoothAdapterState { |
9 OFF = 0, | 9 OFF = 0, |
10 ON | 10 ON |
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
218 uint16 start_handle; | 218 uint16 start_handle; |
219 uint16 end_handle; | 219 uint16 end_handle; |
220 | 220 |
221 /* | 221 /* |
222 * If |type| is |BTGATT_DB_CHARACTERISTIC|, this contains the properties of | 222 * If |type| is |BTGATT_DB_CHARACTERISTIC|, this contains the properties of |
223 * the characteristic. | 223 * the characteristic. |
224 */ | 224 */ |
225 uint8 properties; | 225 uint8 properties; |
226 }; | 226 }; |
227 | 227 |
228 // Bluetooth SDP types | |
229 [Extensible] | |
230 enum BluetoothSdpAttrType { | |
231 NULLTYPE = 0, | |
232 UINT, | |
233 INT, | |
234 UUID, | |
235 STRING, | |
236 BOOL, | |
237 SEQUENCE, | |
238 URL, | |
239 }; | |
240 | |
241 struct BluetoothSdpServiceAttr { | |
242 BluetoothSdpAttrType type; | |
243 uint32 type_size; | |
244 array<uint8> value; | |
rickyz (no longer on Chrome)
2016/08/16 23:55:07
Why do different integer types need to be stuffed
rickyz (no longer on Chrome)
2016/08/17 00:20:30
Correction: It turns out mojo support unions - for
Miao
2016/08/17 14:30:20
The original plan is to use base::ListValue to pas
rickyz (no longer on Chrome)
2016/08/17 18:54:54
Yeah, I think a union would be preferable here, al
| |
245 array<BluetoothSdpServiceAttr> sequence; | |
246 }; | |
247 | |
248 struct BluetoothSdpRecord { | |
249 map<uint16, BluetoothSdpServiceAttr> attrs; | |
250 }; | |
251 | |
252 struct BluetoothCreateSdpRecordResult { | |
253 BluetoothStatus status; | |
254 uint32 service_handle; | |
255 }; | |
256 | |
228 interface BluetoothHost { | 257 interface BluetoothHost { |
229 EnableAdapter@0() => (BluetoothAdapterState state); | 258 EnableAdapter@0() => (BluetoothAdapterState state); |
230 DisableAdapter@1() => (BluetoothAdapterState state); | 259 DisableAdapter@1() => (BluetoothAdapterState state); |
231 GetAdapterProperty@2(BluetoothPropertyType type); | 260 GetAdapterProperty@2(BluetoothPropertyType type); |
232 SetAdapterProperty@3(BluetoothProperty property); | 261 SetAdapterProperty@3(BluetoothProperty property); |
233 GetRemoteDeviceProperty@4(BluetoothAddress remote_addr, | 262 GetRemoteDeviceProperty@4(BluetoothAddress remote_addr, |
234 BluetoothPropertyType type); | 263 BluetoothPropertyType type); |
235 SetRemoteDeviceProperty@5(BluetoothAddress remote_addr, | 264 SetRemoteDeviceProperty@5(BluetoothAddress remote_addr, |
236 BluetoothProperty property); | 265 BluetoothProperty property); |
237 GetRemoteServiceRecord@6(BluetoothAddress remote_addr, | 266 GetRemoteServiceRecord@6(BluetoothAddress remote_addr, |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
309 => (BluetoothGattStatus status); | 338 => (BluetoothGattStatus status); |
310 [MinVersion=3] StopService@34(int32 service_handle) | 339 [MinVersion=3] StopService@34(int32 service_handle) |
311 => (BluetoothGattStatus status); | 340 => (BluetoothGattStatus status); |
312 [MinVersion=3] DeleteService@35(int32 service_handle) | 341 [MinVersion=3] DeleteService@35(int32 service_handle) |
313 => (BluetoothGattStatus status); | 342 => (BluetoothGattStatus status); |
314 [MinVersion=3] SendIndication@36(int32 attribute_handle, | 343 [MinVersion=3] SendIndication@36(int32 attribute_handle, |
315 BluetoothAddress address, | 344 BluetoothAddress address, |
316 bool confirm, | 345 bool confirm, |
317 array<uint8> value) | 346 array<uint8> value) |
318 => (BluetoothGattStatus status); | 347 => (BluetoothGattStatus status); |
348 | |
349 // Bluetooth SDP functions | |
350 [MinVersion=4] GetSdpRecords@37(BluetoothAddress remote_addr, | |
351 BluetoothUUID target_uuid); | |
352 [MinVersion=4] CreateSdpRecord@38(BluetoothSdpRecord record) | |
353 => (BluetoothCreateSdpRecordResult result); | |
354 [MinVersion=4] RemoveSdpRecord@39(uint32 service_handle) | |
355 => (BluetoothStatus status); | |
319 }; | 356 }; |
320 | 357 |
321 interface BluetoothInstance { | 358 interface BluetoothInstance { |
322 Init@0(BluetoothHost host_ptr); | 359 Init@0(BluetoothHost host_ptr); |
323 | 360 |
324 OnAdapterProperties@1(BluetoothStatus status, | 361 OnAdapterProperties@1(BluetoothStatus status, |
325 array<BluetoothProperty> properties); | 362 array<BluetoothProperty> properties); |
326 OnRemoteDeviceProperties@2(BluetoothStatus status, | 363 OnRemoteDeviceProperties@2(BluetoothStatus status, |
327 BluetoothAddress address, | 364 BluetoothAddress address, |
328 array<BluetoothProperty> properties); | 365 array<BluetoothProperty> properties); |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
360 [MinVersion=3] RequestGattRead@14(BluetoothAddress address, | 397 [MinVersion=3] RequestGattRead@14(BluetoothAddress address, |
361 int32 attribute_handle, | 398 int32 attribute_handle, |
362 int32 offset, | 399 int32 offset, |
363 bool is_long) | 400 bool is_long) |
364 => (BluetoothGattStatus status, array<uint8> value); | 401 => (BluetoothGattStatus status, array<uint8> value); |
365 [MinVersion=3] RequestGattWrite@15(BluetoothAddress address, | 402 [MinVersion=3] RequestGattWrite@15(BluetoothAddress address, |
366 int32 attribute_handle, | 403 int32 attribute_handle, |
367 int32 offset, | 404 int32 offset, |
368 array<uint8> value) | 405 array<uint8> value) |
369 => (BluetoothGattStatus status); | 406 => (BluetoothGattStatus status); |
407 | |
408 // Bluetooth SDP function | |
409 [MinVersion=4] OnGetSdpRecords@16(BluetoothStatus status, | |
410 BluetoothAddress remove_addr, | |
411 BluetoothUUID target_uuid, | |
412 array<BluetoothSdpRecord> records); | |
370 }; | 413 }; |
OLD | NEW |