Chromium Code Reviews| Index: device/bluetooth/bluetooth_low_energy_win_fake.h |
| diff --git a/device/bluetooth/bluetooth_low_energy_win_fake.h b/device/bluetooth/bluetooth_low_energy_win_fake.h |
| index a4da0c72a21d3beaf5280cacb61515e216b93bed..723f4ac6a73831c7635cd4baa7c75300f6690ccf 100644 |
| --- a/device/bluetooth/bluetooth_low_energy_win_fake.h |
| +++ b/device/bluetooth/bluetooth_low_energy_win_fake.h |
| @@ -68,6 +68,7 @@ class BluetoothLowEnergyWrapperFake : public BluetoothLowEnergyWrapper { |
| BluetoothLowEnergyWrapperFake(); |
| ~BluetoothLowEnergyWrapperFake() override; |
| + bool IsBluetoothLowEnergySupported() override; |
| bool EnumerateKnownBluetoothLowEnergyDevices( |
| ScopedVector<BluetoothLowEnergyDeviceInfo>* devices, |
| std::string* error) override; |
| @@ -78,11 +79,45 @@ class BluetoothLowEnergyWrapperFake : public BluetoothLowEnergyWrapper { |
| const base::FilePath& device_path, |
| ScopedVector<BluetoothLowEnergyServiceInfo>* services, |
| std::string* error) override; |
| + HRESULT ReadIncludedServicesOfAService( |
| + base::FilePath& service_path, |
| + const PBTH_LE_GATT_SERVICE service, |
| + scoped_ptr<BTH_LE_GATT_SERVICE>* out_included_services, |
| + USHORT* out_counts) override; |
| + HRESULT ReadCharacteristicsOfAService( |
| + base::FilePath& service_path, |
| + const PBTH_LE_GATT_SERVICE service, |
| + scoped_ptr<BTH_LE_GATT_CHARACTERISTIC>* out_included_characteristics, |
| + USHORT* out_counts) override; |
| BLEDevice* SimulateBLEDevice(std::string device_name, |
| BLUETOOTH_ADDRESS device_address); |
| BLEDevice* GetSimulatedBLEDevice(std::string device_address); |
| - BLEGattService* SimulateBLEGattService(BLEDevice* device, std::string uuid); |
| + |
| + // Note: |parent_service| == nullptr if simulated service is a primary |
|
scheib
2016/02/24 01:39:10
|parent_service| may be nullptr to indicate a prim
gogerald1
2016/02/24 16:09:06
Done.
|
| + // service. |
| + BLEGattService* SimulateBLEGattService(BLEDevice* device, |
| + BLEGattService* parent_service, |
| + const BTH_LE_UUID& uuid); |
| + |
| + // Note: |parent_service| == nullptr if removed service is a primary |
|
scheib
2016/02/24 01:39:10
ditto
gogerald1
2016/02/24 16:09:06
Done.
|
| + // service. |
| + void SimulateBLEGattServiceRemove(BLEDevice* device, |
|
scheib
2016/02/24 01:39:10
SimulateBLEGattServiceRemoved
gogerald1
2016/02/24 16:09:06
Done.
|
| + BLEGattService* parent_service, |
| + std::string attribute_handle); |
| + |
| + // Note: |chain_of_att_handle| contains the attribute handles of the services |
| + // in order from primary service to target service. The last item in |
| + // |chain_of_att_handle| is the target service's attribute handle. |
| + BLEGattService* GetSimulatedGattService( |
| + BLEDevice* device, |
| + const std::vector<std::string>& chain_of_att_handle); |
| + BLEGattCharacteristic* SimulateCharacterisc( |
|
scheib
2016/02/24 01:39:10
SimulateCharacteristic. Note this doesn't follow t
gogerald1
2016/02/24 16:09:06
Follow above names "BLEGatt" for now since all the
|
| + std::string device_address, |
| + BLEGattService* parent_service, |
| + const BTH_LE_GATT_CHARACTERISTIC& characteristic); |
| + void SimulateCharacteriscRemove(BLEGattService* parent_service, |
| + std::string attribute_handle); |
| private: |
| // Generate an unique attribute handle on |device_address|. |
| @@ -102,18 +137,15 @@ class BluetoothLowEnergyWrapperFake : public BluetoothLowEnergyWrapper { |
| // GenerateBLEDevicePath or GenerateBLEGattServiceDevicePath. |
| base::string16 ExtractDeviceAddressFromDevicePath(base::string16 path); |
| - // Extract service attribute handle from the |path| generated by |
| + // Extract service attribute handles from the |path| generated by |
| // GenerateBLEGattServiceDevicePath. |
| - base::string16 ExtractServiceAttributeHandleFromDevicePath( |
| + std::vector<std::string> ExtractServiceAttributeHandlesFromDevicePath( |
| base::string16 path); |
| // The canonical BLE device address string format is the |
| // BluetoothDevice::CanonicalizeAddress. |
| std::string BluetoothAddressToCanonicalString(const BLUETOOTH_ADDRESS& btha); |
| - // The canonical UUID string format is device::BluetoothUUID.value(). |
| - BTH_LE_UUID CanonicalStringToBTH_LE_UUID(std::string uuid); |
| - |
| // Table to store allocated attribute handle for a device. |
| BLEAttributeHandleTable attribute_handle_table_; |
| BLEDevicesMap simulated_devices_; |