From 5cb277888995edecfafd83fed4cf2bd510052a4b Mon Sep 17 00:00:00 2001 From: Javier Date: Sun, 12 Apr 2020 00:45:32 +0200 Subject: port to qt5, libusb 1.0, and openobex 1.7 --- smartpen.h | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'smartpen.h') diff --git a/smartpen.h b/smartpen.h index 18ac955..30c1f74 100644 --- a/smartpen.h +++ b/smartpen.h @@ -73,12 +73,14 @@ public: static QString toPenSerial(PenId id); static PenId toPenId(const QString &serial); + static bool reset(const Address &addr); + public slots: bool connectToPen(const Address &addr); void disconnectFromPen(); signals: - void error(); + void linkError(const QString &msg); private: static void obexEventCb(obex_t *handle, obex_object_t *obj, @@ -86,17 +88,25 @@ private: void handleObexEvent(obex_object_t *object, int event, int obex_cmd, int obex_rsp); void handleObexRequestDone(obex_object_t *object, int obex_cmd, int obex_rsp); + void handleObexContinue(obex_object_t *object, int obex_cmd); + + void prepareRequest(); + bool waitForRequestComplete(int timeout); + void addConnHeader(obex_object_t *object) const; + bool sendContinue(int obex_cmd); static QString toPenSerialSegment(quint32 id, int len); static quint32 fromPenSerialSegment(const QString &s); static QByteArray encodeUtf16(const QString &s); - void addConnHeader(obex_object_t *object) const; + private: obex_t * _obex; quint32 _connId; QByteArray _inBuf; + bool _reqComplete; + uint _continueReceived; }; #endif // SMARTPEN_H -- cgit v1.2.3