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

Unified Diff: extensions/browser/api/bluetooth/bluetooth_api_utils.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: Fix extensions tests Created 4 years, 7 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: extensions/browser/api/bluetooth/bluetooth_api_utils.cc
diff --git a/extensions/browser/api/bluetooth/bluetooth_api_utils.cc b/extensions/browser/api/bluetooth/bluetooth_api_utils.cc
index 1b0c61e64e886010ca239c5f866160f168b9f775..62a5b8eee63a5a83cab42e278dadb8a23a3cd1fd 100644
--- a/extensions/browser/api/bluetooth/bluetooth_api_utils.cc
+++ b/extensions/browser/api/bluetooth/bluetooth_api_utils.cc
@@ -121,13 +121,13 @@ void BluetoothDeviceToApiDevice(const device::BluetoothDevice& device,
string_uuids->push_back(iter->canonical_value());
out->uuids.reset(string_uuids);
- if (device.GetInquiryRSSI() != device::BluetoothDevice::kUnknownPower)
- out->inquiry_rssi.reset(new int(device.GetInquiryRSSI()));
+ if (device.GetInquiryRSSI())
+ out->inquiry_rssi.reset(new int(device.GetInquiryRSSI().value()));
else
out->inquiry_rssi.reset();
- if (device.GetInquiryTxPower() != device::BluetoothDevice::kUnknownPower)
- out->inquiry_tx_power.reset(new int(device.GetInquiryTxPower()));
+ if (device.GetInquiryTxPower())
+ out->inquiry_tx_power.reset(new int(device.GetInquiryTxPower().value()));
else
out->inquiry_tx_power.reset();
}

Powered by Google App Engine
This is Rietveld 408576698