Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1520)

Unified Diff: device/bluetooth/bluetooth_device.h

Issue 246603008: Expose device RSSI and Tx power via the chrome.bluetooth API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Forward-declare more APIs introduced in Lion Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/common/extensions/api/bluetooth.idl ('k') | device/bluetooth/bluetooth_device_chromeos.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/bluetooth/bluetooth_device.h
diff --git a/device/bluetooth/bluetooth_device.h b/device/bluetooth/bluetooth_device.h
index 28fd7ac12d18dec7797222a67bd63c79d47d6c6e..220066c0aa61cb2c4b9264e39cbf9f11944352be 100644
--- a/device/bluetooth/bluetooth_device.h
+++ b/device/bluetooth/bluetooth_device.h
@@ -66,6 +66,9 @@ class BluetoothDevice {
DEVICE_KEYBOARD_MOUSE_COMBO
};
+ // The value returned if the RSSI or transmit power cannot be read.
+ static const int kUnknownPower = 127;
+
// Possible errors passed back to an error callback function in case of a
// failed call to Connect().
enum ConnectErrorCode {
@@ -227,6 +230,28 @@ class BluetoothDevice {
// DEVICE_PERIPHERAL.
DeviceType GetDeviceType() const;
+ // Gets the "received signal strength indication" (RSSI) of the current
+ // connection to the device. The RSSI indicates the power present in the
+ // received radio signal, measured in dBm, to a resolution of 1dBm. Larger
+ // (typically, less negative) values indicate a stronger signal.
+ // If the device is not currently connected, then returns the RSSI read from
+ // the last inquiry that returned the device, where available. In case of an
+ // error, returns |kUnknownPower|. Otherwise, returns the connection's RSSI.
+ virtual int GetRSSI() const = 0;
+
+ // These two methods are used to read the current or maximum transmit power
+ // ("Tx power") of the current connection to the device. The transmit power
+ // indicates the strength of the signal broadcast from the host's Bluetooth
+ // antenna when communicating with the device, measured in dBm, to a
+ // resolution of 1dBm. Larger (typically, less negative) values
+ // indicate a stronger signal.
+ // It is only meaningful to call this method when there is a connection
+ // established to the device. If there is no connection, or in case of an
+ // error, returns |kUnknownPower|. Otherwise, returns the connection's
+ // transmit power.
+ virtual int GetCurrentHostTransmitPower() const = 0;
+ virtual int GetMaximumHostTransmitPower() const = 0;
+
// Indicates whether the device is known to support pairing based on its
// device class and address.
bool IsPairable() const;
« no previous file with comments | « chrome/common/extensions/api/bluetooth.idl ('k') | device/bluetooth/bluetooth_device_chromeos.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698