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

Unified Diff: device/bluetooth/dbus/bluetooth_device_client.cc

Issue 1941923002: bluetooth: Return int8_t and use -128 for unknown tx power. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@my-origin
Patch Set: Moar fixes Created 4 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/dbus/bluetooth_device_client.cc
diff --git a/device/bluetooth/dbus/bluetooth_device_client.cc b/device/bluetooth/dbus/bluetooth_device_client.cc
index 11626f505a7be6f202afbdd338256831215fccb7..6663f9a3fccc5234b316ecda0c28003b2f639834 100644
--- a/device/bluetooth/dbus/bluetooth_device_client.cc
+++ b/device/bluetooth/dbus/bluetooth_device_client.cc
@@ -18,8 +18,10 @@ namespace bluez {
namespace {
-// Value returned for the the RSSI or TX power if it cannot be read.
-const int kUnknownPower = 127;
+// The value returned if the RSSI cannot be read.
+constexpr int8_t kUnknownRSSI = 127;
scheib 2016/05/04 01:18:38 Let's use the constants from bluetootn_device.h
ortuno 2016/05/04 16:44:12 I don't think we are allowed to depend on device/b
+// The value returned if the TxPower cannot be read.
+constexpr int8_t kUnknownTxPower = -128;
} // namespace
@@ -320,9 +322,9 @@ class BluetoothDeviceClientImpl : public BluetoothDeviceClient,
// Called when a response for the GetConnInfo method is received.
void OnGetConnInfoSuccess(const ConnInfoCallback& callback,
dbus::Response* response) {
- int16_t rssi = kUnknownPower;
- int16_t transmit_power = kUnknownPower;
- int16_t max_transmit_power = kUnknownPower;
+ int16_t rssi = kUnknownRSSI;
+ int16_t transmit_power = kUnknownTxPower;
+ int16_t max_transmit_power = kUnknownTxPower;
if (!response) {
LOG(ERROR) << "GetConnInfo succeeded, but no response received.";

Powered by Google App Engine
This is Rietveld 408576698