| 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 blink.mojom; | 5 module blink.mojom; |
| 6 | 6 |
| 7 import "device/bluetooth/public/interfaces/uuid.mojom"; | 7 import "device/bluetooth/public/interfaces/uuid.mojom"; |
| 8 | 8 |
| 9 // Result codes that can occur during Web Bluetooth execution, which are | 9 // Result codes that can occur during Web Bluetooth execution, which are |
| 10 // transformed to a DOMException in Source/modules/bluetooth/BluetoothError.cpp. | 10 // transformed to a DOMException in Source/modules/bluetooth/BluetoothError.cpp. |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 REQUEST_DEVICE_WITHOUT_FRAME, | 71 REQUEST_DEVICE_WITHOUT_FRAME, |
| 72 }; | 72 }; |
| 73 | 73 |
| 74 struct WebBluetoothScanFilter { | 74 struct WebBluetoothScanFilter { |
| 75 array<bluetooth.mojom.UUID>? services; | 75 array<bluetooth.mojom.UUID>? services; |
| 76 string? name; | 76 string? name; |
| 77 string? name_prefix; | 77 string? name_prefix; |
| 78 }; | 78 }; |
| 79 | 79 |
| 80 struct WebBluetoothRequestDeviceOptions { | 80 struct WebBluetoothRequestDeviceOptions { |
| 81 array<WebBluetoothScanFilter> filters; | 81 array<WebBluetoothScanFilter>? filters; |
| 82 array<bluetooth.mojom.UUID> optional_services; | 82 array<bluetooth.mojom.UUID> optional_services; |
| 83 bool accept_all_devices; |
| 83 }; | 84 }; |
| 84 | 85 |
| 85 // Indicates if the function will return a single or multiple | 86 // Indicates if the function will return a single or multiple |
| 86 // GATT objects. | 87 // GATT objects. |
| 87 enum WebBluetoothGATTQueryQuantity { | 88 enum WebBluetoothGATTQueryQuantity { |
| 88 SINGLE, | 89 SINGLE, |
| 89 MULTIPLE | 90 MULTIPLE |
| 90 }; | 91 }; |
| 91 | 92 |
| 92 struct WebBluetoothDeviceId { | 93 struct WebBluetoothDeviceId { |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 }; | 182 }; |
| 182 | 183 |
| 183 // Classes should implement this interface and pass an associated pointer | 184 // Classes should implement this interface and pass an associated pointer |
| 184 // bound to them to the WebBluetoothService by using SetClient. Classes | 185 // bound to them to the WebBluetoothService by using SetClient. Classes |
| 185 // that do this will be notified of device events e.g. device disconnection. | 186 // that do this will be notified of device events e.g. device disconnection. |
| 186 interface WebBluetoothServiceClient { | 187 interface WebBluetoothServiceClient { |
| 187 RemoteCharacteristicValueChanged(string characteristic_instance_id, | 188 RemoteCharacteristicValueChanged(string characteristic_instance_id, |
| 188 array<uint8> value); | 189 array<uint8> value); |
| 189 GattServerDisconnected(WebBluetoothDeviceId device_id); | 190 GattServerDisconnected(WebBluetoothDeviceId device_id); |
| 190 }; | 191 }; |
| OLD | NEW |