| OLD | NEW |
| (Empty) |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "modules/bluetooth/BluetoothAdvertisingData.h" | |
| 6 | |
| 7 namespace blink { | |
| 8 | |
| 9 namespace { | |
| 10 // TODO(ortuno): RSSI Unknown and Tx Power Unknown should have different | |
| 11 // values. Add kUnknownTxPower when implemented: http://crbug.com/551572 | |
| 12 const int kUnknownPower = 127; | |
| 13 } // namespace | |
| 14 | |
| 15 BluetoothAdvertisingData* BluetoothAdvertisingData::create(int8_t txPower, int8_
t rssi) | |
| 16 { | |
| 17 return new BluetoothAdvertisingData(txPower, rssi); | |
| 18 } | |
| 19 | |
| 20 int8_t BluetoothAdvertisingData::txPower(bool& isNull) | |
| 21 { | |
| 22 if (m_txPower == kUnknownPower) { | |
| 23 isNull = true; | |
| 24 } | |
| 25 return m_txPower; | |
| 26 } | |
| 27 | |
| 28 int8_t BluetoothAdvertisingData::rssi(bool& isNull) | |
| 29 { | |
| 30 if (m_rssi == kUnknownPower) { | |
| 31 isNull = true; | |
| 32 } | |
| 33 return m_rssi; | |
| 34 } | |
| 35 | |
| 36 BluetoothAdvertisingData::BluetoothAdvertisingData(int8_t txPower, int8_t rssi) | |
| 37 : m_txPower(txPower) | |
| 38 , m_rssi(rssi) | |
| 39 { | |
| 40 } | |
| 41 | |
| 42 } // namespace blink | |
| OLD | NEW |