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

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

Issue 1948763003: Adding support for service scan on OS X (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@cleanup
Patch Set: Fixing comments Created 4 years, 7 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
« no previous file with comments | « device/bluetooth/bluetooth.gyp ('k') | device/bluetooth/bluetooth_device_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_adapter_mac.h" 5 #include "device/bluetooth/bluetooth_adapter_mac.h"
6 6
7 #import <IOBluetooth/objc/IOBluetoothDevice.h> 7 #import <IOBluetooth/objc/IOBluetoothDevice.h>
8 #import <IOBluetooth/objc/IOBluetoothHostController.h> 8 #import <IOBluetooth/objc/IOBluetoothHostController.h>
9 #include <stddef.h> 9 #include <stddef.h>
10 10
(...skipping 570 matching lines...) Expand 10 before | Expand all | Expand 10 after
581 } 581 }
582 582
583 void BluetoothAdapterMac::DidConnectPeripheral(CBPeripheral* peripheral) { 583 void BluetoothAdapterMac::DidConnectPeripheral(CBPeripheral* peripheral) {
584 BluetoothLowEnergyDeviceMac* device_mac = 584 BluetoothLowEnergyDeviceMac* device_mac =
585 GetBluetoothLowEnergyDeviceMac(peripheral); 585 GetBluetoothLowEnergyDeviceMac(peripheral);
586 if (!device_mac) { 586 if (!device_mac) {
587 [low_energy_central_manager_ cancelPeripheralConnection:peripheral]; 587 [low_energy_central_manager_ cancelPeripheralConnection:peripheral];
588 return; 588 return;
589 } 589 }
590 device_mac->DidConnectGatt(); 590 device_mac->DidConnectGatt();
591 [device_mac->GetPeripheral() discoverServices:nil];
591 } 592 }
592 593
593 void BluetoothAdapterMac::DidFailToConnectPeripheral(CBPeripheral* peripheral, 594 void BluetoothAdapterMac::DidFailToConnectPeripheral(CBPeripheral* peripheral,
594 NSError* error) { 595 NSError* error) {
595 BluetoothLowEnergyDeviceMac* device_mac = 596 BluetoothLowEnergyDeviceMac* device_mac =
596 GetBluetoothLowEnergyDeviceMac(peripheral); 597 GetBluetoothLowEnergyDeviceMac(peripheral);
597 if (!device_mac) { 598 if (!device_mac) {
598 [low_energy_central_manager_ cancelPeripheralConnection:peripheral]; 599 [low_energy_central_manager_ cancelPeripheralConnection:peripheral];
599 return; 600 return;
600 } 601 }
(...skipping 27 matching lines...) Expand all
628 std::string device_address = 629 std::string device_address =
629 BluetoothLowEnergyDeviceMac::GetPeripheralHashAddress(peripheral); 630 BluetoothLowEnergyDeviceMac::GetPeripheralHashAddress(peripheral);
630 DevicesMap::const_iterator iter = devices_.find(device_address); 631 DevicesMap::const_iterator iter = devices_.find(device_address);
631 if (iter == devices_.end()) { 632 if (iter == devices_.end()) {
632 return nil; 633 return nil;
633 } 634 }
634 return static_cast<BluetoothLowEnergyDeviceMac*>(iter->second); 635 return static_cast<BluetoothLowEnergyDeviceMac*>(iter->second);
635 } 636 }
636 637
637 } // namespace device 638 } // namespace device
OLDNEW
« no previous file with comments | « device/bluetooth/bluetooth.gyp ('k') | device/bluetooth/bluetooth_device_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698