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

Unified Diff: device/bluetooth/bluetooth_remote_gatt_characteristic_win.h

Issue 1749403002: Implement BluetoothRemoteGattCharacteristicWin::StartNotifySession and related unit tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: adjust 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_remote_gatt_characteristic_win.h
diff --git a/device/bluetooth/bluetooth_remote_gatt_characteristic_win.h b/device/bluetooth/bluetooth_remote_gatt_characteristic_win.h
index bf37ccc17e8a470acdf7a2c495b9173f4358a1ed..2d984c23dd65e27a1313c21c254dd6357c137aac 100644
--- a/device/bluetooth/bluetooth_remote_gatt_characteristic_win.h
+++ b/device/bluetooth/bluetooth_remote_gatt_characteristic_win.h
@@ -52,10 +52,14 @@ class DEVICE_BLUETOOTH_EXPORT BluetoothRemoteGattCharacteristicWin
const base::Closure& callback,
const ErrorCallback& error_callback) override;
+ // Handles Bluetooth LE GATT event from OS.
+ void OnGetRemoteGattEvent(BTH_LE_GATT_EVENT_TYPE type, PVOID event_parameter);
+
// Update included descriptors.
void Update();
uint16_t GetAttributeHandle() const;
BluetoothRemoteGattServiceWin* GetWinService() { return parent_service_; }
+ void StopNotifySession();
private:
void OnGetIncludedDescriptorsCallback(
@@ -80,6 +84,10 @@ class DEVICE_BLUETOOTH_EXPORT BluetoothRemoteGattCharacteristicWin
HRESULT hr);
void OnWriteRemoteCharacteristicValueCallback(HRESULT hr);
BluetoothGattService::GattErrorCode HRESULTToGattErrorCode(HRESULT hr);
+ void OnGattCharacteristicValueChanged(scoped_ptr<uint8_t> new_value,
+ ULONG size);
+ void GattEventRegistrationCallback(BLUETOOTH_GATT_EVENT_HANDLE event_handle,
+ HRESULT hr);
BluetoothRemoteGattServiceWin* parent_service_;
scoped_refptr<BluetoothTaskManagerWin> task_manager_;
@@ -110,6 +118,18 @@ class DEVICE_BLUETOOTH_EXPORT BluetoothRemoteGattCharacteristicWin
bool characteristic_value_read_or_write_in_progress_;
+ unsigned int number_of_active_notify_sessions_;
+
+ // Vector stores StartNotifySession request callbacks.
+ std::vector<std::pair<NotifySessionCallback, ErrorCallback>>
+ start_notify_session_callbacks_;
+
+ // Flag indicates if GATT event registration is in progress.
+ bool gatt_event_registeration_in_progress_;
+
+ // GATT event handle from OS.
+ BLUETOOTH_GATT_EVENT_HANDLE gatt_event_handle_;
+
base::WeakPtrFactory<BluetoothRemoteGattCharacteristicWin> weak_ptr_factory_;
DISALLOW_COPY_AND_ASSIGN(BluetoothRemoteGattCharacteristicWin);
};

Powered by Google App Engine
This is Rietveld 408576698