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 "device/bluetooth/bluetooth_low_energy_win.h" | 8 #include "device/bluetooth/bluetooth_low_energy_win.h" |
9 | 9 |
10 #include <set> | 10 #include <set> |
(...skipping 15 matching lines...) Expand all Loading... |
26 BLEGattServicesMap; | 26 BLEGattServicesMap; |
27 typedef std::unordered_map<std::string, scoped_ptr<BLEGattCharacteristic>> | 27 typedef std::unordered_map<std::string, scoped_ptr<BLEGattCharacteristic>> |
28 BLEGattCharacteristicsMap; | 28 BLEGattCharacteristicsMap; |
29 typedef std::unordered_map<std::string, scoped_ptr<BLEGattDescriptor>> | 29 typedef std::unordered_map<std::string, scoped_ptr<BLEGattDescriptor>> |
30 BLEGattDescriptorsMap; | 30 BLEGattDescriptorsMap; |
31 // The key of BLEAttributeHandleTable is the string of the BLE device address. | 31 // The key of BLEAttributeHandleTable is the string of the BLE device address. |
32 typedef std::unordered_map<std::string, scoped_ptr<std::set<USHORT>>> | 32 typedef std::unordered_map<std::string, scoped_ptr<std::set<USHORT>>> |
33 BLEAttributeHandleTable; | 33 BLEAttributeHandleTable; |
34 | 34 |
35 struct BLEDevice { | 35 struct BLEDevice { |
| 36 BLEDevice(); |
| 37 ~BLEDevice(); |
36 scoped_ptr<BluetoothLowEnergyDeviceInfo> device_info; | 38 scoped_ptr<BluetoothLowEnergyDeviceInfo> device_info; |
37 BLEGattServicesMap primary_services; | 39 BLEGattServicesMap primary_services; |
38 }; | 40 }; |
39 | 41 |
40 struct BLEGattService { | 42 struct BLEGattService { |
| 43 BLEGattService(); |
| 44 ~BLEGattService(); |
41 scoped_ptr<BTH_LE_GATT_SERVICE> service_info; | 45 scoped_ptr<BTH_LE_GATT_SERVICE> service_info; |
42 BLEGattServicesMap included_services; | 46 BLEGattServicesMap included_services; |
43 BLEGattCharacteristicsMap included_characteristics; | 47 BLEGattCharacteristicsMap included_characteristics; |
44 }; | 48 }; |
45 | 49 |
46 struct BLEGattCharacteristic { | 50 struct BLEGattCharacteristic { |
| 51 BLEGattCharacteristic(); |
| 52 ~BLEGattCharacteristic(); |
47 scoped_ptr<BTH_LE_GATT_CHARACTERISTIC> characteristic_info; | 53 scoped_ptr<BTH_LE_GATT_CHARACTERISTIC> characteristic_info; |
48 scoped_ptr<BTH_LE_GATT_CHARACTERISTIC_VALUE> value; | 54 scoped_ptr<BTH_LE_GATT_CHARACTERISTIC_VALUE> value; |
49 BLEGattDescriptorsMap included_descriptors; | 55 BLEGattDescriptorsMap included_descriptors; |
50 }; | 56 }; |
51 | 57 |
52 struct BLEGattDescriptor { | 58 struct BLEGattDescriptor { |
| 59 BLEGattDescriptor(); |
| 60 ~BLEGattDescriptor(); |
53 scoped_ptr<BTH_LE_GATT_DESCRIPTOR> descriptor_info; | 61 scoped_ptr<BTH_LE_GATT_DESCRIPTOR> descriptor_info; |
54 scoped_ptr<BTH_LE_GATT_DESCRIPTOR_VALUE> value; | 62 scoped_ptr<BTH_LE_GATT_DESCRIPTOR_VALUE> value; |
55 }; | 63 }; |
56 | 64 |
57 // Fake implementation of BluetoothLowEnergyWrapper. Used for BluetoothTestWin. | 65 // Fake implementation of BluetoothLowEnergyWrapper. Used for BluetoothTestWin. |
58 class BluetoothLowEnergyWrapperFake : public BluetoothLowEnergyWrapper { | 66 class BluetoothLowEnergyWrapperFake : public BluetoothLowEnergyWrapper { |
59 public: | 67 public: |
60 BluetoothLowEnergyWrapperFake(); | 68 BluetoothLowEnergyWrapperFake(); |
61 ~BluetoothLowEnergyWrapperFake() override; | 69 ~BluetoothLowEnergyWrapperFake() override; |
62 | 70 |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 | 115 |
108 // Table to store allocated attribute handle for a device. | 116 // Table to store allocated attribute handle for a device. |
109 BLEAttributeHandleTable attribute_handle_table_; | 117 BLEAttributeHandleTable attribute_handle_table_; |
110 BLEDevicesMap simulated_devices_; | 118 BLEDevicesMap simulated_devices_; |
111 }; | 119 }; |
112 | 120 |
113 } // namespace win | 121 } // namespace win |
114 } // namespace device | 122 } // namespace device |
115 | 123 |
116 #endif // DEVICE_BLUETOOTH_BLUETOOTH_LOW_ENERGY_WIN_FAKE_H_ | 124 #endif // DEVICE_BLUETOOTH_BLUETOOTH_LOW_ENERGY_WIN_FAKE_H_ |
OLD | NEW |