| 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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 }; | 58 }; |
| 59 | 59 |
| 60 struct GattCharacteristic { | 60 struct GattCharacteristic { |
| 61 GattCharacteristic(); | 61 GattCharacteristic(); |
| 62 ~GattCharacteristic(); | 62 ~GattCharacteristic(); |
| 63 std::unique_ptr<BTH_LE_GATT_CHARACTERISTIC> characteristic_info; | 63 std::unique_ptr<BTH_LE_GATT_CHARACTERISTIC> characteristic_info; |
| 64 std::unique_ptr<BTH_LE_GATT_CHARACTERISTIC_VALUE> value; | 64 std::unique_ptr<BTH_LE_GATT_CHARACTERISTIC_VALUE> value; |
| 65 GattDescriptorsMap included_descriptors; | 65 GattDescriptorsMap included_descriptors; |
| 66 std::vector<HRESULT> read_errors; | 66 std::vector<HRESULT> read_errors; |
| 67 std::vector<HRESULT> write_errors; | 67 std::vector<HRESULT> write_errors; |
| 68 std::vector<HRESULT> notify_errors; |
| 68 std::vector<BLUETOOTH_GATT_EVENT_HANDLE> observers; | 69 std::vector<BLUETOOTH_GATT_EVENT_HANDLE> observers; |
| 69 }; | 70 }; |
| 70 | 71 |
| 71 struct GattDescriptor { | 72 struct GattDescriptor { |
| 72 GattDescriptor(); | 73 GattDescriptor(); |
| 73 ~GattDescriptor(); | 74 ~GattDescriptor(); |
| 74 std::unique_ptr<BTH_LE_GATT_DESCRIPTOR> descriptor_info; | 75 std::unique_ptr<BTH_LE_GATT_DESCRIPTOR> descriptor_info; |
| 75 std::unique_ptr<BTH_LE_GATT_DESCRIPTOR_VALUE> value; | 76 std::unique_ptr<BTH_LE_GATT_DESCRIPTOR_VALUE> value; |
| 76 }; | 77 }; |
| 77 | 78 |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 const BTH_LE_GATT_CHARACTERISTIC& characteristic); | 171 const BTH_LE_GATT_CHARACTERISTIC& characteristic); |
| 171 void SimulateGattCharacteriscRemove(GattService* parent_service, | 172 void SimulateGattCharacteriscRemove(GattService* parent_service, |
| 172 std::string attribute_handle); | 173 std::string attribute_handle); |
| 173 GattCharacteristic* GetSimulatedGattCharacteristic( | 174 GattCharacteristic* GetSimulatedGattCharacteristic( |
| 174 GattService* parent_service, | 175 GattService* parent_service, |
| 175 std::string attribute_handle); | 176 std::string attribute_handle); |
| 176 void SimulateGattCharacteristicValue(GattCharacteristic* characteristic, | 177 void SimulateGattCharacteristicValue(GattCharacteristic* characteristic, |
| 177 const std::vector<uint8_t>& value); | 178 const std::vector<uint8_t>& value); |
| 178 void SimulateCharacteristicValueChangeNotification( | 179 void SimulateCharacteristicValueChangeNotification( |
| 179 GattCharacteristic* characteristic); | 180 GattCharacteristic* characteristic); |
| 181 void SimulateGattCharacteristicSetNotifyError( |
| 182 GattCharacteristic* characteristic, |
| 183 HRESULT error); |
| 180 void SimulateGattCharacteristicReadError(GattCharacteristic* characteristic, | 184 void SimulateGattCharacteristicReadError(GattCharacteristic* characteristic, |
| 181 HRESULT error); | 185 HRESULT error); |
| 182 void SimulateGattCharacteristicWriteError(GattCharacteristic* characteristic, | 186 void SimulateGattCharacteristicWriteError(GattCharacteristic* characteristic, |
| 183 HRESULT error); | 187 HRESULT error); |
| 184 void RememberCharacteristicForSubsequentAction(GattService* parent_service, | 188 void RememberCharacteristicForSubsequentAction(GattService* parent_service, |
| 185 std::string attribute_handle); | 189 std::string attribute_handle); |
| 186 void SimulateGattDescriptor(std::string device_address, | 190 void SimulateGattDescriptor(std::string device_address, |
| 187 GattCharacteristic* characteristic, | 191 GattCharacteristic* characteristic, |
| 188 const BTH_LE_UUID& uuid); | 192 const BTH_LE_UUID& uuid); |
| 189 void AddObserver(Observer* observer); | 193 void AddObserver(Observer* observer); |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 BLEDevicesMap simulated_devices_; | 229 BLEDevicesMap simulated_devices_; |
| 226 Observer* observer_; | 230 Observer* observer_; |
| 227 GattCharacteristicObserverTable gatt_characteristic_observers_; | 231 GattCharacteristicObserverTable gatt_characteristic_observers_; |
| 228 GattCharacteristic* remembered_characteristic_; | 232 GattCharacteristic* remembered_characteristic_; |
| 229 }; | 233 }; |
| 230 | 234 |
| 231 } // namespace win | 235 } // namespace win |
| 232 } // namespace device | 236 } // namespace device |
| 233 | 237 |
| 234 #endif // DEVICE_BLUETOOTH_BLUETOOTH_LOW_ENERGY_WIN_FAKE_H_ | 238 #endif // DEVICE_BLUETOOTH_BLUETOOTH_LOW_ENERGY_WIN_FAKE_H_ |
| OLD | NEW |