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 // Only available for Chrome OS. |
| 104 NOTIMPLEMENTED(); |
| 105 return false; |
104 } | 106 } |
105 | 107 |
106 bool BluetoothLowEnergyDeviceMac::IsConnecting() const { | 108 bool BluetoothLowEnergyDeviceMac::IsConnecting() const { |
107 return ([peripheral_ state] == CBPeripheralStateConnecting); | 109 return ([peripheral_ state] == CBPeripheralStateConnecting); |
108 } | 110 } |
109 | 111 |
110 bool BluetoothLowEnergyDeviceMac::ExpectingPinCode() const { | 112 bool BluetoothLowEnergyDeviceMac::ExpectingPinCode() const { |
111 return false; | 113 return false; |
112 } | 114 } |
113 | 115 |
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
466 std::ostream& operator<<(std::ostream& out, | 468 std::ostream& operator<<(std::ostream& out, |
467 const BluetoothLowEnergyDeviceMac& device) { | 469 const BluetoothLowEnergyDeviceMac& device) { |
468 // TODO(crbug.com/703878): Should use | 470 // TODO(crbug.com/703878): Should use |
469 // BluetoothLowEnergyDeviceMac::GetNameForDisplay() instead. | 471 // BluetoothLowEnergyDeviceMac::GetNameForDisplay() instead. |
470 base::Optional<std::string> name = device.GetName(); | 472 base::Optional<std::string> name = device.GetName(); |
471 const char* name_cstr = name ? name->c_str() : ""; | 473 const char* name_cstr = name ? name->c_str() : ""; |
472 return out << "<BluetoothLowEnergyDeviceMac " << device.GetAddress() << "/" | 474 return out << "<BluetoothLowEnergyDeviceMac " << device.GetAddress() << "/" |
473 << &device << ", \"" << name_cstr << "\">"; | 475 << &device << ", \"" << name_cstr << "\">"; |
474 } | 476 } |
475 } // namespace device | 477 } // namespace device |
OLD | NEW |