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 // Use the <code>chrome.bluetooth</code> API to connect to a Bluetooth | 5 // Use the <code>chrome.bluetooth</code> API to connect to a Bluetooth |
6 // device. All functions report failures via chrome.runtime.lastError. | 6 // device. All functions report failures via chrome.runtime.lastError. |
7 namespace bluetooth { | 7 namespace bluetooth { |
8 // Allocation authorities for Vendor IDs. | 8 // Allocation authorities for Vendor IDs. |
9 enum VendorIdSource {bluetooth, usb}; | 9 enum VendorIdSource {bluetooth, usb}; |
10 | 10 |
(...skipping 17 matching lines...) Expand all Loading... |
28 boolean available; | 28 boolean available; |
29 | 29 |
30 // Indicates whether or not the adapter is currently discovering. | 30 // Indicates whether or not the adapter is currently discovering. |
31 boolean discovering; | 31 boolean discovering; |
32 }; | 32 }; |
33 | 33 |
34 // Callback from the <code>getAdapterState</code> method. | 34 // Callback from the <code>getAdapterState</code> method. |
35 // |adapterInfo| : Object containing the adapter information. | 35 // |adapterInfo| : Object containing the adapter information. |
36 callback AdapterStateCallback = void(AdapterState adapterInfo); | 36 callback AdapterStateCallback = void(AdapterState adapterInfo); |
37 | 37 |
38 // Information about the state of a known Bluetooth device. | 38 // Information about the state of a known Bluetooth device. Note: this |
| 39 // dictionary is also used in bluetooth_private.idl |
39 dictionary Device { | 40 dictionary Device { |
40 // The address of the device, in the format 'XX:XX:XX:XX:XX:XX'. | 41 // The address of the device, in the format 'XX:XX:XX:XX:XX:XX'. |
41 DOMString address; | 42 DOMString address; |
42 | 43 |
43 // The human-readable name of the device. | 44 // The human-readable name of the device. |
44 DOMString? name; | 45 DOMString? name; |
45 | 46 |
46 // The class of the device, a bit-field defined by | 47 // The class of the device, a bit-field defined by |
47 // http://www.bluetooth.org/en-us/specification/assigned-numbers/baseband. | 48 // http://www.bluetooth.org/en-us/specification/assigned-numbers/baseband. |
48 long? deviceClass; | 49 long? deviceClass; |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 | 140 |
140 // Fired when information about a known Bluetooth device has changed. | 141 // Fired when information about a known Bluetooth device has changed. |
141 static void onDeviceChanged(Device device); | 142 static void onDeviceChanged(Device device); |
142 | 143 |
143 // Fired when a Bluetooth device that was previously discovered has been | 144 // Fired when a Bluetooth device that was previously discovered has been |
144 // out of range for long enough to be considered unavailable again, and | 145 // out of range for long enough to be considered unavailable again, and |
145 // when a paired device is removed. | 146 // when a paired device is removed. |
146 static void onDeviceRemoved(Device device); | 147 static void onDeviceRemoved(Device device); |
147 }; | 148 }; |
148 }; | 149 }; |
OLD | NEW |