Skip to content

Commit

Permalink
bluetooth: macOS: Adding Mac suffix
Browse files Browse the repository at this point in the history
Adding Mac suffix to the following methods to keep consistency:
BluetoothLowEnergyDeviceMac::GetBluetoothRemoteGattService()
BluetoothLowEnergyDeviceMac::GetBluetoothRemoteGattDescriptor()

BUG=727020

Review-Url: https://codereview.chromium.org/2912603002
Cr-Commit-Position: refs/heads/master@{#475397}
  • Loading branch information
jlebel authored and Commit Bot committed May 30, 2017
1 parent a0ec2bf commit 78a4bf7
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions device/bluetooth/bluetooth_low_energy_device_mac.h
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,11 @@ class DEVICE_BLUETOOTH_EXPORT BluetoothLowEnergyDeviceMac
CBPeripheral* GetPeripheral();

// Returns BluetoothRemoteGattServiceMac based on the CBService.
BluetoothRemoteGattServiceMac* GetBluetoothRemoteGattService(
BluetoothRemoteGattServiceMac* GetBluetoothRemoteGattServiceMac(
CBService* service) const;

// Returns BluetoothRemoteGattDescriptorMac based on the CBDescriptor.
BluetoothRemoteGattDescriptorMac* GetBluetoothRemoteGattDescriptor(
BluetoothRemoteGattDescriptorMac* GetBluetoothRemoteGattDescriptorMac(
CBDescriptor* cb_descriptor) const;

// Callback used when the CoreBluetooth Peripheral is disconnected.
Expand Down
24 changes: 12 additions & 12 deletions device/bluetooth/bluetooth_low_energy_device_mac.mm
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@

for (CBService* cb_service in GetPeripheral().services) {
BluetoothRemoteGattServiceMac* gatt_service =
GetBluetoothRemoteGattService(cb_service);
GetBluetoothRemoteGattServiceMac(cb_service);
if (!gatt_service) {
gatt_service = new BluetoothRemoteGattServiceMac(this, cb_service,
true /* is_primary */);
Expand Down Expand Up @@ -279,7 +279,7 @@
}

BluetoothRemoteGattServiceMac* gatt_service =
GetBluetoothRemoteGattService(cb_service);
GetBluetoothRemoteGattServiceMac(cb_service);
DCHECK(gatt_service);
gatt_service->DidDiscoverCharacteristics();
SendNotificationIfDiscoveryComplete();
Expand All @@ -292,7 +292,7 @@
<< base::SysNSStringToUTF8([invalidatedServices description]);
for (CBService* cb_service in invalidatedServices) {
BluetoothRemoteGattServiceMac* gatt_service =
GetBluetoothRemoteGattService(cb_service);
GetBluetoothRemoteGattServiceMac(cb_service);
DCHECK(gatt_service);
VLOG(1) << gatt_service->GetUUID().canonical_value();
std::unique_ptr<BluetoothRemoteGattService> scoped_service =
Expand All @@ -310,7 +310,7 @@
CBCharacteristic* characteristic,
NSError* error) {
BluetoothRemoteGattServiceMac* gatt_service =
GetBluetoothRemoteGattService(characteristic.service);
GetBluetoothRemoteGattServiceMac(characteristic.service);
DCHECK(gatt_service);
gatt_service->DidUpdateValue(characteristic, error);
}
Expand All @@ -319,7 +319,7 @@
CBCharacteristic* characteristic,
NSError* error) {
BluetoothRemoteGattServiceMac* gatt_service =
GetBluetoothRemoteGattService(characteristic.service);
GetBluetoothRemoteGattServiceMac(characteristic.service);
DCHECK(gatt_service);
gatt_service->DidWriteValue(characteristic, error);
}
Expand All @@ -328,7 +328,7 @@
CBCharacteristic* characteristic,
NSError* error) {
BluetoothRemoteGattServiceMac* gatt_service =
GetBluetoothRemoteGattService(characteristic.service);
GetBluetoothRemoteGattServiceMac(characteristic.service);
DCHECK(gatt_service);
gatt_service->DidUpdateNotificationState(characteristic, error);
}
Expand Down Expand Up @@ -356,7 +356,7 @@
return;
}
BluetoothRemoteGattServiceMac* gatt_service =
GetBluetoothRemoteGattService(cb_characteristic.service);
GetBluetoothRemoteGattServiceMac(cb_characteristic.service);
DCHECK(gatt_service);
gatt_service->DidDiscoverDescriptors(cb_characteristic);
SendNotificationIfDiscoveryComplete();
Expand All @@ -366,7 +366,7 @@
CBDescriptor* cb_descriptor,
NSError* error) {
BluetoothRemoteGattDescriptorMac* gatt_descriptor =
GetBluetoothRemoteGattDescriptor(cb_descriptor);
GetBluetoothRemoteGattDescriptorMac(cb_descriptor);
DCHECK(gatt_descriptor);
gatt_descriptor->DidUpdateValueForDescriptor(error);
}
Expand All @@ -375,7 +375,7 @@
CBDescriptor* cb_descriptor,
NSError* error) {
BluetoothRemoteGattDescriptorMac* gatt_descriptor =
GetBluetoothRemoteGattDescriptor(cb_descriptor);
GetBluetoothRemoteGattDescriptorMac(cb_descriptor);
DCHECK(gatt_descriptor);
gatt_descriptor->DidWriteValueForDescriptor(error);
}
Expand Down Expand Up @@ -451,7 +451,7 @@
}

device::BluetoothRemoteGattServiceMac*
BluetoothLowEnergyDeviceMac::GetBluetoothRemoteGattService(
BluetoothLowEnergyDeviceMac::GetBluetoothRemoteGattServiceMac(
CBService* cb_service) const {
for (auto it = gatt_services_.begin(); it != gatt_services_.end(); ++it) {
device::BluetoothRemoteGattService* gatt_service = it->second.get();
Expand All @@ -464,11 +464,11 @@
}

device::BluetoothRemoteGattDescriptorMac*
BluetoothLowEnergyDeviceMac::GetBluetoothRemoteGattDescriptor(
BluetoothLowEnergyDeviceMac::GetBluetoothRemoteGattDescriptorMac(
CBDescriptor* cb_descriptor) const {
CBCharacteristic* cb_characteristic = cb_descriptor.characteristic;
device::BluetoothRemoteGattServiceMac* gatt_service =
GetBluetoothRemoteGattService(cb_characteristic.service);
GetBluetoothRemoteGattServiceMac(cb_characteristic.service);
DCHECK(gatt_service);
device::BluetoothRemoteGattCharacteristicMac* gatt_characteristic =
gatt_service->GetBluetoothRemoteGattCharacteristicMac(cb_characteristic);
Expand Down

0 comments on commit 78a4bf7

Please sign in to comment.