OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 // The <code>chrome.bluetoothLowEnergy</code> API is used to communicate with | 5 // The <code>chrome.bluetoothLowEnergy</code> API is used to communicate with |
6 // Bluetooth Smart (Low Energy) devices. | 6 // Bluetooth Smart (Low Energy) devices. |
7 namespace bluetoothLowEnergy { | 7 namespace bluetoothLowEnergy { |
8 // Values representing the possible properties of a characteristic. | 8 // Values representing the possible properties of a characteristic. |
9 enum CharacteristicProperty {broadcast, read, writeWithoutResponse, write, | 9 enum CharacteristicProperty {broadcast, read, writeWithoutResponse, write, |
10 notify, indicate, authenticatedSignedWrites, | 10 notify, indicate, authenticatedSignedWrites, |
(...skipping 14 matching lines...) Expand all Loading... |
25 // application and available to other peripherals, or a remote service | 25 // application and available to other peripherals, or a remote service |
26 // hosted and received from a remote peripheral. | 26 // hosted and received from a remote peripheral. |
27 boolean isLocal; | 27 boolean isLocal; |
28 | 28 |
29 // Returns the identifier assigned to this service. Use the instance ID to | 29 // Returns the identifier assigned to this service. Use the instance ID to |
30 // distinguish between services from a peripheral with the same UUID and | 30 // distinguish between services from a peripheral with the same UUID and |
31 // to make function calls that take in a service identifier. Present, if | 31 // to make function calls that take in a service identifier. Present, if |
32 // this instance represents a remote service. | 32 // this instance represents a remote service. |
33 DOMString? instanceId; | 33 DOMString? instanceId; |
34 | 34 |
35 // The remote peripheral that the GATT service belongs to. Present, if this | 35 // The device address of the remote peripheral that the GATT service belongs |
36 // instance represents a remote service. | 36 // to. Present, if this instance represents a remote service. |
37 bluetooth.Device? device; | 37 DOMString? deviceAddress; |
38 }; | 38 }; |
39 | 39 |
40 // Represents a GATT characteristic, which is a basic data element that | 40 // Represents a GATT characteristic, which is a basic data element that |
41 // provides further information about a peripheral's service. | 41 // provides further information about a peripheral's service. |
42 dictionary Characteristic { | 42 dictionary Characteristic { |
43 // The UUID of the characteristic, e.g. | 43 // The UUID of the characteristic, e.g. |
44 // 00002a37-0000-1000-8000-00805f9b34fb. | 44 // 00002a37-0000-1000-8000-00805f9b34fb. |
45 DOMString uuid; | 45 DOMString uuid; |
46 | 46 |
47 // Indicates whether this characteristic represents a local characteristic | 47 // Indicates whether this characteristic represents a local characteristic |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 // |service| : The GATT service that was removed. | 219 // |service| : The GATT service that was removed. |
220 static void onServiceRemoved(Service service); | 220 static void onServiceRemoved(Service service); |
221 | 221 |
222 // Fired when the value of a remote GATT characteristic changes, either as | 222 // Fired when the value of a remote GATT characteristic changes, either as |
223 // a result of a read or write request, or a value change notification or | 223 // a result of a read or write request, or a value change notification or |
224 // indication. | 224 // indication. |
225 // |characteristic| : The GATT characteristic whose value has changed. | 225 // |characteristic| : The GATT characteristic whose value has changed. |
226 static void onCharacteristicValueChanged(Characteristic characteristic); | 226 static void onCharacteristicValueChanged(Characteristic characteristic); |
227 }; | 227 }; |
228 }; | 228 }; |
OLD | NEW |