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

Unified Diff: device/bluetooth/bluetooth_low_energy_device_mac.mm

Issue 1220713006: Renaming BluetoothDeviceMac as BluetoothClassicDeviceMac (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@dm
Patch Set: Created 5 years, 6 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 0357ad95276aca951b3d3a10d7032ff4c230c32f..c96f644ed01bf60e7cd9ce375e370d87c2d0c1d0 100644
--- a/device/bluetooth/bluetooth_low_energy_device_mac.mm
+++ b/device/bluetooth/bluetooth_low_energy_device_mac.mm
@@ -66,6 +66,8 @@ BluetoothLowEnergyDeviceMac::BluetoothLowEnergyDeviceMac(
CBPeripheral* peripheral,
NSDictionary* advertisementData,
int rssi) {
+ supports_low_energy_ = true;
+ supports_classic_ = false;
Update(peripheral, advertisementData, rssi);
}
@@ -75,6 +77,7 @@ BluetoothLowEnergyDeviceMac::~BluetoothLowEnergyDeviceMac() {
void BluetoothLowEnergyDeviceMac::Update(CBPeripheral* peripheral,
NSDictionary* advertisementData,
int rssi) {
+ last_call_to_update_ = [NSDate date];
peripheral_.reset([peripheral retain]);
rssi_ = rssi;
ClearServiceData();
@@ -128,6 +131,10 @@ bool BluetoothLowEnergyDeviceMac::IsPaired() const {
}
bool BluetoothLowEnergyDeviceMac::IsConnected() const {
+ // TODO(krstnmnlsn): Remove check once we move to OSX SDK >= 10.9.
scheib 2015/06/29 20:44:24 This block seems out of place for this patch. Is i
krstnmnlsn 2015/06/30 00:50:35 Oh alright..
+ if ([peripheral_ respondsToSelector:@selector(state)]) {
+ return ([peripheral_ state] == CBPeripheralStateConnected);
+ }
return [peripheral_ isConnected];
}
@@ -226,6 +233,10 @@ void BluetoothLowEnergyDeviceMac::CreateGattConnection(
NOTIMPLEMENTED();
}
+NSDate* BluetoothLowEnergyDeviceMac::GetLastCallToUpdate() {
+ return last_call_to_update_;
+}
+
std::string BluetoothLowEnergyDeviceMac::GetDeviceName() const {
return base::SysNSStringToUTF8([peripheral_ name]);
}

Powered by Google App Engine
This is Rietveld 408576698