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

Unified Diff: device/bluetooth/bluetooth_task_manager_win.h

Issue 1690133002: Implement BluetoothRemoteGattServiceWin and related unit tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address comments 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_task_manager_win.h
diff --git a/device/bluetooth/bluetooth_task_manager_win.h b/device/bluetooth/bluetooth_task_manager_win.h
index 56ecbef0417357c5d241e30c35e61521af3a4096..0cee8925385069d71816f5ce3f111d142200dd23 100644
--- a/device/bluetooth/bluetooth_task_manager_win.h
+++ b/device/bluetooth/bluetooth_task_manager_win.h
@@ -18,6 +18,7 @@
#include "base/win/scoped_handle.h"
#include "device/bluetooth/bluetooth_adapter.h"
#include "device/bluetooth/bluetooth_export.h"
+#include "device/bluetooth/bluetooth_low_energy_win.h"
namespace base {
@@ -118,6 +119,36 @@ class DEVICE_BLUETOOTH_EXPORT BluetoothTaskManagerWin
void PostStartDiscoveryTask();
void PostStopDiscoveryTask();
+ // Callbacks of asynchronous operations of GATT service.
+ typedef base::Callback<
+ void(scoped_ptr<BTH_LE_GATT_SERVICE>, uint16_t, HRESULT)>
+ GetGattIncludedServicesCallback;
+ typedef base::Callback<
+ void(scoped_ptr<BTH_LE_GATT_CHARACTERISTIC>, uint16_t, HRESULT)>
+ GetGattIncludedCharacteristicsCallback;
+
+ // Get all included services of a given service. The service is uniquely
+ // identified by its |uuid| and |attribute_handle| with service device
+ // |service_path|. The result is returned asynchronously through |callback|.
+ void PostGetGattIncludedServices(
+ const base::FilePath& service_path,
+ const BluetoothUUID& uuid,
+ uint16_t attribute_handle,
+ const GetGattIncludedServicesCallback& callback);
+
+ // Get all included characteristics of a given service. The service is
+ // uniquely identified by its |uuid| and |attribute_handle| with service
+ // device |service_path|. The result is returned asynchronously through
+ // |callback|.
+ void PostGetGattIncludedCharacteristics(
+ const base::FilePath& service_path,
+ const BluetoothUUID& uuid,
+ uint16_t attribute_handle,
+ const GetGattIncludedCharacteristicsCallback& callback);
+
+ BluetoothUUID BluetoothLowEnergyUuidToBluetoothUuid(
+ const BTH_LE_UUID& bth_le_uuid);
+
private:
friend class base::RefCountedThreadSafe<BluetoothTaskManagerWin>;
friend class BluetoothTaskManagerWinTest;
@@ -208,6 +239,17 @@ class DEVICE_BLUETOOTH_EXPORT BluetoothTaskManagerWin
const std::string device_address,
ScopedVector<ServiceRecordState>* service_record_states);
+ // GATT service related functions.
+ void GetGattIncludedServices(base::FilePath service_path,
+ BluetoothUUID uuid,
+ uint16_t attribute_handle,
+ const GetGattIncludedServicesCallback& callback);
+ void GetGattIncludedCharacteristics(
+ base::FilePath device_path,
+ BluetoothUUID uuid,
+ uint16_t attribute_handle,
+ const GetGattIncludedCharacteristicsCallback& callback);
+
// UI task runner reference.
scoped_refptr<base::SequencedTaskRunner> ui_task_runner_;

Powered by Google App Engine
This is Rietveld 408576698