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; |