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

Side by Side Diff: device/bluetooth/bluetooth_device.cc

Issue 1941923002: bluetooth: Return int8_t and use -128 for unknown tx power. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@my-origin
Patch Set: Fix extensions tests 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "device/bluetooth/bluetooth_device.h" 5 #include "device/bluetooth/bluetooth_device.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <string> 8 #include <string>
9 9
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 11 matching lines...) Expand all
22 22
23 BluetoothDevice::BluetoothDevice(BluetoothAdapter* adapter) 23 BluetoothDevice::BluetoothDevice(BluetoothAdapter* adapter)
24 : adapter_(adapter), 24 : adapter_(adapter),
25 gatt_services_discovery_complete_(false), 25 gatt_services_discovery_complete_(false),
26 services_data_(new base::DictionaryValue()) {} 26 services_data_(new base::DictionaryValue()) {}
27 27
28 BluetoothDevice::~BluetoothDevice() { 28 BluetoothDevice::~BluetoothDevice() {
29 DidDisconnectGatt(); 29 DidDisconnectGatt();
30 } 30 }
31 31
32 BluetoothDevice::ConnectionInfo::ConnectionInfo() 32 BluetoothDevice::ConnectionInfo::ConnectionInfo() {}
33 : rssi(kUnknownPower),
34 transmit_power(kUnknownPower),
35 max_transmit_power(kUnknownPower) {}
36 33
37 BluetoothDevice::ConnectionInfo::ConnectionInfo( 34 BluetoothDevice::ConnectionInfo::ConnectionInfo(
38 int rssi, int transmit_power, int max_transmit_power) 35 const base::Optional<int8_t>& rssi,
36 const base::Optional<int8_t>& transmit_power,
37 const base::Optional<int8_t>& max_transmit_power)
39 : rssi(rssi), 38 : rssi(rssi),
40 transmit_power(transmit_power), 39 transmit_power(transmit_power),
41 max_transmit_power(max_transmit_power) {} 40 max_transmit_power(max_transmit_power) {}
42 41
43 BluetoothDevice::ConnectionInfo::~ConnectionInfo() {} 42 BluetoothDevice::ConnectionInfo::~ConnectionInfo() {}
44 43
45 base::string16 BluetoothDevice::GetName() const { 44 base::string16 BluetoothDevice::GetName() const {
46 std::string name = GetDeviceName(); 45 std::string name = GetDeviceName();
47 if (!name.empty()) { 46 if (!name.empty()) {
48 return base::UTF8ToUTF16(name); 47 return base::UTF8ToUTF16(name);
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after
381 base::BinaryValue::CreateWithCopiedBuffer(buffer, size)); 380 base::BinaryValue::CreateWithCopiedBuffer(buffer, size));
382 } 381 }
383 382
384 void BluetoothDevice::Pair(PairingDelegate* pairing_delegate, 383 void BluetoothDevice::Pair(PairingDelegate* pairing_delegate,
385 const base::Closure& callback, 384 const base::Closure& callback,
386 const ConnectErrorCallback& error_callback) { 385 const ConnectErrorCallback& error_callback) {
387 NOTREACHED(); 386 NOTREACHED();
388 } 387 }
389 388
390 } // namespace device 389 } // namespace device
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698