Chromium Code Reviews| 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 // Errors that can occur during Web Bluetooth execution, which are transformed | 7 // Errors that can occur during Web Bluetooth execution, which are transformed |
| 8 // to a DOMException in Source/modules/bluetooth/BluetoothError.cpp. | 8 // to a DOMException in Source/modules/bluetooth/BluetoothError.cpp. |
| 9 // | 9 // |
| 10 // These errors all produce constant message strings. If a particular message | 10 // These errors all produce constant message strings. If a particular message |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 90 // https://crbug.com/508771 | 90 // https://crbug.com/508771 |
| 91 | 91 |
| 92 // Web Bluetooth Interface that Blink can use to perform | 92 // Web Bluetooth Interface that Blink can use to perform |
| 93 // Bluetooth GATT Operations on Bluetooth Devices. | 93 // Bluetooth GATT Operations on Bluetooth Devices. |
| 94 interface WebBluetoothService { | 94 interface WebBluetoothService { |
| 95 // Sets the client for this WebBluetoothService. The service will notify the | 95 // Sets the client for this WebBluetoothService. The service will notify the |
| 96 // client of device events e.g. when a Characteristic's value changes or when | 96 // client of device events e.g. when a Characteristic's value changes or when |
| 97 // a device disconnects. | 97 // a device disconnects. |
| 98 SetClient(associated WebBluetoothServiceClient client); | 98 SetClient(associated WebBluetoothServiceClient client); |
| 99 | 99 |
| 100 // Creates a GATT Connection to a Bluetooth Device with |device_id| if a | |
| 101 // connection to the device didn't exist already. If a GATT connection existed | |
| 102 // already then this function increases the ref count to keep that connection | |
|
Jeffrey Yasskin
2016/05/03 01:15:57
If the connection already existed, this should als
ortuno
2016/05/03 16:11:54
Should I add a TODO for that issue here?
Jeffrey Yasskin
2016/05/03 16:31:32
Oops, I meant to remove this comment: I think the
| |
| 103 // alive. | |
| 104 RemoteServerConnect(string device_id) => (WebBluetoothError error); | |
| 105 | |
| 106 // If a GATT connection exists for Device with |device_id| then decreases | |
| 107 // the ref count for that connection. | |
| 108 RemoteServerDisconnect(string device_id); | |
| 109 | |
| 100 // Returns the first GATT Service with |service_uuid| of a Bluetooth Device | 110 // Returns the first GATT Service with |service_uuid| of a Bluetooth Device |
| 101 // with |device_id|. | 111 // with |device_id|. |
| 102 RemoteServerGetPrimaryService( | 112 RemoteServerGetPrimaryService( |
| 103 string device_id, | 113 string device_id, |
| 104 string service_uuid) => ( | 114 string service_uuid) => ( |
| 105 WebBluetoothError error, | 115 WebBluetoothError error, |
| 106 WebBluetoothRemoteGATTService? service); | 116 WebBluetoothRemoteGATTService? service); |
| 107 | 117 |
| 108 // Returns the Characteristics of a GATT Service with |service_instance_id|. | 118 // Returns the Characteristics of a GATT Service with |service_instance_id|. |
| 109 // If |quantity| == WebBluetoothGATTQueryQuantity::SINGLE, only one | 119 // If |quantity| == WebBluetoothGATTQueryQuantity::SINGLE, only one |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 144 string characteristic_instance_id) => (); | 154 string characteristic_instance_id) => (); |
| 145 }; | 155 }; |
| 146 | 156 |
| 147 // Classes should implement this interface and pass an associated pointer | 157 // Classes should implement this interface and pass an associated pointer |
| 148 // bound to them to the WebBluetoothService by using SetClient. Classes | 158 // bound to them to the WebBluetoothService by using SetClient. Classes |
| 149 // that do this will be notified of device events e.g. device disconnection. | 159 // that do this will be notified of device events e.g. device disconnection. |
| 150 interface WebBluetoothServiceClient { | 160 interface WebBluetoothServiceClient { |
| 151 RemoteCharacteristicValueChanged(string characteristic_instance_id, | 161 RemoteCharacteristicValueChanged(string characteristic_instance_id, |
| 152 array<uint8> value); | 162 array<uint8> value); |
| 153 }; | 163 }; |
| OLD | NEW |