| 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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 // possible device types. When in doubt you should use the |deviceClass| | 58 // possible device types. When in doubt you should use the |deviceClass| |
| 59 // field directly. | 59 // field directly. |
| 60 DeviceType? type; | 60 DeviceType? type; |
| 61 | 61 |
| 62 // Indicates whether or not the device is paired with the system. | 62 // Indicates whether or not the device is paired with the system. |
| 63 boolean? paired; | 63 boolean? paired; |
| 64 | 64 |
| 65 // Indicates whether the device is currently connected to the system. | 65 // Indicates whether the device is currently connected to the system. |
| 66 boolean? connected; | 66 boolean? connected; |
| 67 | 67 |
| 68 // Indicates the RSSI ("received signal strength indication") of the | |
| 69 // connection to the device, measured in dBm, to a resolution of 1dBm. | |
| 70 // If the device is currently connected, then measures the RSSI of the | |
| 71 // connection signal. Otherwise, measures the RSSI of the last inquiry sent | |
| 72 // to the device, where available. Absent if unavailable. | |
| 73 [nodoc] long? rssi; | |
| 74 | |
| 75 // Indicates the host's current transmit power ("Tx power") for the | |
| 76 // connection to the device, measured in dBm, to a resolution of 1dBm. | |
| 77 // This value is only available if the device is currently connected. | |
| 78 [nodoc] long? currentHostTransmitPower; | |
| 79 | |
| 80 // Indicates the host's maximum transmit power ("Tx power") for the | |
| 81 // connection to the device, measured in dBm, to a resolution of 1dBm. | |
| 82 // This value is only available if the device is currently connected. | |
| 83 [nodoc] long? maximumHostTransmitPower; | |
| 84 | |
| 85 // UUIDs of protocols, profiles and services advertised by the device. | 68 // UUIDs of protocols, profiles and services advertised by the device. |
| 86 // For classic Bluetooth devices, this list is obtained from EIR data and | 69 // For classic Bluetooth devices, this list is obtained from EIR data and |
| 87 // SDP tables. For Low Energy devices, this list is obtained from AD and | 70 // SDP tables. For Low Energy devices, this list is obtained from AD and |
| 88 // GATT primary services. For dual mode devices this may be obtained from | 71 // GATT primary services. For dual mode devices this may be obtained from |
| 89 // both. | 72 // both. |
| 90 DOMString[]? uuids; | 73 DOMString[]? uuids; |
| 91 }; | 74 }; |
| 92 | 75 |
| 93 // Callback from the <code>getDevice</code> method. | 76 // Callback from the <code>getDevice</code> method. |
| 94 // |deviceInfo| : Object containing the device information. | 77 // |deviceInfo| : Object containing the device information. |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 | 130 |
| 148 // Fired when information about a known Bluetooth device has changed. | 131 // Fired when information about a known Bluetooth device has changed. |
| 149 static void onDeviceChanged(Device device); | 132 static void onDeviceChanged(Device device); |
| 150 | 133 |
| 151 // Fired when a Bluetooth device that was previously discovered has been | 134 // Fired when a Bluetooth device that was previously discovered has been |
| 152 // out of range for long enough to be considered unavailable again, and | 135 // out of range for long enough to be considered unavailable again, and |
| 153 // when a paired device is removed. | 136 // when a paired device is removed. |
| 154 static void onDeviceRemoved(Device device); | 137 static void onDeviceRemoved(Device device); |
| 155 }; | 138 }; |
| 156 }; | 139 }; |
| OLD | NEW |