| 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 | 6 |
| 7 namespace bluetooth { | 7 namespace bluetooth { |
| 8 dictionary AdapterState { | 8 dictionary AdapterState { |
| 9 // The address of the adapter, in the format 'XX:XX:XX:XX:XX:XX'. | 9 // The address of the adapter, in the format 'XX:XX:XX:XX:XX:XX'. |
| 10 DOMString address; | 10 DOMString address; |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 // device is cleared instead. | 149 // device is cleared instead. |
| 150 OutOfBandPairingData? data; | 150 OutOfBandPairingData? data; |
| 151 }; | 151 }; |
| 152 | 152 |
| 153 // Options for the startDiscovery function. | 153 // Options for the startDiscovery function. |
| 154 dictionary StartDiscoveryOptions { | 154 dictionary StartDiscoveryOptions { |
| 155 // Called for each device that is discovered. | 155 // Called for each device that is discovered. |
| 156 DeviceCallback deviceCallback; | 156 DeviceCallback deviceCallback; |
| 157 }; | 157 }; |
| 158 | 158 |
| 159 // These functions all report failures via chrome.extension.lastError. | 159 // These functions all report failures via chrome.runtime.lastError. |
| 160 interface Functions { | 160 interface Functions { |
| 161 // Get information about the Bluetooth adapter. | 161 // Get information about the Bluetooth adapter. |
| 162 // |callback| : Called with an AdapterState object describing the adapter | 162 // |callback| : Called with an AdapterState object describing the adapter |
| 163 // state. | 163 // state. |
| 164 static void getAdapterState(AdapterStateCallback callback); | 164 static void getAdapterState(AdapterStateCallback callback); |
| 165 | 165 |
| 166 // Get a bluetooth devices known to the system. Known devices are either | 166 // Get a bluetooth devices known to the system. Known devices are either |
| 167 // currently bonded, or have been bonded in the past. | 167 // currently bonded, or have been bonded in the past. |
| 168 // |options| : Controls which devices are returned and provides | 168 // |options| : Controls which devices are returned and provides |
| 169 // |deviceCallback|, which is called for each matching device. | 169 // |deviceCallback|, which is called for each matching device. |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 static void stopDiscovery( | 229 static void stopDiscovery( |
| 230 optional ResultCallback callback); | 230 optional ResultCallback callback); |
| 231 }; | 231 }; |
| 232 | 232 |
| 233 interface Events { | 233 interface Events { |
| 234 // Fired when the state of the Bluetooth adapter changes. | 234 // Fired when the state of the Bluetooth adapter changes. |
| 235 // |state| : The new state of the adapter. | 235 // |state| : The new state of the adapter. |
| 236 static void onAdapterStateChanged(AdapterState state); | 236 static void onAdapterStateChanged(AdapterState state); |
| 237 }; | 237 }; |
| 238 }; | 238 }; |
| OLD | NEW |