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

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

Issue 2074563002: bluetooth: mac: write characteristic implementation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@read_characteristicscan_servicescan_cleanup
Patch Set: Merge from top of tree 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 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 121
122 void BluetoothRemoteGattServiceMac::DidUpdateValue( 122 void BluetoothRemoteGattServiceMac::DidUpdateValue(
123 CBCharacteristic* characteristic, 123 CBCharacteristic* characteristic,
124 NSError* error) { 124 NSError* error) {
125 BluetoothRemoteGattCharacteristicMac* gatt_characteristic = 125 BluetoothRemoteGattCharacteristicMac* gatt_characteristic =
126 GetBluetoothRemoteGattCharacteristicMac(characteristic); 126 GetBluetoothRemoteGattCharacteristicMac(characteristic);
127 DCHECK(gatt_characteristic); 127 DCHECK(gatt_characteristic);
128 gatt_characteristic->DidUpdateValue(error); 128 gatt_characteristic->DidUpdateValue(error);
129 } 129 }
130 130
131 void BluetoothRemoteGattServiceMac::DidWriteValue(
132 CBCharacteristic* characteristic,
133 NSError* error) {
134 BluetoothRemoteGattCharacteristicMac* gatt_characteristic =
135 GetBluetoothRemoteGattCharacteristicMac(characteristic);
136 DCHECK(gatt_characteristic);
137 gatt_characteristic->DidWriteValue(error);
138 }
139
131 bool BluetoothRemoteGattServiceMac::IsDiscoveryComplete() { 140 bool BluetoothRemoteGattServiceMac::IsDiscoveryComplete() {
132 return is_discovery_complete_; 141 return is_discovery_complete_;
133 } 142 }
134 143
135 BluetoothAdapterMac* BluetoothRemoteGattServiceMac::GetMacAdapter() const { 144 BluetoothAdapterMac* BluetoothRemoteGattServiceMac::GetMacAdapter() const {
136 return bluetooth_device_mac_->GetMacAdapter(); 145 return bluetooth_device_mac_->GetMacAdapter();
137 } 146 }
138 147
139 CBPeripheral* BluetoothRemoteGattServiceMac::GetCBPeripheral() const { 148 CBPeripheral* BluetoothRemoteGattServiceMac::GetCBPeripheral() const {
140 return bluetooth_device_mac_->GetPeripheral(); 149 return bluetooth_device_mac_->GetPeripheral();
(...skipping 15 matching lines...) Expand all
156 return pair.second->GetCBCharacteristic() == characteristic; 165 return pair.second->GetCBCharacteristic() == characteristic;
157 }); 166 });
158 if (found == gatt_characteristic_macs_.end()) { 167 if (found == gatt_characteristic_macs_.end()) {
159 return nullptr; 168 return nullptr;
160 } else { 169 } else {
161 return found->second.get(); 170 return found->second.get();
162 } 171 }
163 } 172 }
164 173
165 } // namespace device 174 } // 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