OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 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 CONTENT_COMMON_BLUETOOTH_BLUETOOTH_DEVICE_H_ | 5 #ifndef CONTENT_COMMON_BLUETOOTH_BLUETOOTH_DEVICE_H_ |
6 #define CONTENT_COMMON_BLUETOOTH_BLUETOOTH_DEVICE_H_ | 6 #define CONTENT_COMMON_BLUETOOTH_BLUETOOTH_DEVICE_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <string> | 10 #include <string> |
(...skipping 10 matching lines...) Expand all Loading... |
21 BluetoothDevice(); | 21 BluetoothDevice(); |
22 BluetoothDevice(const std::string& id, | 22 BluetoothDevice(const std::string& id, |
23 const base::string16& name, | 23 const base::string16& name, |
24 int8_t tx_power, | 24 int8_t tx_power, |
25 int8_t rssi, | 25 int8_t rssi, |
26 uint32_t device_class, | 26 uint32_t device_class, |
27 device::BluetoothDevice::VendorIDSource vendor_id_source, | 27 device::BluetoothDevice::VendorIDSource vendor_id_source, |
28 uint16_t vendor_id, | 28 uint16_t vendor_id, |
29 uint16_t product_id, | 29 uint16_t product_id, |
30 uint16_t product_version, | 30 uint16_t product_version, |
31 bool paired, | |
32 const std::vector<std::string>& uuids); | 31 const std::vector<std::string>& uuids); |
33 ~BluetoothDevice(); | 32 ~BluetoothDevice(); |
34 | 33 |
35 static std::vector<std::string> UUIDsFromBluetoothUUIDs( | 34 static std::vector<std::string> UUIDsFromBluetoothUUIDs( |
36 const device::BluetoothDevice::UUIDList& uuid_list); | 35 const device::BluetoothDevice::UUIDList& uuid_list); |
37 // 127 is used as Unknown Power. According to the Bluetooth spec valid powers | 36 // 127 is used as Unknown Power. According to the Bluetooth spec valid powers |
38 // are between [-127, 127]. Anything outside this range will be considered | 37 // are between [-127, 127]. Anything outside this range will be considered |
39 // Unknown Power. | 38 // Unknown Power. |
40 static int8_t ValidatePower(int16_t power); | 39 static int8_t ValidatePower(int16_t power); |
41 // TODO(ortuno): RSSI Unknown and Tx Power Unknown should have different | 40 // TODO(ortuno): RSSI Unknown and Tx Power Unknown should have different |
42 // values. Add kUnknownTxPower when implemented: http://crbug.com/551572 | 41 // values. Add kUnknownTxPower when implemented: http://crbug.com/551572 |
43 const static int8_t kUnknownPower = 127; | 42 const static int8_t kUnknownPower = 127; |
44 | 43 |
45 std::string id; | 44 std::string id; |
46 base::string16 name; | 45 base::string16 name; |
47 int8_t tx_power; | 46 int8_t tx_power; |
48 int8_t rssi; | 47 int8_t rssi; |
49 uint32_t device_class; | 48 uint32_t device_class; |
50 device::BluetoothDevice::VendorIDSource vendor_id_source; | 49 device::BluetoothDevice::VendorIDSource vendor_id_source; |
51 uint16_t vendor_id; | 50 uint16_t vendor_id; |
52 uint16_t product_id; | 51 uint16_t product_id; |
53 uint16_t product_version; | 52 uint16_t product_version; |
54 bool paired; | |
55 std::vector<std::string> uuids; // 128bit UUIDs with dashes. 36 chars. | 53 std::vector<std::string> uuids; // 128bit UUIDs with dashes. 36 chars. |
56 }; | 54 }; |
57 | 55 |
58 } // namespace content | 56 } // namespace content |
59 | 57 |
60 #endif // CONTENT_COMMON_BLUETOOTH_BLUETOOTH_DEVICE_H_ | 58 #endif // CONTENT_COMMON_BLUETOOTH_BLUETOOTH_DEVICE_H_ |
OLD | NEW |