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..536d8d7f8fd53b12ada50fe93138979f57918bfb 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,28 @@ bool BluetoothDeviceMac::ExpectingConfirmation() const { |
return false; |
} |
+void BluetoothDeviceMac::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) |
+ connection_info.rssi = kUnknownPower; |
+ |
+ connection_info.transmit_power = |
+ GetHostTransmitPower(kReadCurrentTransmitPowerLevel); |
+ connection_info.max_transmit_power = |
+ GetHostTransmitPower(kReadMaximumTransmitPowerLevel); |
+ |
+ callback.Run(connection_info); |
+} |
+ |
void BluetoothDeviceMac::Connect( |
PairingDelegate* pairing_delegate, |
const base::Closure& callback, |
@@ -223,12 +221,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]; |
} |