| 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 // Bluetooth Terminology: | 9 // Bluetooth Terminology: | 
| 10 // | 10 // | 
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 96   GATT_NOT_AUTHORIZED, | 96   GATT_NOT_AUTHORIZED, | 
| 97   BLOCKLISTED_DESCRIPTOR_UUID, | 97   BLOCKLISTED_DESCRIPTOR_UUID, | 
| 98   BLOCKLISTED_CHARACTERISTIC_UUID, | 98   BLOCKLISTED_CHARACTERISTIC_UUID, | 
| 99   BLOCKLISTED_READ, | 99   BLOCKLISTED_READ, | 
| 100   BLOCKLISTED_WRITE, | 100   BLOCKLISTED_WRITE, | 
| 101   NOT_ALLOWED_TO_ACCESS_ANY_SERVICE, | 101   NOT_ALLOWED_TO_ACCESS_ANY_SERVICE, | 
| 102   NOT_ALLOWED_TO_ACCESS_SERVICE, | 102   NOT_ALLOWED_TO_ACCESS_SERVICE, | 
| 103   REQUEST_DEVICE_WITH_BLOCKLISTED_UUID, | 103   REQUEST_DEVICE_WITH_BLOCKLISTED_UUID, | 
| 104   REQUEST_DEVICE_FROM_CROSS_ORIGIN_IFRAME, | 104   REQUEST_DEVICE_FROM_CROSS_ORIGIN_IFRAME, | 
| 105   REQUEST_DEVICE_WITHOUT_FRAME, | 105   REQUEST_DEVICE_WITHOUT_FRAME, | 
|  | 106   DESCRIPTOR_NO_LONGER_EXISTS, | 
| 106 }; | 107 }; | 
| 107 | 108 | 
| 108 struct WebBluetoothScanFilter { | 109 struct WebBluetoothScanFilter { | 
| 109   array<bluetooth.mojom.UUID>? services; | 110   array<bluetooth.mojom.UUID>? services; | 
| 110   string? name; | 111   string? name; | 
| 111   string? name_prefix; | 112   string? name_prefix; | 
| 112 }; | 113 }; | 
| 113 | 114 | 
| 114 struct WebBluetoothRequestDeviceOptions { | 115 struct WebBluetoothRequestDeviceOptions { | 
| 115   array<WebBluetoothScanFilter>? filters; | 116   array<WebBluetoothScanFilter>? filters; | 
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 232   // If |descriptor_uuid| is present, filters descriptors by | 233   // If |descriptor_uuid| is present, filters descriptors by | 
| 233   // |descriptor_uuid|. Otherwise returns all non-blocklisted descriptors. | 234   // |descriptor_uuid|. Otherwise returns all non-blocklisted descriptors. | 
| 234   // If |quantity| == WebBluetoothGATTQueryQuantity::SINGLE, at most one | 235   // If |quantity| == WebBluetoothGATTQueryQuantity::SINGLE, at most one | 
| 235   // characteristic will be returned. | 236   // characteristic will be returned. | 
| 236   RemoteCharacteristicGetDescriptors( | 237   RemoteCharacteristicGetDescriptors( | 
| 237     string characteristics_instance_id, | 238     string characteristics_instance_id, | 
| 238     WebBluetoothGATTQueryQuantity quantity, | 239     WebBluetoothGATTQueryQuantity quantity, | 
| 239     bluetooth.mojom.UUID? descriptor_uuid) => ( | 240     bluetooth.mojom.UUID? descriptor_uuid) => ( | 
| 240       WebBluetoothResult result, | 241       WebBluetoothResult result, | 
| 241       array<WebBluetoothRemoteGATTDescriptor>? descriptors); | 242       array<WebBluetoothRemoteGATTDescriptor>? descriptors); | 
|  | 243 | 
|  | 244   // Reads the value for the descriptor identified by | 
|  | 245   // |descriptor_instance_id|. If the value is successfully read the callback | 
|  | 246   // will be run with WebBluetoothResult::SUCCESS and the descriptor's value. If | 
|  | 247   // the value is not successfully read the callback with be run with the | 
|  | 248   // corresponding error and nullptr for value | 
|  | 249   RemoteDescriptorReadValue( | 
|  | 250     string descriptor_instance_id) => ( | 
|  | 251     WebBluetoothResult result, | 
|  | 252     array<uint8>? value); | 
| 242 }; | 253 }; | 
| 243 | 254 | 
| 244 // Classes should implement this interface and pass an associated pointer | 255 // Classes should implement this interface and pass an associated pointer | 
| 245 // bound to them to the WebBluetoothService by using SetClient. Classes | 256 // bound to them to the WebBluetoothService by using SetClient. Classes | 
| 246 // that do this will be notified of device events e.g. device disconnection. | 257 // that do this will be notified of device events e.g. device disconnection. | 
| 247 interface WebBluetoothServiceClient { | 258 interface WebBluetoothServiceClient { | 
| 248   // The characteristic identified by |characteristic_instance_id| has received | 259   // The characteristic identified by |characteristic_instance_id| has received | 
| 249   // a notification of value change. | 260   // a notification of value change. | 
| 250   RemoteCharacteristicValueChanged(string characteristic_instance_id, | 261   RemoteCharacteristicValueChanged(string characteristic_instance_id, | 
| 251                                    array<uint8> value); | 262                                    array<uint8> value); | 
| 252 | 263 | 
| 253   // The device identified by |device_id| has been disconnected. | 264   // The device identified by |device_id| has been disconnected. | 
| 254   GattServerDisconnected(WebBluetoothDeviceId device_id); | 265   GattServerDisconnected(WebBluetoothDeviceId device_id); | 
| 255 }; | 266 }; | 
| OLD | NEW | 
|---|