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

Side by Side Diff: third_party/WebKit/Source/modules/bluetooth/BluetoothAdvertisingData.cpp

Issue 1945823003: bluetooth: Remove BluetoothAdvertisementData (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@my-origin
Patch Set: Fix test 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 unified diff | Download patch
OLDNEW
(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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698