| 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 // Values representing the possible properties of a characteristic, which | 9 // Values representing the possible properties of a characteristic, which |
| 10 // define how the characteristic can be used. Each of these properties serve | 10 // define how the characteristic can be used. Each of these properties serve |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 UUID uuid; | 51 UUID uuid; |
| 52 bool is_primary; | 52 bool is_primary; |
| 53 }; | 53 }; |
| 54 | 54 |
| 55 struct CharacteristicInfo { | 55 struct CharacteristicInfo { |
| 56 string id; | 56 string id; |
| 57 UUID uuid; | 57 UUID uuid; |
| 58 uint32 properties; | 58 uint32 properties; |
| 59 }; | 59 }; |
| 60 | 60 |
| 61 struct DescriptorInfo { |
| 62 string id; |
| 63 UUID uuid; |
| 64 }; |
| 65 |
| 61 interface Device { | 66 interface Device { |
| 62 // Disconnects and deletes the Device. | 67 // Disconnects and deletes the Device. |
| 63 Disconnect(); | 68 Disconnect(); |
| 64 | 69 |
| 65 // Gets basic information about the device. Returns null, if no device is | 70 // Gets basic information about the device. Returns null, if no device is |
| 66 // available. | 71 // available. |
| 67 GetInfo() => (DeviceInfo? info); | 72 GetInfo() => (DeviceInfo? info); |
| 68 | 73 |
| 69 // Gets the GATT Services in this device's GATT Server. | 74 // Gets the GATT Services in this device's GATT Server. |
| 70 GetServices() => (array<ServiceInfo> services); | 75 GetServices() => (array<ServiceInfo> services); |
| 71 | 76 |
| 72 // Gets the GATT Characteristics in the GATT Service with |service_id|. | 77 // Gets the GATT Characteristics in the GATT Service with |service_id|. |
| 73 // If |characteristics| is null, an error occured while attempting to retrieve | 78 // If |characteristics| is null, an error occured while attempting to retrieve |
| 74 // the array of characteristics. If |characteristics| is empty, this simply | 79 // the array of characteristics. If |characteristics| is empty, this simply |
| 75 // means that no characteristics were found. | 80 // means that no characteristics were found. |
| 76 GetCharacteristics(string service_id) => | 81 GetCharacteristics(string service_id) => |
| 77 (array<CharacteristicInfo>? characteristics); | 82 (array<CharacteristicInfo>? characteristics); |
| 83 |
| 84 // Gets the GATT Descriptors of the GATT Characteristic with matching |
| 85 // |characteristic_id| in the GATT Service with matching |service_id|. |
| 86 // If |descriptors| is null, an error occured while attempting to retrieve |
| 87 // the array of descriptors. If |descriptors| is empty, this simply |
| 88 // means that no descriptors were found. |
| 89 GetDescriptors(string service_id, string characteristic_id) => |
| 90 (array<DescriptorInfo>? descriptors); |
| 78 }; | 91 }; |
| OLD | NEW |