Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(225)

Unified Diff: device/bluetooth/bluetooth_low_energy_win_fake.h

Issue 1690133002: Implement BluetoothRemoteGattServiceWin and related unit tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address comments and split out of included GATT services Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..b069daa8ad5a348102c5af863cf2f6d8ea4bdcb1 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,38 @@ class BluetoothLowEnergyWrapperFake : public BluetoothLowEnergyWrapper {
const base::FilePath& device_path,
ScopedVector<BluetoothLowEnergyServiceInfo>* services,
std::string* error) 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| may be nullptr to indicate a primary service.
+ BLEGattService* SimulateBLEGattService(BLEDevice* device,
+ BLEGattService* parent_service,
+ const BTH_LE_UUID& uuid);
+
+ // Note: |parent_service| may be nullptr to indicate a primary service.
+ void SimulateBLEGattServiceRemoved(BLEDevice* device,
+ 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* SimulateBLEGattCharacterisc(
+ std::string device_address,
+ BLEGattService* parent_service,
+ const BTH_LE_GATT_CHARACTERISTIC& characteristic);
+ void SimulateBLEGattCharacteriscRemove(BLEGattService* parent_service,
+ std::string attribute_handle);
private:
// Generate an unique attribute handle on |device_address|.
@@ -102,18 +130,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_;

Powered by Google App Engine
This is Rietveld 408576698