| OLD | NEW |
| 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 { | |
| 16 Unknown, | |
| 17 Bluetooth, | |
| 18 USB | |
| 19 }; | |
| 20 | |
| 21 WebBluetoothDevice(const WebString& id, | 15 WebBluetoothDevice(const WebString& id, |
| 22 const WebString& name, | 16 const WebString& name, |
| 23 int8_t txPower, | 17 int8_t txPower, |
| 24 int8_t rssi, | 18 int8_t rssi, |
| 25 int32_t deviceClass, | |
| 26 VendorIDSource vendorIDSource, | |
| 27 uint16_t vendorID, | |
| 28 uint16_t productID, | |
| 29 uint16_t productVersion, | |
| 30 const WebVector<WebString>& uuids) | 19 const WebVector<WebString>& uuids) |
| 31 : id(id) | 20 : id(id) |
| 32 , name(name) | 21 , name(name) |
| 33 , txPower(txPower) | 22 , txPower(txPower) |
| 34 , rssi(rssi) | 23 , rssi(rssi) |
| 35 , deviceClass(deviceClass) | |
| 36 , vendorIDSource(vendorIDSource) | |
| 37 , vendorID(vendorID) | |
| 38 , productID(productID) | |
| 39 , productVersion(productVersion) | |
| 40 , uuids(uuids) | 24 , uuids(uuids) |
| 41 { | 25 { |
| 42 } | 26 } |
| 43 | 27 |
| 44 // Members corresponding to BluetoothDevice attributes as specified in IDL. | 28 // Members corresponding to BluetoothDevice attributes as specified in IDL. |
| 45 const WebString id; | 29 const WebString id; |
| 46 const WebString name; | 30 const WebString name; |
| 47 // Powers: | 31 // Powers: |
| 48 // A value of 127 denotes an invalid power. | 32 // A value of 127 denotes an invalid power. |
| 49 const int8_t txPower; | 33 const int8_t txPower; |
| 50 const int8_t rssi; | 34 const int8_t rssi; |
| 51 const int32_t deviceClass; | |
| 52 const VendorIDSource vendorIDSource; | |
| 53 const uint16_t vendorID; | |
| 54 const uint16_t productID; | |
| 55 const uint16_t productVersion; | |
| 56 const WebVector<WebString> uuids; | 35 const WebVector<WebString> uuids; |
| 57 }; | 36 }; |
| 58 | 37 |
| 59 } // namespace blink | 38 } // namespace blink |
| 60 | 39 |
| 61 #endif // WebBluetoothDevice_h | 40 #endif // WebBluetoothDevice_h |
| OLD | NEW |