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 #include "device/bluetooth/bluetooth_low_energy_device_mac.h" | 5 #include "device/bluetooth/bluetooth_low_energy_device_mac.h" |
6 | 6 |
7 #import <CoreFoundation/CoreFoundation.h> | 7 #import <CoreFoundation/CoreFoundation.h> |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include "base/mac/mac_util.h" | 10 #include "base/mac/mac_util.h" |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
93 | 93 |
94 bool BluetoothLowEnergyDeviceMac::IsConnected() const { | 94 bool BluetoothLowEnergyDeviceMac::IsConnected() const { |
95 return IsGattConnected(); | 95 return IsGattConnected(); |
96 } | 96 } |
97 | 97 |
98 bool BluetoothLowEnergyDeviceMac::IsGattConnected() const { | 98 bool BluetoothLowEnergyDeviceMac::IsGattConnected() const { |
99 return ([peripheral_ state] == CBPeripheralStateConnected); | 99 return ([peripheral_ state] == CBPeripheralStateConnected); |
100 } | 100 } |
101 | 101 |
102 bool BluetoothLowEnergyDeviceMac::IsConnectable() const { | 102 bool BluetoothLowEnergyDeviceMac::IsConnectable() const { |
103 return connectable_; | 103 return true; |
ortuno
2017/05/02 01:32:16
Do we need this to return true? Otherwise just add
jlebel
2017/05/03 22:44:18
Done.
| |
104 } | 104 } |
105 | 105 |
106 bool BluetoothLowEnergyDeviceMac::IsConnecting() const { | 106 bool BluetoothLowEnergyDeviceMac::IsConnecting() const { |
107 return ([peripheral_ state] == CBPeripheralStateConnecting); | 107 return ([peripheral_ state] == CBPeripheralStateConnecting); |
108 } | 108 } |
109 | 109 |
110 bool BluetoothLowEnergyDeviceMac::ExpectingPinCode() const { | 110 bool BluetoothLowEnergyDeviceMac::ExpectingPinCode() const { |
111 return false; | 111 return false; |
112 } | 112 } |
113 | 113 |
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
466 std::ostream& operator<<(std::ostream& out, | 466 std::ostream& operator<<(std::ostream& out, |
467 const BluetoothLowEnergyDeviceMac& device) { | 467 const BluetoothLowEnergyDeviceMac& device) { |
468 // TODO(crbug.com/703878): Should use | 468 // TODO(crbug.com/703878): Should use |
469 // BluetoothLowEnergyDeviceMac::GetNameForDisplay() instead. | 469 // BluetoothLowEnergyDeviceMac::GetNameForDisplay() instead. |
470 base::Optional<std::string> name = device.GetName(); | 470 base::Optional<std::string> name = device.GetName(); |
471 const char* name_cstr = name ? name->c_str() : ""; | 471 const char* name_cstr = name ? name->c_str() : ""; |
472 return out << "<BluetoothLowEnergyDeviceMac " << device.GetAddress() << "/" | 472 return out << "<BluetoothLowEnergyDeviceMac " << device.GetAddress() << "/" |
473 << &device << ", \"" << name_cstr << "\">"; | 473 << &device << ", \"" << name_cstr << "\">"; |
474 } | 474 } |
475 } // namespace device | 475 } // namespace device |
OLD | NEW |