Chromium Code Reviews| Index: device/bluetooth/bluetooth_device_mac.mm |
| diff --git a/device/bluetooth/bluetooth_device_mac.mm b/device/bluetooth/bluetooth_device_mac.mm |
| index 4aad7cf8032c392e9a8c2870b4e885c1a17d7496..f2f6df4514003eefa2fd21b3890ca987f40b54db 100644 |
| --- a/device/bluetooth/bluetooth_device_mac.mm |
| +++ b/device/bluetooth/bluetooth_device_mac.mm |
| @@ -93,30 +93,6 @@ uint16 BluetoothDeviceMac::GetDeviceID() const { |
| return 0; |
| } |
| -int BluetoothDeviceMac::GetRSSI() const { |
| - if (![device_ isConnected]) { |
| - NOTIMPLEMENTED(); |
| - return kUnknownPower; |
| - } |
| - |
| - int rssi = [device_ rawRSSI]; |
| - |
| - // The API guarantees that +127 is returned in case the RSSI is not readable: |
| - // http://goo.gl/bpURYv |
| - if (rssi == 127) |
| - return kUnknownPower; |
| - |
| - return rssi; |
| -} |
| - |
| -int BluetoothDeviceMac::GetCurrentHostTransmitPower() const { |
| - return GetHostTransmitPower(kReadCurrentTransmitPowerLevel); |
| -} |
| - |
| -int BluetoothDeviceMac::GetMaximumHostTransmitPower() const { |
| - return GetHostTransmitPower(kReadMaximumTransmitPowerLevel); |
| -} |
| - |
| bool BluetoothDeviceMac::IsPaired() const { |
| return [device_ isPaired]; |
| } |
| @@ -164,6 +140,27 @@ bool BluetoothDeviceMac::ExpectingConfirmation() const { |
| return false; |
| } |
| +void GetConnectionInfo(const ConnectionInfoCallback& callback) { |
| + ConnectionInfo connection_info; |
| + if (![device_ isConnected]) { |
| + callback.Run(connection_info); |
| + return; |
| + } |
| + |
| + connection_info.rssi = [device_ rawRSSI]; |
| + // The API guarantees that +127 is returned in case the RSSI is not readable: |
| + // http://goo.gl/bpURYv |
| + if (connection_info.rssi == 127) |
| + rssi = kUnknownPower; |
|
Ilya Sherman
2014/11/19 22:18:07
nit: rssi -> connection_info.rssi
Tim Song
2014/12/06 00:51:37
Done.
|
| + |
| + connection_info.transmit_power = |
| + GetHostTransmitPower(kReadCurrentTransmitPowerLevel); |
| + connection.max_transmit_power = |
|
Ilya Sherman
2014/11/19 22:18:07
nit: connection -> connection_info
Tim Song
2014/12/06 00:51:37
Done.
|
| + GetHostTransmitPower(kReadMaximumTransmitPowerLevel); |
| + |
| + callback.Run(connection_info); |
| +} |
| + |
| void BluetoothDeviceMac::Connect( |
| PairingDelegate* pairing_delegate, |
| const base::Closure& callback, |
| @@ -223,12 +220,6 @@ void BluetoothDeviceMac::CreateGattConnection( |
| error_callback.Run(ERROR_UNSUPPORTED_DEVICE); |
| } |
| -void BluetoothDeviceMac::StartConnectionMonitor( |
| - const base::Closure& callback, |
| - const ErrorCallback& error_callback) { |
| - NOTIMPLEMENTED(); |
| -} |
| - |
| NSDate* BluetoothDeviceMac::GetLastInquiryUpdate() { |
| return [device_ getLastInquiryUpdate]; |
| } |