| 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 bluetooth.mojom; | 5 module bluetooth.mojom; |
| 6 | 6 |
| 7 import "device/bluetooth/public/interfaces/uuid.mojom"; | 7 import "device/bluetooth/public/interfaces/uuid.mojom"; |
| 8 | 8 |
| 9 // TODO(crbug.com/657632): Remove when numerical values can be optional. | 9 // TODO(crbug.com/657632): Remove when numerical values can be optional. |
| 10 struct RSSIWrapper { | 10 struct RSSIWrapper { |
| 11 int8 value; | 11 int8 value; |
| 12 }; | 12 }; |
| 13 | 13 |
| 14 struct DeviceInfo { | 14 struct DeviceInfo { |
| 15 string? name; | 15 string? name; |
| 16 string name_for_display; | 16 string name_for_display; |
| 17 string address; | 17 string address; |
| 18 bool is_gatt_connected; | 18 bool is_gatt_connected; |
| 19 RSSIWrapper? rssi; | 19 RSSIWrapper? rssi; |
| 20 }; | 20 }; |
| 21 | 21 |
| 22 struct ServiceInfo { | 22 struct ServiceInfo { |
| 23 string id; | 23 string id; |
| 24 UUID uuid; | 24 UUID uuid; |
| 25 bool is_primary; | 25 bool is_primary; |
| 26 }; | 26 }; |
| 27 | 27 |
| 28 struct Properties { |
| 29 bool broadcast; |
| 30 bool read; |
| 31 bool write_without_response; |
| 32 bool write; |
| 33 bool notify; |
| 34 bool indicate; |
| 35 bool authenticated_signed_writes; |
| 36 bool extended_properties; |
| 37 bool reliable_write; |
| 38 bool writable_auxiliaries; |
| 39 bool read_encrypted; |
| 40 bool write_encrypted; |
| 41 bool read_encrypted_authenticated; |
| 42 bool write_encrypted_authenticated; |
| 43 }; |
| 44 |
| 45 struct CharacteristicInfo { |
| 46 string id; |
| 47 UUID uuid; |
| 48 Properties properties; |
| 49 }; |
| 50 |
| 28 interface Device { | 51 interface Device { |
| 29 // Disconnects and deletes the Device. | 52 // Disconnects and deletes the Device. |
| 30 Disconnect(); | 53 Disconnect(); |
| 31 | 54 |
| 32 // Gets basic information about the device. Returns null, if no device is | 55 // Gets basic information about the device. Returns null, if no device is |
| 33 // available. | 56 // available. |
| 34 GetInfo() => (DeviceInfo? info); | 57 GetInfo() => (DeviceInfo? info); |
| 35 | 58 |
| 36 // Gets the GATT Services in this device's GATT Server. | 59 // Gets the GATT Services in this device's GATT Server. |
| 37 GetServices() => (array<ServiceInfo> services); | 60 GetServices() => (array<ServiceInfo> services); |
| 61 |
| 62 // Gets the GATT Characteristics in the GATT Service with |service_id|. |
| 63 GetCharacteristics(string service_id) => |
| 64 (array<CharacteristicInfo> characteristics); |
| 38 }; | 65 }; |
| OLD | NEW |