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

Unified Diff: device/bluetooth/bluetooth_low_energy_device_mac.mm

Issue 2009753002: bluetooth: Make public BluetoothDevice::GetName method. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Merge TOT Created 4 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: device/bluetooth/bluetooth_low_energy_device_mac.mm
diff --git a/device/bluetooth/bluetooth_low_energy_device_mac.mm b/device/bluetooth/bluetooth_low_energy_device_mac.mm
index fb7a379316516ccca0178031bc969c295d79f12d..0894a19dbf01fd8bf6553389d4f29ab8c70f23b6 100644
--- a/device/bluetooth/bluetooth_low_energy_device_mac.mm
+++ b/device/bluetooth/bluetooth_low_energy_device_mac.mm
@@ -111,6 +111,13 @@ uint16_t BluetoothLowEnergyDeviceMac::GetAppearance() const {
return 0;
}
+base::Optional<std::string> BluetoothLowEnergyDeviceMac::GetName() const {
+ if ([peripheral_ name])
+ return base::Optional<std::string>(
+ base::SysNSStringToUTF8([peripheral_ name]));
+ return base::Optional<std::string>();
+}
+
int BluetoothLowEnergyDeviceMac::GetRSSI() const {
return rssi_;
}
@@ -218,10 +225,6 @@ void BluetoothLowEnergyDeviceMac::ConnectToServiceInsecurely(
NOTIMPLEMENTED();
}
-std::string BluetoothLowEnergyDeviceMac::GetDeviceName() const {
- return base::SysNSStringToUTF8([peripheral_ name]);
-}
-
void BluetoothLowEnergyDeviceMac::CreateGattConnectionImpl() {
if (!IsGattConnected()) {
GetMacAdapter()->CreateGattConnection(this);

Powered by Google App Engine
This is Rietveld 408576698