Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(113)

Side by Side Diff: device/bluetooth/bluetooth_remote_gatt_service_mac.mm

Issue 2094633003: Bluetooth: Mac: implementation for start notification (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@write_read_characteristicscan_servicescan_cleanup
Patch Set: Addressing msarda's comments Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « device/bluetooth/bluetooth_remote_gatt_service_mac.h ('k') | device/bluetooth/test/bluetooth_test_mac.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698