Chromium Code Reviews| 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 b5777bed5d8de949320ac3022b50065c2ec2c682..20694e4953b97d7ca5d4edc882a0a4b0aab06864 100644 |
| --- a/device/bluetooth/bluetooth_low_energy_device_mac.mm |
| +++ b/device/bluetooth/bluetooth_low_energy_device_mac.mm |
| @@ -16,6 +16,8 @@ |
| #include "device/bluetooth/bluetooth_adapter_mac.h" |
| #include "device/bluetooth/bluetooth_device.h" |
| #include "device/bluetooth/bluetooth_low_energy_peripheral_delegate.h" |
| +#include "device/bluetooth/bluetooth_remote_gatt_characteristic_mac.h" |
| +#include "device/bluetooth/bluetooth_remote_gatt_descriptor_mac.h" |
| #include "device/bluetooth/bluetooth_remote_gatt_service_mac.h" |
| using device::BluetoothDevice; |
| @@ -332,6 +334,24 @@ void BluetoothLowEnergyDeviceMac::DidDiscoverDescriptors( |
| SendNotificationIfDiscoveryComplete(); |
| } |
| +void BluetoothLowEnergyDeviceMac::DidUpdateValueForDescriptor( |
| + CBDescriptor* cb_descriptor, |
| + NSError* error) { |
| + BluetoothRemoteGattDescriptorMac* gatt_descriptor = |
| + GetBluetoothRemoteGattDescriptor(cb_descriptor); |
| + DCHECK(gatt_descriptor); |
| + gatt_descriptor->DidUpdateValueForDescriptor(error); |
| +} |
| + |
| +void BluetoothLowEnergyDeviceMac::DidWriteValueForDescriptor( |
| + CBDescriptor* cb_descriptor, |
| + NSError* error) { |
| + BluetoothRemoteGattDescriptorMac* gatt_descriptor = |
| + GetBluetoothRemoteGattDescriptor(cb_descriptor); |
| + DCHECK(gatt_descriptor); |
| + gatt_descriptor->DidWriteValueForDescriptor(error); |
| +} |
| + |
| // static |
| std::string BluetoothLowEnergyDeviceMac::GetPeripheralIdentifier( |
| CBPeripheral* peripheral) { |
| @@ -400,6 +420,20 @@ BluetoothLowEnergyDeviceMac::GetBluetoothRemoteGattService( |
| return nullptr; |
| } |
| +device::BluetoothRemoteGattDescriptorMac* |
| +BluetoothLowEnergyDeviceMac::GetBluetoothRemoteGattDescriptor( |
| + CBDescriptor* cb_descriptor) const { |
| + CBCharacteristic* cb_characteristic = cb_descriptor.characteristic; |
| + device::BluetoothRemoteGattServiceMac* gatt_service = |
| + GetBluetoothRemoteGattService(cb_characteristic.service); |
| + DCHECK(gatt_service); |
| + device::BluetoothRemoteGattCharacteristicMac* gatt_characteristic = |
| + gatt_service->GetBluetoothRemoteGattCharacteristicMac(cb_characteristic); |
| + DCHECK(gatt_characteristic); |
| + return gatt_characteristic->GetBluetoothRemoteGattDescriptorMac( |
|
ortuno
2017/04/04 23:39:43
optional: Is GetBluetoothRemoteGattDescriptorMac a
jlebel
2017/04/06 17:48:49
crbug.com/709100
|
| + cb_descriptor); |
| +} |
| + |
| void BluetoothLowEnergyDeviceMac::DidDisconnectPeripheral(NSError* error) { |
| VLOG(1) << *this << ": Disconnected from peripheral."; |
| if (error) { |