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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
47 // Simple Pairing Randomizer R. | 47 // Simple Pairing Randomizer R. |
48 // Always 16 octets long. | 48 // Always 16 octets long. |
49 ArrayBuffer randomizer; | 49 ArrayBuffer randomizer; |
50 }; | 50 }; |
51 | 51 |
52 callback AddressCallback = void (DOMString result); | 52 callback AddressCallback = void (DOMString result); |
53 callback BooleanCallback = void (boolean result); | 53 callback BooleanCallback = void (boolean result); |
54 callback DataCallback = void (ArrayBuffer result); | 54 callback DataCallback = void (ArrayBuffer result); |
55 callback DeviceCallback = void (Device device); | 55 callback DeviceCallback = void (Device device); |
56 callback DevicesCallback = void (Device[] result); | 56 callback DevicesCallback = void (Device[] result); |
57 callback NameCallback = void (DOMString result); | |
57 callback OutOfBandPairingDataCallback = void (OutOfBandPairingData data); | 58 callback OutOfBandPairingDataCallback = void (OutOfBandPairingData data); |
58 callback ResultCallback = void (); | 59 callback ResultCallback = void (); |
59 callback ServicesCallback = void(ServiceRecord[] result); | 60 callback ServicesCallback = void(ServiceRecord[] result); |
60 callback SizeCallback = void (long result); | 61 callback SizeCallback = void (long result); |
61 callback SocketCallback = void (Socket result); | 62 callback SocketCallback = void (Socket result); |
62 | 63 |
63 // Options for the getDevices function. If neither |uuid| or |name| are | 64 // Options for the getDevices function. If neither |uuid| or |name| are |
64 // provided, all devices known to the system are returned. | 65 // provided, all devices known to the system are returned. |
65 dictionary GetDevicesOptions { | 66 dictionary GetDevicesOptions { |
66 // Only devices providing a service with a UUID that matches |uuid| will be | 67 // Only devices providing a service with a UUID that matches |uuid| will be |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
134 static void isAvailable(BooleanCallback callback); | 135 static void isAvailable(BooleanCallback callback); |
135 | 136 |
136 // Checks if the system's bluetooth module has power. | 137 // Checks if the system's bluetooth module has power. |
137 // |callback| : Called with the boolean result. | 138 // |callback| : Called with the boolean result. |
138 static void isPowered(BooleanCallback callback); | 139 static void isPowered(BooleanCallback callback); |
139 | 140 |
140 // Get the bluetooth address of the system's bluetooth module. | 141 // Get the bluetooth address of the system's bluetooth module. |
141 // |callback| : Called with the address, or null if there was an error. | 142 // |callback| : Called with the address, or null if there was an error. |
142 static void getAddress(AddressCallback callback); | 143 static void getAddress(AddressCallback callback); |
143 | 144 |
145 // Get the name of the Bluetooth adapter. | |
146 // |callback| : Called with the name, or null if there was an error. | |
asargent_no_longer_on_chrome
2012/08/20 19:07:19
documentation nit: from a glance at the implementa
bryeung
2012/08/20 23:13:19
Done.
| |
147 static void getName(NameCallback callback); | |
148 | |
144 // Get a list of bluetooth devices. | 149 // Get a list of bluetooth devices. |
145 // NOTE: This API is likely to change. Please see crbug.com/134545 | 150 // NOTE: This API is likely to change. Please see crbug.com/134545 |
146 // |options| : Controls which devices are returned. | 151 // |options| : Controls which devices are returned. |
147 // |callback| : Called with an array of Device objects. | 152 // |callback| : Called with an array of Device objects. |
148 static void getDevices(GetDevicesOptions options, | 153 static void getDevices(GetDevicesOptions options, |
149 DevicesCallback callback); | 154 DevicesCallback callback); |
150 | 155 |
151 // Get a list of services provided by a device. | 156 // Get a list of services provided by a device. |
152 static void getServices(GetServicesOptions options, | 157 static void getServices(GetServicesOptions options, |
153 ServicesCallback callback); | 158 ServicesCallback callback); |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
213 // Fired when the power state of bluetooth on the system changes. | 218 // Fired when the power state of bluetooth on the system changes. |
214 // |powered| : True if bluetooth is powered, false otherwise. | 219 // |powered| : True if bluetooth is powered, false otherwise. |
215 static void onPowerChanged(boolean has_power); | 220 static void onPowerChanged(boolean has_power); |
216 | 221 |
217 // Fired when the discovering state of the system changes. | 222 // Fired when the discovering state of the system changes. |
218 // |discovering| : True if the system is currently in discovery mode, false | 223 // |discovering| : True if the system is currently in discovery mode, false |
219 // otherwise. | 224 // otherwise. |
220 static void onDiscoveringChanged(boolean discovering); | 225 static void onDiscoveringChanged(boolean discovering); |
221 }; | 226 }; |
222 }; | 227 }; |
OLD | NEW |