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

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: Implemented as a property of the Device object 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
Index: device/bluetooth/bluetooth_device.h
diff --git a/device/bluetooth/bluetooth_device.h b/device/bluetooth/bluetooth_device.h
index 7a29cac6235287c51a90fba637199bc483b8d22f..5bdb2f37e90ea99e7ca109ca41aaa00fa15c6c23 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.
+ // 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 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;

Powered by Google App Engine
This is Rietveld 408576698