| OLD | NEW |
| 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 #ifndef DEVICE_BLUETOOTH_BLUETOOTH_LOW_ENERGY_WIN_FAKE_H_ | 5 #ifndef DEVICE_BLUETOOTH_BLUETOOTH_LOW_ENERGY_WIN_FAKE_H_ |
| 6 #define DEVICE_BLUETOOTH_BLUETOOTH_LOW_ENERGY_WIN_FAKE_H_ | 6 #define DEVICE_BLUETOOTH_BLUETOOTH_LOW_ENERGY_WIN_FAKE_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <unordered_map> | 10 #include <unordered_map> |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 struct GattDescriptor { | 72 struct GattDescriptor { |
| 73 GattDescriptor(); | 73 GattDescriptor(); |
| 74 ~GattDescriptor(); | 74 ~GattDescriptor(); |
| 75 std::unique_ptr<BTH_LE_GATT_DESCRIPTOR> descriptor_info; | 75 std::unique_ptr<BTH_LE_GATT_DESCRIPTOR> descriptor_info; |
| 76 std::unique_ptr<BTH_LE_GATT_DESCRIPTOR_VALUE> value; | 76 std::unique_ptr<BTH_LE_GATT_DESCRIPTOR_VALUE> value; |
| 77 }; | 77 }; |
| 78 | 78 |
| 79 struct GattCharacteristicObserver { | 79 struct GattCharacteristicObserver { |
| 80 GattCharacteristicObserver(); | 80 GattCharacteristicObserver(); |
| 81 ~GattCharacteristicObserver(); | 81 ~GattCharacteristicObserver(); |
| 82 PFNBLUETOOTH_GATT_EVENT_CALLBACK callback; | 82 PFNBLUETOOTH_GATT_EVENT_CALLBACK_CORRECTED callback; |
| 83 PVOID context; | 83 PVOID context; |
| 84 }; | 84 }; |
| 85 | 85 |
| 86 // Fake implementation of BluetoothLowEnergyWrapper. Used for BluetoothTestWin. | 86 // Fake implementation of BluetoothLowEnergyWrapper. Used for BluetoothTestWin. |
| 87 class BluetoothLowEnergyWrapperFake : public BluetoothLowEnergyWrapper { | 87 class BluetoothLowEnergyWrapperFake : public BluetoothLowEnergyWrapper { |
| 88 public: | 88 public: |
| 89 class Observer { | 89 class Observer { |
| 90 public: | 90 public: |
| 91 Observer() {} | 91 Observer() {} |
| 92 ~Observer() {} | 92 ~Observer() {} |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 std::unique_ptr<BTH_LE_GATT_DESCRIPTOR>* out_included_descriptors, | 124 std::unique_ptr<BTH_LE_GATT_DESCRIPTOR>* out_included_descriptors, |
| 125 USHORT* out_counts) override; | 125 USHORT* out_counts) override; |
| 126 HRESULT ReadCharacteristicValue( | 126 HRESULT ReadCharacteristicValue( |
| 127 base::FilePath& service_path, | 127 base::FilePath& service_path, |
| 128 const PBTH_LE_GATT_CHARACTERISTIC characteristic, | 128 const PBTH_LE_GATT_CHARACTERISTIC characteristic, |
| 129 std::unique_ptr<BTH_LE_GATT_CHARACTERISTIC_VALUE>* out_value) override; | 129 std::unique_ptr<BTH_LE_GATT_CHARACTERISTIC_VALUE>* out_value) override; |
| 130 HRESULT WriteCharacteristicValue( | 130 HRESULT WriteCharacteristicValue( |
| 131 base::FilePath& service_path, | 131 base::FilePath& service_path, |
| 132 const PBTH_LE_GATT_CHARACTERISTIC characteristic, | 132 const PBTH_LE_GATT_CHARACTERISTIC characteristic, |
| 133 PBTH_LE_GATT_CHARACTERISTIC_VALUE new_value) override; | 133 PBTH_LE_GATT_CHARACTERISTIC_VALUE new_value) override; |
| 134 HRESULT RegisterGattEvents(base::FilePath& service_path, | 134 HRESULT RegisterGattEvents( |
| 135 BTH_LE_GATT_EVENT_TYPE type, | 135 base::FilePath& service_path, |
| 136 PVOID event_parameter, | 136 BTH_LE_GATT_EVENT_TYPE type, |
| 137 PFNBLUETOOTH_GATT_EVENT_CALLBACK callback, | 137 PVOID event_parameter, |
| 138 PVOID context, | 138 PFNBLUETOOTH_GATT_EVENT_CALLBACK_CORRECTED callback, |
| 139 BLUETOOTH_GATT_EVENT_HANDLE* out_handle) override; | 139 PVOID context, |
| 140 BLUETOOTH_GATT_EVENT_HANDLE* out_handle) override; |
| 140 HRESULT UnregisterGattEvent( | 141 HRESULT UnregisterGattEvent( |
| 141 BLUETOOTH_GATT_EVENT_HANDLE event_handle) override; | 142 BLUETOOTH_GATT_EVENT_HANDLE event_handle) override; |
| 142 HRESULT WriteDescriptorValue( | 143 HRESULT WriteDescriptorValue( |
| 143 base::FilePath& service_path, | 144 base::FilePath& service_path, |
| 144 const PBTH_LE_GATT_DESCRIPTOR descriptor, | 145 const PBTH_LE_GATT_DESCRIPTOR descriptor, |
| 145 PBTH_LE_GATT_DESCRIPTOR_VALUE new_value) override; | 146 PBTH_LE_GATT_DESCRIPTOR_VALUE new_value) override; |
| 146 | 147 |
| 147 BLEDevice* SimulateBLEDevice(std::string device_name, | 148 BLEDevice* SimulateBLEDevice(std::string device_name, |
| 148 BLUETOOTH_ADDRESS device_address); | 149 BLUETOOTH_ADDRESS device_address); |
| 149 BLEDevice* GetSimulatedBLEDevice(std::string device_address); | 150 BLEDevice* GetSimulatedBLEDevice(std::string device_address); |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 BLEDevicesMap simulated_devices_; | 230 BLEDevicesMap simulated_devices_; |
| 230 Observer* observer_; | 231 Observer* observer_; |
| 231 GattCharacteristicObserverTable gatt_characteristic_observers_; | 232 GattCharacteristicObserverTable gatt_characteristic_observers_; |
| 232 GattCharacteristic* remembered_characteristic_; | 233 GattCharacteristic* remembered_characteristic_; |
| 233 }; | 234 }; |
| 234 | 235 |
| 235 } // namespace win | 236 } // namespace win |
| 236 } // namespace device | 237 } // namespace device |
| 237 | 238 |
| 238 #endif // DEVICE_BLUETOOTH_BLUETOOTH_LOW_ENERGY_WIN_FAKE_H_ | 239 #endif // DEVICE_BLUETOOTH_BLUETOOTH_LOW_ENERGY_WIN_FAKE_H_ |
| OLD | NEW |