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

Side by Side Diff: device/bluetooth/bluetooth_low_energy_device_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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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_device_mac.h" 5 #include "device/bluetooth/bluetooth_low_energy_device_mac.h"
6 6
7 #import <CoreFoundation/CoreFoundation.h> 7 #import <CoreFoundation/CoreFoundation.h>
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include "base/mac/mac_util.h" 10 #include "base/mac/mac_util.h"
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after
310 310
311 void BluetoothLowEnergyDeviceMac::DidUpdateValue( 311 void BluetoothLowEnergyDeviceMac::DidUpdateValue(
312 CBCharacteristic* characteristic, 312 CBCharacteristic* characteristic,
313 NSError* error) { 313 NSError* error) {
314 BluetoothRemoteGattServiceMac* gatt_service = 314 BluetoothRemoteGattServiceMac* gatt_service =
315 GetBluetoothRemoteGattService(characteristic.service); 315 GetBluetoothRemoteGattService(characteristic.service);
316 DCHECK(gatt_service); 316 DCHECK(gatt_service);
317 gatt_service->DidUpdateValue(characteristic, error); 317 gatt_service->DidUpdateValue(characteristic, error);
318 } 318 }
319 319
320 void BluetoothLowEnergyDeviceMac::DidWriteValue(
321 CBCharacteristic* characteristic,
322 NSError* error) {
323 BluetoothRemoteGattServiceMac* gatt_service =
324 GetBluetoothRemoteGattService(characteristic.service);
325 DCHECK(gatt_service);
326 gatt_service->DidWriteValue(characteristic, error);
327 }
328
320 // static 329 // static
321 std::string BluetoothLowEnergyDeviceMac::GetPeripheralIdentifier( 330 std::string BluetoothLowEnergyDeviceMac::GetPeripheralIdentifier(
322 CBPeripheral* peripheral) { 331 CBPeripheral* peripheral) {
323 DCHECK(BluetoothAdapterMac::IsLowEnergyAvailable()); 332 DCHECK(BluetoothAdapterMac::IsLowEnergyAvailable());
324 NSUUID* uuid = [peripheral identifier]; 333 NSUUID* uuid = [peripheral identifier];
325 NSString* uuidString = [uuid UUIDString]; 334 NSString* uuidString = [uuid UUIDString];
326 return base::SysNSStringToUTF8(uuidString); 335 return base::SysNSStringToUTF8(uuidString);
327 } 336 }
328 337
329 // static 338 // static
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
367 GattServiceMap gatt_services_swapped; 376 GattServiceMap gatt_services_swapped;
368 gatt_services_swapped.swap(gatt_services_); 377 gatt_services_swapped.swap(gatt_services_);
369 gatt_services_swapped.clear(); 378 gatt_services_swapped.clear();
370 if (create_gatt_connection_error_callbacks_.empty()) { 379 if (create_gatt_connection_error_callbacks_.empty()) {
371 // TODO(http://crbug.com/585897): Need to pass the error. 380 // TODO(http://crbug.com/585897): Need to pass the error.
372 DidDisconnectGatt(); 381 DidDisconnectGatt();
373 } else { 382 } else {
374 DidFailToConnectGatt(error_code); 383 DidFailToConnectGatt(error_code);
375 } 384 }
376 } 385 }
OLDNEW
« no previous file with comments | « device/bluetooth/bluetooth_low_energy_device_mac.h ('k') | device/bluetooth/bluetooth_low_energy_peripheral_delegate.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698