| OLD | NEW |
| 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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 // BluetoothDevice override. | 87 // BluetoothDevice override. |
| 88 std::string GetDeviceName() const override; | 88 std::string GetDeviceName() const override; |
| 89 void CreateGattConnectionImpl() override; | 89 void CreateGattConnectionImpl() override; |
| 90 void DisconnectGatt() override; | 90 void DisconnectGatt() override; |
| 91 | 91 |
| 92 // Methods used by BluetoothLowEnergyPeripheralBridge. | 92 // Methods used by BluetoothLowEnergyPeripheralBridge. |
| 93 void DidDiscoverPrimaryServices(NSError* error); | 93 void DidDiscoverPrimaryServices(NSError* error); |
| 94 void DidModifyServices(NSArray* invalidatedServices); | 94 void DidModifyServices(NSArray* invalidatedServices); |
| 95 void DidDiscoverCharacteristics(CBService* cb_service, NSError* error); | 95 void DidDiscoverCharacteristics(CBService* cb_service, NSError* error); |
| 96 void DidUpdateValue(CBCharacteristic* characteristic, NSError* error); | 96 void DidUpdateValue(CBCharacteristic* characteristic, NSError* error); |
| 97 void DidWriteValue(CBCharacteristic* characteristic, NSError* error); |
| 97 | 98 |
| 98 // Updates information about the device. | 99 // Updates information about the device. |
| 99 virtual void Update(NSDictionary* advertisement_data, int rssi); | 100 virtual void Update(NSDictionary* advertisement_data, int rssi); |
| 100 | 101 |
| 101 static std::string GetPeripheralIdentifier(CBPeripheral* peripheral); | 102 static std::string GetPeripheralIdentifier(CBPeripheral* peripheral); |
| 102 | 103 |
| 103 // Hashes and truncates the peripheral identifier to deterministically | 104 // Hashes and truncates the peripheral identifier to deterministically |
| 104 // construct an address. The use of fake addresses is a temporary fix before | 105 // construct an address. The use of fake addresses is a temporary fix before |
| 105 // we switch to using bluetooth identifiers throughout Chrome. | 106 // we switch to using bluetooth identifiers throughout Chrome. |
| 106 // http://crbug.com/507824 | 107 // http://crbug.com/507824 |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 | 150 |
| 150 // The services (identified by UUIDs) that this device provides. | 151 // The services (identified by UUIDs) that this device provides. |
| 151 std::set<BluetoothUUID> advertised_uuids_; | 152 std::set<BluetoothUUID> advertised_uuids_; |
| 152 | 153 |
| 153 DISALLOW_COPY_AND_ASSIGN(BluetoothLowEnergyDeviceMac); | 154 DISALLOW_COPY_AND_ASSIGN(BluetoothLowEnergyDeviceMac); |
| 154 }; | 155 }; |
| 155 | 156 |
| 156 } // namespace device | 157 } // namespace device |
| 157 | 158 |
| 158 #endif // DEVICE_BLUETOOTH_BLUETOOTH_LOW_ENERGY_DEVICE_MAC_H_ | 159 #endif // DEVICE_BLUETOOTH_BLUETOOTH_LOW_ENERGY_DEVICE_MAC_H_ |
| OLD | NEW |