Chromium Code Reviews| 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 [nodoc] namespace experimental.bluetooth { | 8 [nodoc] namespace experimental.bluetooth { |
| 9 dictionary Device { | 9 dictionary Device { |
| 10 DOMString address; | 10 DOMString address; |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 94 static void getOutOfBandPairingData(OutOfBandPairingDataCallback callback); | 94 static void getOutOfBandPairingData(OutOfBandPairingDataCallback callback); |
| 95 | 95 |
| 96 // Set the Out of Band Pairing data for the bluetooth device at |address|. | 96 // Set the Out of Band Pairing data for the bluetooth device at |address|. |
| 97 // |address| : The bluetooth address of the device sending the data. | 97 // |address| : The bluetooth address of the device sending the data. |
| 98 // |data| : The data. | 98 // |data| : The data. |
| 99 // |callback| : Called to indicate success or failure. | 99 // |callback| : Called to indicate success or failure. |
| 100 static void setOutOfBandPairingData( | 100 static void setOutOfBandPairingData( |
| 101 DOMString address, | 101 DOMString address, |
| 102 OutOfBandPairingData data, | 102 OutOfBandPairingData data, |
| 103 optional ResultCallback callback); | 103 optional ResultCallback callback); |
| 104 | |
| 105 // Start discovery. Discovered devices will be returned via the | |
| 106 // onDeviceDiscovered event. Note that discovery can be resource | |
| 107 // intensive. stopDiscovery should be called as soon as is convenient. | |
| 108 static void startDiscovery(); | |
|
asargent_no_longer_on_chrome
2012/06/14 18:23:55
FYI, another approach we could take is to have thi
| |
| 109 | |
| 110 // Stop discovery. | |
| 111 static void stopDiscovery(); | |
|
asargent_no_longer_on_chrome
2012/06/14 18:23:55
nit: startDiscovery and stopDiscovery should proba
| |
| 104 }; | 112 }; |
| 105 | 113 |
| 106 interface Events { | 114 interface Events { |
| 107 // Fired when the availability of bluetooth on the system changes. | 115 // Fired when the availability of bluetooth on the system changes. |
| 108 // |available| : True if bluetooth is available, false otherwise. | 116 // |available| : True if bluetooth is available, false otherwise. |
| 109 static void onAvailabilityChanged(boolean available); | 117 static void onAvailabilityChanged(boolean available); |
| 110 | 118 |
| 119 // Fired when a new device is discovered. This event will only be fired | |
| 120 // after a call to startDiscovery(), and before any subsequent call to | |
| 121 // stopDiscovery(). | |
| 122 static void onDeviceDiscovered(Device device); | |
| 123 | |
| 111 // Fired when the power state of bluetooth on the system changes. | 124 // Fired when the power state of bluetooth on the system changes. |
| 112 // |powered| : True if bluetooth is powered, false otherwise. | 125 // |powered| : True if bluetooth is powered, false otherwise. |
| 113 static void onPowerChanged(boolean has_power); | 126 static void onPowerChanged(boolean has_power); |
| 114 }; | 127 }; |
| 115 }; | 128 }; |
| OLD | NEW |