Chromium Code Reviews| Index: device/bluetooth/bluetooth_adapter_mac.mm |
| diff --git a/device/bluetooth/bluetooth_adapter_mac.mm b/device/bluetooth/bluetooth_adapter_mac.mm |
| index ef4a20dee2da1156e992a84add68576b47755754..eb54042f88d7034d338a5f56e41095feb5d08f18 100644 |
| --- a/device/bluetooth/bluetooth_adapter_mac.mm |
| +++ b/device/bluetooth/bluetooth_adapter_mac.mm |
| @@ -539,8 +539,19 @@ void BluetoothAdapterMac::LowEnergyDeviceUpdated( |
| std::vector<uint8_t>(bytes, bytes + length)); |
| } |
| - device_mac->UpdateAdvertisementData(std::move(advertised_uuids), |
| - std::move(service_data_map)); |
| + // Get Tx Power. |
| + base::Optional<int8_t> clamped_tx_power; |
| + NSNumber* tx_power = |
| + [advertisement_data objectForKey:CBAdvertisementDataTxPowerLevelKey]; |
| + clamped_tx_power = |
| + tx_power == nil ? base::nullopt |
|
Jeffrey Yasskin
2016/08/24 04:32:02
Either make this the initialization of the variabl
ortuno
2016/08/24 21:29:09
Done. hmm I wonder why I declared the variable up
|
| + : base::make_optional<int8_t>( |
| + BluetoothDevice::ClampPower([tx_power intValue])); |
| + |
| + device_mac->UpdateAdvertisementData( |
| + BluetoothDevice::ClampPower(rssi), std::move(advertised_uuids), |
| + std::move(service_data_map), |
| + clamped_tx_power ? &clamped_tx_power.value() : nullptr); |
| if (is_new_device) { |
| std::string device_address = |