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

Side by Side Diff: content/common/bluetooth/bluetooth_device.cc

Issue 1926623002: bluetooth: Remove the device info and device class fields from BluetoothDevice. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
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 #include "content/common/bluetooth/bluetooth_device.h" 5 #include "content/common/bluetooth/bluetooth_device.h"
6 6
7 #include "base/strings/string_util.h" 7 #include "base/strings/string_util.h"
8 8
9 namespace content { 9 namespace content {
10 10
11 BluetoothDevice::BluetoothDevice() 11 BluetoothDevice::BluetoothDevice()
12 : id(""), 12 : id(""),
13 name(base::string16()), 13 name(base::string16()),
14 tx_power(device::BluetoothDevice::kUnknownPower), 14 tx_power(device::BluetoothDevice::kUnknownPower),
15 rssi(device::BluetoothDevice::kUnknownPower), 15 rssi(device::BluetoothDevice::kUnknownPower),
16 device_class(0),
17 vendor_id_source(
18 device::BluetoothDevice::VendorIDSource::VENDOR_ID_UNKNOWN),
19 vendor_id(0),
20 product_id(0),
21 product_version(0),
22 uuids() {} 16 uuids() {}
23 17
24 BluetoothDevice::BluetoothDevice( 18 BluetoothDevice::BluetoothDevice(
25 const std::string& id, 19 const std::string& id,
26 const base::string16& name, 20 const base::string16& name,
27 int8_t tx_power, 21 int8_t tx_power,
28 int8_t rssi, 22 int8_t rssi,
29 uint32_t device_class,
30 device::BluetoothDevice::VendorIDSource vendor_id_source,
31 uint16_t vendor_id,
32 uint16_t product_id,
33 uint16_t product_version,
34 const std::vector<std::string>& uuids) 23 const std::vector<std::string>& uuids)
35 : id(id), 24 : id(id),
36 name(name), 25 name(name),
37 tx_power(tx_power), 26 tx_power(tx_power),
38 rssi(rssi), 27 rssi(rssi),
39 device_class(device_class),
40 vendor_id_source(vendor_id_source),
41 vendor_id(vendor_id),
42 product_id(product_id),
43 product_version(product_version),
44 uuids(uuids) {} 28 uuids(uuids) {}
45 29
46 BluetoothDevice::~BluetoothDevice() { 30 BluetoothDevice::~BluetoothDevice() {
47 } 31 }
48 32
49 // static 33 // static
50 std::vector<std::string> BluetoothDevice::UUIDsFromBluetoothUUIDs( 34 std::vector<std::string> BluetoothDevice::UUIDsFromBluetoothUUIDs(
51 const device::BluetoothDevice::UUIDList& uuid_list) { 35 const device::BluetoothDevice::UUIDList& uuid_list) {
52 std::vector<std::string> uuids; 36 std::vector<std::string> uuids;
53 uuids.reserve(uuid_list.size()); 37 uuids.reserve(uuid_list.size());
54 for (const auto& it : uuid_list) 38 for (const auto& it : uuid_list)
55 uuids.push_back(it.canonical_value()); 39 uuids.push_back(it.canonical_value());
56 return uuids; 40 return uuids;
57 } 41 }
58 42
59 // static 43 // static
60 int8_t BluetoothDevice::ValidatePower(int16_t power) { 44 int8_t BluetoothDevice::ValidatePower(int16_t power) {
61 return ((power < -127) || (power > 127)) ? BluetoothDevice::kUnknownPower 45 return ((power < -127) || (power > 127)) ? BluetoothDevice::kUnknownPower
62 : power; 46 : power;
63 } 47 }
64 48
65 } // namespace content 49 } // namespace content
OLDNEW
« no previous file with comments | « content/common/bluetooth/bluetooth_device.h ('k') | content/common/bluetooth/bluetooth_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698