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_remote_gatt_service_mac.h" | 5 #include "device/bluetooth/bluetooth_remote_gatt_service_mac.h" |
6 | 6 |
7 #import <CoreBluetooth/CoreBluetooth.h> | 7 #import <CoreBluetooth/CoreBluetooth.h> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 | 130 |
131 void BluetoothRemoteGattServiceMac::DidWriteValue( | 131 void BluetoothRemoteGattServiceMac::DidWriteValue( |
132 CBCharacteristic* characteristic, | 132 CBCharacteristic* characteristic, |
133 NSError* error) { | 133 NSError* error) { |
134 BluetoothRemoteGattCharacteristicMac* gatt_characteristic = | 134 BluetoothRemoteGattCharacteristicMac* gatt_characteristic = |
135 GetBluetoothRemoteGattCharacteristicMac(characteristic); | 135 GetBluetoothRemoteGattCharacteristicMac(characteristic); |
136 DCHECK(gatt_characteristic); | 136 DCHECK(gatt_characteristic); |
137 gatt_characteristic->DidWriteValue(error); | 137 gatt_characteristic->DidWriteValue(error); |
138 } | 138 } |
139 | 139 |
| 140 void BluetoothRemoteGattServiceMac::DidUpdateNotificationState( |
| 141 CBCharacteristic* characteristic, |
| 142 NSError* error) { |
| 143 BluetoothRemoteGattCharacteristicMac* gatt_characteristic = |
| 144 GetBluetoothRemoteGattCharacteristicMac(characteristic); |
| 145 DCHECK(gatt_characteristic); |
| 146 gatt_characteristic->DidUpdateNotificationState(error); |
| 147 } |
| 148 |
140 bool BluetoothRemoteGattServiceMac::IsDiscoveryComplete() { | 149 bool BluetoothRemoteGattServiceMac::IsDiscoveryComplete() { |
141 return is_discovery_complete_; | 150 return is_discovery_complete_; |
142 } | 151 } |
143 | 152 |
144 BluetoothAdapterMac* BluetoothRemoteGattServiceMac::GetMacAdapter() const { | 153 BluetoothAdapterMac* BluetoothRemoteGattServiceMac::GetMacAdapter() const { |
145 return bluetooth_device_mac_->GetMacAdapter(); | 154 return bluetooth_device_mac_->GetMacAdapter(); |
146 } | 155 } |
147 | 156 |
148 CBPeripheral* BluetoothRemoteGattServiceMac::GetCBPeripheral() const { | 157 CBPeripheral* BluetoothRemoteGattServiceMac::GetCBPeripheral() const { |
149 return bluetooth_device_mac_->GetPeripheral(); | 158 return bluetooth_device_mac_->GetPeripheral(); |
(...skipping 15 matching lines...) Expand all Loading... |
165 return pair.second->GetCBCharacteristic() == characteristic; | 174 return pair.second->GetCBCharacteristic() == characteristic; |
166 }); | 175 }); |
167 if (found == gatt_characteristic_macs_.end()) { | 176 if (found == gatt_characteristic_macs_.end()) { |
168 return nullptr; | 177 return nullptr; |
169 } else { | 178 } else { |
170 return found->second.get(); | 179 return found->second.get(); |
171 } | 180 } |
172 } | 181 } |
173 | 182 |
174 } // namespace device | 183 } // namespace device |
OLD | NEW |