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

Side by Side Diff: device/bluetooth/bluetooth_low_energy_device_mac.h

Issue 2071323002: bluetooth: mac: Initial BluetoothRemoteGattCharacteristicMac implementation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Skip reconnect-during-disconnected-event test Created 4 years, 6 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_low_energy_device_mac.mm » ('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 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 #ifndef DEVICE_BLUETOOTH_BLUETOOTH_LOW_ENERGY_DEVICE_MAC_H_ 5 #ifndef DEVICE_BLUETOOTH_BLUETOOTH_LOW_ENERGY_DEVICE_MAC_H_
6 #define DEVICE_BLUETOOTH_BLUETOOTH_LOW_ENERGY_DEVICE_MAC_H_ 6 #define DEVICE_BLUETOOTH_BLUETOOTH_LOW_ENERGY_DEVICE_MAC_H_
7 7
8 #if defined(OS_IOS) 8 #if defined(OS_IOS)
9 #import <CoreBluetooth/CoreBluetooth.h> 9 #import <CoreBluetooth/CoreBluetooth.h>
10 #else // !defined(OS_IOS) 10 #else // !defined(OS_IOS)
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 88
89 protected: 89 protected:
90 // BluetoothDevice override. 90 // BluetoothDevice override.
91 std::string GetDeviceName() const override; 91 std::string GetDeviceName() const override;
92 void CreateGattConnectionImpl() override; 92 void CreateGattConnectionImpl() override;
93 void DisconnectGatt() override; 93 void DisconnectGatt() override;
94 94
95 // Methods used by BluetoothLowEnergyPeripheralBridge. 95 // Methods used by BluetoothLowEnergyPeripheralBridge.
96 void DidDiscoverPrimaryServices(NSError* error); 96 void DidDiscoverPrimaryServices(NSError* error);
97 void DidModifyServices(NSArray* invalidatedServices); 97 void DidModifyServices(NSArray* invalidatedServices);
98 void DidDiscoverCharacteristics(CBService* cb_service, NSError* error);
98 99
99 // Updates information about the device. 100 // Updates information about the device.
100 virtual void Update(NSDictionary* advertisement_data, int rssi); 101 virtual void Update(NSDictionary* advertisement_data, int rssi);
101 102
102 static std::string GetPeripheralIdentifier(CBPeripheral* peripheral); 103 static std::string GetPeripheralIdentifier(CBPeripheral* peripheral);
103 104
104 // Hashes and truncates the peripheral identifier to deterministically 105 // Hashes and truncates the peripheral identifier to deterministically
105 // construct an address. The use of fake addresses is a temporary fix before 106 // construct an address. The use of fake addresses is a temporary fix before
106 // we switch to using bluetooth identifiers throughout Chrome. 107 // we switch to using bluetooth identifiers throughout Chrome.
107 // http://crbug.com/507824 108 // http://crbug.com/507824
108 static std::string GetPeripheralHashAddress(CBPeripheral* peripheral); 109 static std::string GetPeripheralHashAddress(CBPeripheral* peripheral);
109 110
110 private: 111 private:
111 friend class BluetoothAdapterMac; 112 friend class BluetoothAdapterMac;
112 friend class BluetoothAdapterMacTest; 113 friend class BluetoothAdapterMacTest;
113 friend class BluetoothLowEnergyPeripheralBridge; 114 friend class BluetoothLowEnergyPeripheralBridge;
115 friend class BluetoothRemoteGattServiceMac;
114 friend class BluetoothTestMac; 116 friend class BluetoothTestMac;
115 117
116 // Returns the Bluetooth adapter. 118 // Returns the Bluetooth adapter.
117 BluetoothAdapterMac* GetMacAdapter(); 119 BluetoothAdapterMac* GetMacAdapter();
118 120
119 // Returns the CoreBluetooth Peripheral. 121 // Returns the CoreBluetooth Peripheral.
120 CBPeripheral* GetPeripheral(); 122 CBPeripheral* GetPeripheral();
121 123
122 // Returns BluetoothRemoteGattServiceMac based on the CBService. 124 // Returns BluetoothRemoteGattServiceMac based on the CBService.
123 BluetoothRemoteGattServiceMac* GetBluetoothRemoteGattService( 125 BluetoothRemoteGattServiceMac* GetBluetoothRemoteGattService(
(...skipping 27 matching lines...) Expand all
151 153
152 // The services (identified by UUIDs) that this device provides. 154 // The services (identified by UUIDs) that this device provides.
153 std::set<BluetoothUUID> advertised_uuids_; 155 std::set<BluetoothUUID> advertised_uuids_;
154 156
155 DISALLOW_COPY_AND_ASSIGN(BluetoothLowEnergyDeviceMac); 157 DISALLOW_COPY_AND_ASSIGN(BluetoothLowEnergyDeviceMac);
156 }; 158 };
157 159
158 } // namespace device 160 } // namespace device
159 161
160 #endif // DEVICE_BLUETOOTH_BLUETOOTH_LOW_ENERGY_DEVICE_MAC_H_ 162 #endif // DEVICE_BLUETOOTH_BLUETOOTH_LOW_ENERGY_DEVICE_MAC_H_
OLDNEW
« no previous file with comments | « device/bluetooth/bluetooth.gyp ('k') | device/bluetooth/bluetooth_low_energy_device_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698