| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_adapter_mac.h" | 5 #include "device/bluetooth/bluetooth_adapter_mac.h" |
| 6 | 6 |
| 7 #import <IOBluetooth/objc/IOBluetoothDevice.h> | 7 #import <IOBluetooth/objc/IOBluetoothDevice.h> |
| 8 #import <IOBluetooth/objc/IOBluetoothHostController.h> | 8 #import <IOBluetooth/objc/IOBluetoothHostController.h> |
| 9 #include <stddef.h> | 9 #include <stddef.h> |
| 10 | 10 |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 NOTIMPLEMENTED(); | 121 NOTIMPLEMENTED(); |
| 122 } | 122 } |
| 123 | 123 |
| 124 bool BluetoothAdapterMac::IsInitialized() const { | 124 bool BluetoothAdapterMac::IsInitialized() const { |
| 125 return true; | 125 return true; |
| 126 } | 126 } |
| 127 | 127 |
| 128 bool BluetoothAdapterMac::IsPresent() const { | 128 bool BluetoothAdapterMac::IsPresent() const { |
| 129 bool is_present = !address_.empty(); | 129 bool is_present = !address_.empty(); |
| 130 if (IsLowEnergyAvailable()) { | 130 if (IsLowEnergyAvailable()) { |
| 131 is_present = is_present || ([low_energy_central_manager_ state] == | 131 is_present = is_present || ([low_energy_central_manager_ state] != |
| 132 CBCentralManagerStatePoweredOn); | 132 CBCentralManagerStateUnsupported); |
| 133 } | 133 } |
| 134 return is_present; | 134 return is_present; |
| 135 } | 135 } |
| 136 | 136 |
| 137 bool BluetoothAdapterMac::IsPowered() const { | 137 bool BluetoothAdapterMac::IsPowered() const { |
| 138 bool is_powered = classic_powered_; | 138 bool is_powered = classic_powered_; |
| 139 if (IsLowEnergyAvailable()) { | 139 if (IsLowEnergyAvailable()) { |
| 140 is_powered = is_powered || ([low_energy_central_manager_ state] == | 140 is_powered = is_powered || ([low_energy_central_manager_ state] == |
| 141 CBCentralManagerStatePoweredOn); | 141 CBCentralManagerStatePoweredOn); |
| 142 } | 142 } |
| (...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 591 std::string device_address = | 591 std::string device_address = |
| 592 BluetoothLowEnergyDeviceMac::GetPeripheralHashAddress(peripheral); | 592 BluetoothLowEnergyDeviceMac::GetPeripheralHashAddress(peripheral); |
| 593 DevicesMap::const_iterator iter = devices_.find(device_address); | 593 DevicesMap::const_iterator iter = devices_.find(device_address); |
| 594 if (iter == devices_.end()) { | 594 if (iter == devices_.end()) { |
| 595 return nil; | 595 return nil; |
| 596 } | 596 } |
| 597 return static_cast<BluetoothLowEnergyDeviceMac*>(iter->second); | 597 return static_cast<BluetoothLowEnergyDeviceMac*>(iter->second); |
| 598 } | 598 } |
| 599 | 599 |
| 600 } // namespace device | 600 } // namespace device |
| OLD | NEW |