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 "config.h" |
| 6 #include "modules/bluetooth/BluetoothAdvertisingData.h" |
| 7 |
| 8 namespace blink { |
| 9 |
| 10 namespace { |
| 11 const int kUnknownPower = 127; |
| 12 } // namespace |
| 13 |
| 14 BluetoothAdvertisingData* BluetoothAdvertisingData::create(int8_t txPower, int8_
t rssi) |
| 15 { |
| 16 return new BluetoothAdvertisingData(txPower, rssi); |
| 17 } |
| 18 |
| 19 int8_t BluetoothAdvertisingData::txPower(bool& isNull) |
| 20 { |
| 21 if (m_txPower == kUnknownPower) { |
| 22 isNull = true; |
| 23 } |
| 24 return m_txPower; |
| 25 } |
| 26 |
| 27 int8_t BluetoothAdvertisingData::rssi(bool& isNull) |
| 28 { |
| 29 if (m_rssi == kUnknownPower) { |
| 30 isNull = true; |
| 31 } |
| 32 return m_rssi; |
| 33 } |
| 34 |
| 35 BluetoothAdvertisingData::BluetoothAdvertisingData(int8_t txPower, int8_t rssi) |
| 36 : m_txPower(txPower) |
| 37 , m_rssi(rssi) |
| 38 { |
| 39 } |
| 40 |
| 41 } // namespace blink |
OLD | NEW |