Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(498)

Side by Side Diff: third_party/WebKit/public/platform/modules/bluetooth/web_bluetooth.mojom

Issue 2637343002: Implement WebBluetooth descriptor.readValue() (Closed)
Patch Set: #1 Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 GATT_NOT_AUTHORIZED, 65 GATT_NOT_AUTHORIZED,
66 BLOCKLISTED_DESCRIPTOR_UUID, 66 BLOCKLISTED_DESCRIPTOR_UUID,
67 BLOCKLISTED_CHARACTERISTIC_UUID, 67 BLOCKLISTED_CHARACTERISTIC_UUID,
68 BLOCKLISTED_READ, 68 BLOCKLISTED_READ,
69 BLOCKLISTED_WRITE, 69 BLOCKLISTED_WRITE,
70 NOT_ALLOWED_TO_ACCESS_ANY_SERVICE, 70 NOT_ALLOWED_TO_ACCESS_ANY_SERVICE,
71 NOT_ALLOWED_TO_ACCESS_SERVICE, 71 NOT_ALLOWED_TO_ACCESS_SERVICE,
72 REQUEST_DEVICE_WITH_BLOCKLISTED_UUID, 72 REQUEST_DEVICE_WITH_BLOCKLISTED_UUID,
73 REQUEST_DEVICE_FROM_CROSS_ORIGIN_IFRAME, 73 REQUEST_DEVICE_FROM_CROSS_ORIGIN_IFRAME,
74 REQUEST_DEVICE_WITHOUT_FRAME, 74 REQUEST_DEVICE_WITHOUT_FRAME,
75 DESCRIPTOR_NO_LONGER_EXISTS,
75 }; 76 };
76 77
77 struct WebBluetoothScanFilter { 78 struct WebBluetoothScanFilter {
78 array<bluetooth.mojom.UUID>? services; 79 array<bluetooth.mojom.UUID>? services;
79 string? name; 80 string? name;
80 string? name_prefix; 81 string? name_prefix;
81 }; 82 };
82 83
83 struct WebBluetoothRequestDeviceOptions { 84 struct WebBluetoothRequestDeviceOptions {
84 array<WebBluetoothScanFilter>? filters; 85 array<WebBluetoothScanFilter>? filters;
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 // Returns the Descriptors of a GATT Characteristic with 192 // Returns the Descriptors of a GATT Characteristic with
192 // |characteristics_instance_id|. 193 // |characteristics_instance_id|.
193 // If |quantity| == WebBluetoothGATTQueryQuantity::SINGLE, only one descriptor 194 // If |quantity| == WebBluetoothGATTQueryQuantity::SINGLE, only one descriptor
194 // will be returned. 195 // will be returned.
195 RemoteCharacteristicGetDescriptors( 196 RemoteCharacteristicGetDescriptors(
196 string characteristics_instance_id, 197 string characteristics_instance_id,
197 WebBluetoothGATTQueryQuantity quantity, 198 WebBluetoothGATTQueryQuantity quantity,
198 bluetooth.mojom.UUID? descriptor_uuid) => ( 199 bluetooth.mojom.UUID? descriptor_uuid) => (
199 WebBluetoothResult result, 200 WebBluetoothResult result,
200 array<WebBluetoothRemoteGATTDescriptor>? descriptors); 201 array<WebBluetoothRemoteGATTDescriptor>? descriptors);
202
203 // Reads the value for descriptor with |descriptor_instance_id|.
scheib 2017/01/19 06:16:18 See comment style template change in tip of tree,
dougt 2017/01/20 03:17:24 Done.
204 // If the value is successfully read the callback will be run with
205 // WebBluetoothResult::SUCCESS and the descriptor's value. If the value is not
206 // successfully read the callback with be run with the corresponding error and
207 // nullptr for value.
208 RemoteDescriptorReadValue(
209 string descriptor_instance_id) => (
210 WebBluetoothResult result,
211 array<uint8>? value);
201 }; 212 };
202 213
203 // Classes should implement this interface and pass an associated pointer 214 // Classes should implement this interface and pass an associated pointer
204 // bound to them to the WebBluetoothService by using SetClient. Classes 215 // bound to them to the WebBluetoothService by using SetClient. Classes
205 // that do this will be notified of device events e.g. device disconnection. 216 // that do this will be notified of device events e.g. device disconnection.
206 interface WebBluetoothServiceClient { 217 interface WebBluetoothServiceClient {
207 RemoteCharacteristicValueChanged(string characteristic_instance_id, 218 RemoteCharacteristicValueChanged(string characteristic_instance_id,
208 array<uint8> value); 219 array<uint8> value);
209 GattServerDisconnected(WebBluetoothDeviceId device_id); 220 GattServerDisconnected(WebBluetoothDeviceId device_id);
210 }; 221 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698