From 88f4c06b993daa1d669aad71f90d92c4ebdb4c9c Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Sat, 6 Oct 2018 11:26:26 -0700 Subject: qt-ble: add support to wait for descriptor write completion When we enable notifications, we actually want to make sure to wait for that write to have completed before we start communicating with the device, because otherwise we might lose notification events. Signed-off-by: Linus Torvalds --- core/qt-ble.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'core/qt-ble.h') diff --git a/core/qt-ble.h b/core/qt-ble.h index ddf628e60..eb028f9b9 100644 --- a/core/qt-ble.h +++ b/core/qt-ble.h @@ -24,6 +24,7 @@ public: dc_status_t read(void* data, size_t size, size_t *actual); inline QLowEnergyService *preferredService() { return preferred; } + inline int descriptorWritten() { return desc_written; } dc_status_t select_preferred_service(void); public slots: @@ -43,6 +44,7 @@ private: bool isCharacteristicWritten; dc_user_device_t *device; unsigned int hw_credit = 0; + unsigned int desc_written = 0; QList hwAllCharacteristics = { "{00000001-0000-1000-8000-008025000000}", // HW_OSTC_BLE_DATA_RX -- cgit v1.2.3-70-g09d2