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

Side by Side Diff: third_party/WebKit/public/platform/modules/bluetooth/WebBluetoothDevice.h

Issue 1427653003: bluetooth: Implement TxPower and RSSI of BluetoothAdvertisementData (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@my-origin
Patch Set: Address scheib's comments 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
« no previous file with comments | « third_party/WebKit/Source/modules/modules.gypi ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef WebBluetoothDevice_h 5 #ifndef WebBluetoothDevice_h
6 #define WebBluetoothDevice_h 6 #define WebBluetoothDevice_h
7 7
8 #include "public/platform/WebString.h" 8 #include "public/platform/WebString.h"
9 #include "public/platform/WebVector.h" 9 #include "public/platform/WebVector.h"
10 10
11 namespace blink { 11 namespace blink {
12 12
13 // Information describing a Bluetooth device provided by the platform. 13 // Information describing a Bluetooth device provided by the platform.
14 struct WebBluetoothDevice { 14 struct WebBluetoothDevice {
15 enum class VendorIDSource { 15 enum class VendorIDSource {
16 Unknown, 16 Unknown,
17 Bluetooth, 17 Bluetooth,
18 USB 18 USB
19 }; 19 };
20 20
21 WebBluetoothDevice(const WebString& id, 21 WebBluetoothDevice(const WebString& id,
22 const WebString& name, 22 const WebString& name,
23 int txPower,
24 int rssi,
23 int32_t deviceClass, 25 int32_t deviceClass,
24 VendorIDSource vendorIDSource, 26 VendorIDSource vendorIDSource,
25 uint16_t vendorID, 27 uint16_t vendorID,
26 uint16_t productID, 28 uint16_t productID,
27 uint16_t productVersion, 29 uint16_t productVersion,
28 bool paired, 30 bool paired,
29 const WebVector<WebString>& uuids) 31 const WebVector<WebString>& uuids)
30 : id(id) 32 : id(id)
31 , name(name) 33 , name(name)
34 , txPower(txPower)
35 , rssi(rssi)
32 , deviceClass(deviceClass) 36 , deviceClass(deviceClass)
33 , vendorIDSource(vendorIDSource) 37 , vendorIDSource(vendorIDSource)
34 , vendorID(vendorID) 38 , vendorID(vendorID)
35 , productID(productID) 39 , productID(productID)
36 , productVersion(productVersion) 40 , productVersion(productVersion)
37 , paired(paired) 41 , paired(paired)
38 , uuids(uuids) 42 , uuids(uuids)
39 { 43 {
40 } 44 }
41 45
42 // Members corresponding to BluetoothDevice attributes as specified in IDL. 46 // Members corresponding to BluetoothDevice attributes as specified in IDL.
43 const WebString id; 47 const WebString id;
44 const WebString name; 48 const WebString name;
49 // Powers:
50 // In practice these values should be between [-127, 20], but since the
51 // since the underlying platform uses int16 rather than int8 blink turns
scheib 2015/10/29 20:59:13 I don't think the int16 reference makes much sense
52 // values smaller than INT8_MIN or larger than INT8_MAX into INT8_MAX. A
53 // value of INT8_MAX denotes an invalid power.
54 const int txPower;
55 const int rssi;
45 const int32_t deviceClass; 56 const int32_t deviceClass;
46 const VendorIDSource vendorIDSource; 57 const VendorIDSource vendorIDSource;
47 const uint16_t vendorID; 58 const uint16_t vendorID;
48 const uint16_t productID; 59 const uint16_t productID;
49 const uint16_t productVersion; 60 const uint16_t productVersion;
50 const bool paired; 61 const bool paired;
51 const WebVector<WebString> uuids; 62 const WebVector<WebString> uuids;
52 }; 63 };
53 64
54 } // namespace blink 65 } // namespace blink
55 66
56 #endif // WebBluetoothDevice_h 67 #endif // WebBluetoothDevice_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/modules/modules.gypi ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698