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

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: Moar fixes 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 12 matching lines...) Expand all
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), 33 : rssi(kUnknownRSSI),
34 transmit_power(kUnknownPower), 34 transmit_power(kUnknownTxPower),
35 max_transmit_power(kUnknownPower) {} 35 max_transmit_power(kUnknownTxPower) {}
36 36
37 BluetoothDevice::ConnectionInfo::ConnectionInfo( 37 BluetoothDevice::ConnectionInfo::ConnectionInfo(int8_t rssi,
38 int rssi, int transmit_power, int max_transmit_power) 38 int8_t transmit_power,
39 int8_t max_transmit_power)
39 : rssi(rssi), 40 : rssi(rssi),
40 transmit_power(transmit_power), 41 transmit_power(transmit_power),
41 max_transmit_power(max_transmit_power) {} 42 max_transmit_power(max_transmit_power) {}
42 43
43 BluetoothDevice::ConnectionInfo::~ConnectionInfo() {} 44 BluetoothDevice::ConnectionInfo::~ConnectionInfo() {}
44 45
45 base::string16 BluetoothDevice::GetName() const { 46 base::string16 BluetoothDevice::GetName() const {
46 std::string name = GetDeviceName(); 47 std::string name = GetDeviceName();
47 if (!name.empty()) { 48 if (!name.empty()) {
48 return base::UTF8ToUTF16(name); 49 return base::UTF8ToUTF16(name);
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after
381 base::BinaryValue::CreateWithCopiedBuffer(buffer, size)); 382 base::BinaryValue::CreateWithCopiedBuffer(buffer, size));
382 } 383 }
383 384
384 void BluetoothDevice::Pair(PairingDelegate* pairing_delegate, 385 void BluetoothDevice::Pair(PairingDelegate* pairing_delegate,
385 const base::Closure& callback, 386 const base::Closure& callback,
386 const ConnectErrorCallback& error_callback) { 387 const ConnectErrorCallback& error_callback) {
387 NOTREACHED(); 388 NOTREACHED();
388 } 389 }
389 390
390 } // namespace device 391 } // namespace device
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698