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 21 matching lines...) Expand all Loading... |
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) { | 38 void DidWriteValue(CBCharacteristic* characteristic, NSError* error) { |
39 device_mac_->DidWriteValue(characteristic, error); | 39 device_mac_->DidWriteValue(characteristic, error); |
40 } | 40 } |
41 | 41 |
| 42 void DidUpdateNotificationState(CBCharacteristic* characteristic, |
| 43 NSError* error) { |
| 44 device_mac_->DidUpdateNotificationState(characteristic, error); |
| 45 } |
| 46 |
42 CBPeripheral* GetPeripheral() { return device_mac_->GetPeripheral(); } | 47 CBPeripheral* GetPeripheral() { return device_mac_->GetPeripheral(); } |
43 | 48 |
44 private: | 49 private: |
45 BluetoothLowEnergyDeviceMac* device_mac_; | 50 BluetoothLowEnergyDeviceMac* device_mac_; |
46 }; | 51 }; |
47 | 52 |
48 } // namespace device | 53 } // namespace device |
49 | 54 |
50 @implementation BluetoothLowEnergyPeripheralDelegate | 55 @implementation BluetoothLowEnergyPeripheralDelegate |
51 | 56 |
(...skipping 30 matching lines...) Expand all Loading... |
82 didUpdateValueForCharacteristic:(CBCharacteristic*)characteristic | 87 didUpdateValueForCharacteristic:(CBCharacteristic*)characteristic |
83 error:(NSError*)error { | 88 error:(NSError*)error { |
84 bridge_->DidUpdateValue(characteristic, error); | 89 bridge_->DidUpdateValue(characteristic, error); |
85 } | 90 } |
86 | 91 |
87 - (void)peripheral:(CBPeripheral*)peripheral | 92 - (void)peripheral:(CBPeripheral*)peripheral |
88 didWriteValueForCharacteristic:(nonnull CBCharacteristic*)characteristic | 93 didWriteValueForCharacteristic:(nonnull CBCharacteristic*)characteristic |
89 error:(nullable NSError*)error { | 94 error:(nullable NSError*)error { |
90 bridge_->DidWriteValue(characteristic, error); | 95 bridge_->DidWriteValue(characteristic, error); |
91 } | 96 } |
| 97 |
| 98 - (void)peripheral:(CBPeripheral*)peripheral |
| 99 didUpdateNotificationStateForCharacteristic: |
| 100 (nonnull CBCharacteristic*)characteristic |
| 101 error:(nullable NSError*)error { |
| 102 bridge_->DidUpdateNotificationState(characteristic, error); |
| 103 } |
92 @end | 104 @end |
OLD | NEW |