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

Unified Diff: content/common/bluetooth/bluetooth_device.h

Issue 1427653003: bluetooth: Implement TxPower and RSSI of BluetoothAdvertisementData (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@my-origin
Patch Set: Change PowerValueAdapter to int8_t Created 5 years, 1 month 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: content/common/bluetooth/bluetooth_device.h
diff --git a/content/common/bluetooth/bluetooth_device.h b/content/common/bluetooth/bluetooth_device.h
index 73aef998b4bc768ac651ad62176062380a977147..575f43af1c796ed173cb0144f106fea81dce1222 100644
--- a/content/common/bluetooth/bluetooth_device.h
+++ b/content/common/bluetooth/bluetooth_device.h
@@ -20,6 +20,8 @@ struct CONTENT_EXPORT BluetoothDevice {
BluetoothDevice();
BluetoothDevice(const std::string& id,
const base::string16& name,
+ int8_t tx_power,
+ int8_t rssi,
uint32 device_class,
device::BluetoothDevice::VendorIDSource vendor_id_source,
uint16 vendor_id,
@@ -31,9 +33,18 @@ struct CONTENT_EXPORT BluetoothDevice {
static std::vector<std::string> UUIDsFromBluetoothUUIDs(
const device::BluetoothDevice::UUIDList& uuid_list);
+ // 127 is used as Unknown Power. According to the Bluetooth spec valid powers
+ // are between [-127, 127]. Anything outside this range will be considered
+ // Unknown Power.
+ static int8_t ValidatePower(int16_t power);
+ // TODO(ortuno): RSSI Unknown and Tx Power Unknown should have different
+ // values. Add kUnknownTxPower when implemented: http://crbug.com/551572
+ const static int8_t kUnknownPower = 127;
std::string id;
base::string16 name;
+ int8_t tx_power;
+ int8_t rssi;
uint32 device_class;
device::BluetoothDevice::VendorIDSource vendor_id_source;
uint16 vendor_id;
« no previous file with comments | « content/browser/bluetooth/bluetooth_dispatcher_host.cc ('k') | content/common/bluetooth/bluetooth_device.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698