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

Side by Side Diff: device/bluetooth/bluetooth_low_energy_device_mac.mm

Issue 2228953003: bluetooth: Change GetInquiryTxPower and GetInquiryRSSI to return optional. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@my-origin
Patch Set: TIL value_or Created 4 years, 4 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 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 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 } 136 }
137 137
138 bool BluetoothLowEnergyDeviceMac::IsConnectable() const { 138 bool BluetoothLowEnergyDeviceMac::IsConnectable() const {
139 return connectable_; 139 return connectable_;
140 } 140 }
141 141
142 bool BluetoothLowEnergyDeviceMac::IsConnecting() const { 142 bool BluetoothLowEnergyDeviceMac::IsConnecting() const {
143 return ([peripheral_ state] == CBPeripheralStateConnecting); 143 return ([peripheral_ state] == CBPeripheralStateConnecting);
144 } 144 }
145 145
146 int16_t BluetoothLowEnergyDeviceMac::GetInquiryRSSI() const { 146 base::Optional<int8_t> BluetoothLowEnergyDeviceMac::GetInquiryRSSI() const {
147 return kUnknownPower; 147 NOTIMPLEMENTED();
148 return base::nullopt;
148 } 149 }
149 150
150 int16_t BluetoothLowEnergyDeviceMac::GetInquiryTxPower() const { 151 base::Optional<int8_t> BluetoothLowEnergyDeviceMac::GetInquiryTxPower() const {
151 NOTIMPLEMENTED(); 152 NOTIMPLEMENTED();
152 return kUnknownPower; 153 return base::nullopt;
153 } 154 }
154 155
155 bool BluetoothLowEnergyDeviceMac::ExpectingPinCode() const { 156 bool BluetoothLowEnergyDeviceMac::ExpectingPinCode() const {
156 return false; 157 return false;
157 } 158 }
158 159
159 bool BluetoothLowEnergyDeviceMac::ExpectingPasskey() const { 160 bool BluetoothLowEnergyDeviceMac::ExpectingPasskey() const {
160 return false; 161 return false;
161 } 162 }
162 163
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
398 GattServiceMap gatt_services_swapped; 399 GattServiceMap gatt_services_swapped;
399 gatt_services_swapped.swap(gatt_services_); 400 gatt_services_swapped.swap(gatt_services_);
400 gatt_services_swapped.clear(); 401 gatt_services_swapped.clear();
401 if (create_gatt_connection_error_callbacks_.empty()) { 402 if (create_gatt_connection_error_callbacks_.empty()) {
402 // TODO(http://crbug.com/585897): Need to pass the error. 403 // TODO(http://crbug.com/585897): Need to pass the error.
403 DidDisconnectGatt(); 404 DidDisconnectGatt();
404 } else { 405 } else {
405 DidFailToConnectGatt(error_code); 406 DidFailToConnectGatt(error_code);
406 } 407 }
407 } 408 }
OLDNEW
« no previous file with comments | « device/bluetooth/bluetooth_low_energy_device_mac.h ('k') | device/bluetooth/bluez/bluetooth_bluez_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698