OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // Bluetooth API. | 5 // Bluetooth API. |
6 // TODO(bryeung): mark this API as ChromeOS only (see crbug.com/119398). | 6 // TODO(bryeung): mark this API as ChromeOS only (see crbug.com/119398). |
7 | 7 |
8 namespace experimental.bluetooth { | 8 namespace experimental.bluetooth { |
9 dictionary Device { | 9 dictionary Device { |
10 // The address of the device, in the format 'XX:XX:XX:XX:XX:XX'. | 10 // The address of the device, in the format 'XX:XX:XX:XX:XX:XX'. |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 OutOfBandPairingDataCallback callback); | 183 OutOfBandPairingDataCallback callback); |
184 | 184 |
185 // Set the Out of Band Pairing data for a remote device. | 185 // Set the Out of Band Pairing data for a remote device. |
186 // Any previous Out Of Band Pairing Data for this device is overwritten. | 186 // Any previous Out Of Band Pairing Data for this device is overwritten. |
187 // |options| : The options for this function. | 187 // |options| : The options for this function. |
188 // |callback| : Called to indicate success or failure. | 188 // |callback| : Called to indicate success or failure. |
189 static void setOutOfBandPairingData(SetOutOfBandPairingDataOptions options, | 189 static void setOutOfBandPairingData(SetOutOfBandPairingDataOptions options, |
190 optional ResultCallback callback); | 190 optional ResultCallback callback); |
191 | 191 |
192 // Start discovery. Discovered devices will be returned via the | 192 // Start discovery. Discovered devices will be returned via the |
193 // |onDeviceDiscovered| callback. Note that discovery can be resource | 193 // |onDeviceDiscovered| callback. Discovery will fail to start if it is |
194 // intensive. stopDiscovery should be called as soon as is convenient. | 194 // already in progress. Discovery can be resource intensive: stopDiscovery |
| 195 // should be called as soon as possible. |
195 // |options| : The options for this function. | 196 // |options| : The options for this function. |
196 // |callback| : Called to indicate success or failure. | 197 // |callback| : Called to indicate success or failure. |
197 static void startDiscovery( | 198 static void startDiscovery( |
198 StartDiscoveryOptions options, | 199 StartDiscoveryOptions options, |
199 optional ResultCallback callback); | 200 optional ResultCallback callback); |
200 | 201 |
201 // Stop discovery. | 202 // Stop discovery. |
202 // |callback| : Called to indicate success or failure. | 203 // |callback| : Called to indicate success or failure. |
203 static void stopDiscovery( | 204 static void stopDiscovery( |
204 optional ResultCallback callback); | 205 optional ResultCallback callback); |
205 }; | 206 }; |
206 | 207 |
207 interface Events { | 208 interface Events { |
208 // Fired when the availability of bluetooth on the system changes. | 209 // Fired when the availability of bluetooth on the system changes. |
209 // |available| : True if bluetooth is available, false otherwise. | 210 // |available| : True if bluetooth is available, false otherwise. |
210 static void onAvailabilityChanged(boolean available); | 211 static void onAvailabilityChanged(boolean available); |
211 | 212 |
212 // Fired when the power state of bluetooth on the system changes. | 213 // Fired when the power state of bluetooth on the system changes. |
213 // |powered| : True if bluetooth is powered, false otherwise. | 214 // |powered| : True if bluetooth is powered, false otherwise. |
214 static void onPowerChanged(boolean has_power); | 215 static void onPowerChanged(boolean has_power); |
215 | 216 |
216 // Fired when the discovering state of the system changes. | 217 // Fired when the discovering state of the system changes. |
217 // |discovering| : True if the system is currently in discovery mode, false | 218 // |discovering| : True if the system is currently in discovery mode, false |
218 // otherwise. | 219 // otherwise. |
219 static void onDiscoveringChanged(boolean discovering); | 220 static void onDiscoveringChanged(boolean discovering); |
220 }; | 221 }; |
221 }; | 222 }; |
OLD | NEW |