| 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 using the | 6 // Bluetooth Smart (Low Energy) devices using the |
| 7 // <a href="https://developer.bluetooth.org/TechnologyOverview/Pages/GATT.aspx"> | 7 // <a href="https://developer.bluetooth.org/TechnologyOverview/Pages/GATT.aspx"> |
| 8 // Generic Attribute Profile (GATT)</a>. | 8 // Generic Attribute Profile (GATT)</a>. |
| 9 namespace bluetoothLowEnergy { | 9 namespace bluetoothLowEnergy { |
| 10 // Values representing the possible properties of a characteristic. | 10 // Values representing the possible properties of a characteristic. |
| 11 enum CharacteristicProperty {broadcast, read, writeWithoutResponse, write, | 11 enum CharacteristicProperty {broadcast, read, writeWithoutResponse, write, |
| 12 notify, indicate, authenticatedSignedWrites, | 12 notify, indicate, authenticatedSignedWrites, |
| 13 extendedProperties, reliableWrite, | 13 extendedProperties, reliableWrite, |
| 14 writeableAuxiliaries}; | 14 writableAuxiliaries}; |
| 15 | 15 |
| 16 // Represents a peripheral's Bluetooth GATT Service, a collection of | 16 // Represents a peripheral's Bluetooth GATT Service, a collection of |
| 17 // characteristics and relationships to other services that encapsulate | 17 // characteristics and relationships to other services that encapsulate |
| 18 // the behavior of part of a device. | 18 // the behavior of part of a device. |
| 19 dictionary Service { | 19 dictionary Service { |
| 20 // The UUID of the service, e.g. 0000180d-0000-1000-8000-00805f9b34fb. | 20 // The UUID of the service, e.g. 0000180d-0000-1000-8000-00805f9b34fb. |
| 21 DOMString uuid; | 21 DOMString uuid; |
| 22 | 22 |
| 23 // Indicates whether the type of this service is primary or secondary. | 23 // Indicates whether the type of this service is primary or secondary. |
| 24 boolean isPrimary; | 24 boolean isPrimary; |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 227 // |characteristic| : The GATT characteristic whose value has changed. | 227 // |characteristic| : The GATT characteristic whose value has changed. |
| 228 static void onCharacteristicValueChanged(Characteristic characteristic); | 228 static void onCharacteristicValueChanged(Characteristic characteristic); |
| 229 | 229 |
| 230 // Fired when the value of a remote GATT characteristic descriptor changes, | 230 // Fired when the value of a remote GATT characteristic descriptor changes, |
| 231 // usually as a result of a read or write request. | 231 // usually as a result of a read or write request. |
| 232 // |descriptor| : The GATT characteristic descriptor whose value has | 232 // |descriptor| : The GATT characteristic descriptor whose value has |
| 233 // changed. | 233 // changed. |
| 234 static void onDescriptorValueChanged(Descriptor descriptor); | 234 static void onDescriptorValueChanged(Descriptor descriptor); |
| 235 }; | 235 }; |
| 236 }; | 236 }; |
| OLD | NEW |