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

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

Issue 1427653003: bluetooth: Implement TxPower and RSSI of BluetoothAdvertisementData (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@my-origin
Patch Set: Moar tests and int8_t IPC 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 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 "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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698