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

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

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: Fix extensions tests 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 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 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 138
139 bool BluetoothLowEnergyDeviceMac::IsConnecting() const { 139 bool BluetoothLowEnergyDeviceMac::IsConnecting() const {
140 return ([peripheral_ state] == CBPeripheralStateConnecting); 140 return ([peripheral_ state] == CBPeripheralStateConnecting);
141 } 141 }
142 142
143 BluetoothDevice::UUIDList BluetoothLowEnergyDeviceMac::GetUUIDs() const { 143 BluetoothDevice::UUIDList BluetoothLowEnergyDeviceMac::GetUUIDs() const {
144 return BluetoothDevice::UUIDList(advertised_uuids_.begin(), 144 return BluetoothDevice::UUIDList(advertised_uuids_.begin(),
145 advertised_uuids_.end()); 145 advertised_uuids_.end());
146 } 146 }
147 147
148 int16_t BluetoothLowEnergyDeviceMac::GetInquiryRSSI() const { 148 base::Optional<int8_t> BluetoothLowEnergyDeviceMac::GetInquiryRSSI() const {
149 return kUnknownPower; 149 return base::Optional<int8_t>();
150 } 150 }
151 151
152 int16_t BluetoothLowEnergyDeviceMac::GetInquiryTxPower() const { 152 base::Optional<int8_t> BluetoothLowEnergyDeviceMac::GetInquiryTxPower() const {
153 NOTIMPLEMENTED(); 153 NOTIMPLEMENTED();
154 return kUnknownPower; 154 return base::Optional<int8_t>();
155 } 155 }
156 156
157 bool BluetoothLowEnergyDeviceMac::ExpectingPinCode() const { 157 bool BluetoothLowEnergyDeviceMac::ExpectingPinCode() const {
158 return false; 158 return false;
159 } 159 }
160 160
161 bool BluetoothLowEnergyDeviceMac::ExpectingPasskey() const { 161 bool BluetoothLowEnergyDeviceMac::ExpectingPasskey() const {
162 return false; 162 return false;
163 } 163 }
164 164
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 271
272 void BluetoothLowEnergyDeviceMac::DidDisconnectPeripheral( 272 void BluetoothLowEnergyDeviceMac::DidDisconnectPeripheral(
273 BluetoothDevice::ConnectErrorCode error_code) { 273 BluetoothDevice::ConnectErrorCode error_code) {
274 if (create_gatt_connection_error_callbacks_.empty()) { 274 if (create_gatt_connection_error_callbacks_.empty()) {
275 // TODO(http://crbug.com/585897): Need to pass the error. 275 // TODO(http://crbug.com/585897): Need to pass the error.
276 DidDisconnectGatt(); 276 DidDisconnectGatt();
277 } else { 277 } else {
278 DidFailToConnectGatt(error_code); 278 DidFailToConnectGatt(error_code);
279 } 279 }
280 } 280 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698