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 <torvalds@linux-foundation.org>
This commit is contained in:
Linus Torvalds 2018-10-06 11:26:26 -07:00 committed by Dirk Hohndel
parent ec532b8f59
commit 88f4c06b99
2 changed files with 4 additions and 0 deletions

View file

@ -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<QUuid> hwAllCharacteristics = {
"{00000001-0000-1000-8000-008025000000}", // HW_OSTC_BLE_DATA_RX