| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "device/bluetooth/bluetooth_low_energy_peripheral_delegate.h" | 5 #include "device/bluetooth/bluetooth_low_energy_peripheral_delegate.h" |
| 6 | 6 |
| 7 #include "device/bluetooth/bluetooth_adapter_mac.h" | 7 #include "device/bluetooth/bluetooth_adapter_mac.h" |
| 8 #include "device/bluetooth/bluetooth_low_energy_discovery_manager_mac.h" | 8 #include "device/bluetooth/bluetooth_low_energy_discovery_manager_mac.h" |
| 9 | 9 |
| 10 namespace device { | 10 namespace device { |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 }; | 28 }; |
| 29 | 29 |
| 30 void DidDiscoverCharacteristics(CBService* service, NSError* error) { | 30 void DidDiscoverCharacteristics(CBService* service, NSError* error) { |
| 31 device_mac_->DidDiscoverCharacteristics(service, error); | 31 device_mac_->DidDiscoverCharacteristics(service, error); |
| 32 }; | 32 }; |
| 33 | 33 |
| 34 void DidUpdateValue(CBCharacteristic* characteristic, NSError* error) { | 34 void DidUpdateValue(CBCharacteristic* characteristic, NSError* error) { |
| 35 device_mac_->DidUpdateValue(characteristic, error); | 35 device_mac_->DidUpdateValue(characteristic, error); |
| 36 } | 36 } |
| 37 | 37 |
| 38 void DidWriteValue(CBCharacteristic* characteristic, NSError* error) { |
| 39 device_mac_->DidWriteValue(characteristic, error); |
| 40 } |
| 41 |
| 38 CBPeripheral* GetPeripheral() { return device_mac_->GetPeripheral(); } | 42 CBPeripheral* GetPeripheral() { return device_mac_->GetPeripheral(); } |
| 39 | 43 |
| 40 private: | 44 private: |
| 41 BluetoothLowEnergyDeviceMac* device_mac_; | 45 BluetoothLowEnergyDeviceMac* device_mac_; |
| 42 }; | 46 }; |
| 43 | 47 |
| 44 } // namespace device | 48 } // namespace device |
| 45 | 49 |
| 46 @implementation BluetoothLowEnergyPeripheralDelegate | 50 @implementation BluetoothLowEnergyPeripheralDelegate |
| 47 | 51 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 73 error:(NSError*)error { | 77 error:(NSError*)error { |
| 74 bridge_->DidDiscoverCharacteristics(service, error); | 78 bridge_->DidDiscoverCharacteristics(service, error); |
| 75 } | 79 } |
| 76 | 80 |
| 77 - (void)peripheral:(CBPeripheral*)peripheral | 81 - (void)peripheral:(CBPeripheral*)peripheral |
| 78 didUpdateValueForCharacteristic:(CBCharacteristic*)characteristic | 82 didUpdateValueForCharacteristic:(CBCharacteristic*)characteristic |
| 79 error:(NSError*)error { | 83 error:(NSError*)error { |
| 80 bridge_->DidUpdateValue(characteristic, error); | 84 bridge_->DidUpdateValue(characteristic, error); |
| 81 } | 85 } |
| 82 | 86 |
| 87 - (void)peripheral:(CBPeripheral*)peripheral |
| 88 didWriteValueForCharacteristic:(nonnull CBCharacteristic*)characteristic |
| 89 error:(nullable NSError*)error { |
| 90 bridge_->DidWriteValue(characteristic, error); |
| 91 } |
| 83 @end | 92 @end |
| OLD | NEW |