| 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 54   WEB_BLUETOOTH_NOT_SUPPORTED, | 54   WEB_BLUETOOTH_NOT_SUPPORTED, | 
| 55   BLUETOOTH_LOW_ENERGY_NOT_AVAILABLE, | 55   BLUETOOTH_LOW_ENERGY_NOT_AVAILABLE, | 
| 56   // NotSupportedError: | 56   // NotSupportedError: | 
| 57   GATT_UNKNOWN_ERROR, | 57   GATT_UNKNOWN_ERROR, | 
| 58   GATT_UNKNOWN_FAILURE, | 58   GATT_UNKNOWN_FAILURE, | 
| 59   GATT_NOT_PERMITTED, | 59   GATT_NOT_PERMITTED, | 
| 60   GATT_NOT_SUPPORTED, | 60   GATT_NOT_SUPPORTED, | 
| 61   GATT_UNTRANSLATED_ERROR_CODE, | 61   GATT_UNTRANSLATED_ERROR_CODE, | 
| 62   // SecurityError: | 62   // SecurityError: | 
| 63   GATT_NOT_AUTHORIZED, | 63   GATT_NOT_AUTHORIZED, | 
| 64   BLACKLISTED_CHARACTERISTIC_UUID, | 64   BLOCKLISTED_CHARACTERISTIC_UUID, | 
| 65   BLACKLISTED_READ, | 65   BLOCKLISTED_READ, | 
| 66   BLACKLISTED_WRITE, | 66   BLOCKLISTED_WRITE, | 
| 67   NOT_ALLOWED_TO_ACCESS_ANY_SERVICE, | 67   NOT_ALLOWED_TO_ACCESS_ANY_SERVICE, | 
| 68   NOT_ALLOWED_TO_ACCESS_SERVICE, | 68   NOT_ALLOWED_TO_ACCESS_SERVICE, | 
| 69   REQUEST_DEVICE_WITH_BLACKLISTED_UUID, | 69   REQUEST_DEVICE_WITH_BLOCKLISTED_UUID, | 
| 70   REQUEST_DEVICE_FROM_CROSS_ORIGIN_IFRAME, | 70   REQUEST_DEVICE_FROM_CROSS_ORIGIN_IFRAME, | 
| 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 | 
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 124   // connection to the device didn't exist already. If a GATT connection existed | 124   // connection to the device didn't exist already. If a GATT connection existed | 
| 125   // already then this function increases the ref count to keep that connection | 125   // already then this function increases the ref count to keep that connection | 
| 126   // alive. | 126   // alive. | 
| 127   RemoteServerConnect(WebBluetoothDeviceId device_id) => (WebBluetoothResult res
     ult); | 127   RemoteServerConnect(WebBluetoothDeviceId device_id) => (WebBluetoothResult res
     ult); | 
| 128 | 128 | 
| 129   // If a GATT connection exists for Device with |device_id| then decreases | 129   // If a GATT connection exists for Device with |device_id| then decreases | 
| 130   // the ref count for that connection. | 130   // the ref count for that connection. | 
| 131   RemoteServerDisconnect(WebBluetoothDeviceId device_id); | 131   RemoteServerDisconnect(WebBluetoothDeviceId device_id); | 
| 132 | 132 | 
| 133   // If |services_uuid| is present, returns services with |services_uuid|. | 133   // If |services_uuid| is present, returns services with |services_uuid|. | 
| 134   // Otherwise returns all non-blacklisted services. | 134   // Otherwise returns all non-blocklisted services. | 
| 135   // If |quantity| == WebBluetoothGATTQueryQuantity::SINGLE, only one | 135   // If |quantity| == WebBluetoothGATTQueryQuantity::SINGLE, only one | 
| 136   // service will be returned. | 136   // service will be returned. | 
| 137   RemoteServerGetPrimaryServices( | 137   RemoteServerGetPrimaryServices( | 
| 138     WebBluetoothDeviceId device_id, | 138     WebBluetoothDeviceId device_id, | 
| 139     WebBluetoothGATTQueryQuantity quantity, | 139     WebBluetoothGATTQueryQuantity quantity, | 
| 140     bluetooth.mojom.UUID? services_uuid) => ( | 140     bluetooth.mojom.UUID? services_uuid) => ( | 
| 141       WebBluetoothResult result, | 141       WebBluetoothResult result, | 
| 142       array<WebBluetoothRemoteGATTService>? services); | 142       array<WebBluetoothRemoteGATTService>? services); | 
| 143 | 143 | 
| 144   // Returns the Characteristics of a GATT Service with |service_instance_id|. | 144   // Returns the Characteristics of a GATT Service with |service_instance_id|. | 
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 181 }; | 181 }; | 
| 182 | 182 | 
| 183 // Classes should implement this interface and pass an associated pointer | 183 // Classes should implement this interface and pass an associated pointer | 
| 184 // bound to them to the WebBluetoothService by using SetClient. Classes | 184 // bound to them to the WebBluetoothService by using SetClient. Classes | 
| 185 // that do this will be notified of device events e.g. device disconnection. | 185 // that do this will be notified of device events e.g. device disconnection. | 
| 186 interface WebBluetoothServiceClient { | 186 interface WebBluetoothServiceClient { | 
| 187   RemoteCharacteristicValueChanged(string characteristic_instance_id, | 187   RemoteCharacteristicValueChanged(string characteristic_instance_id, | 
| 188                                    array<uint8> value); | 188                                    array<uint8> value); | 
| 189   GattServerDisconnected(WebBluetoothDeviceId device_id); | 189   GattServerDisconnected(WebBluetoothDeviceId device_id); | 
| 190 }; | 190 }; | 
| OLD | NEW | 
|---|