aboutsummaryrefslogtreecommitdiff
path: root/smartpen.h
diff options
context:
space:
mode:
authorJavier <dev.git@javispedro.com>2020-04-12 00:45:32 +0200
committerJavier <dev.git@javispedro.com>2020-04-12 01:24:39 +0200
commit5cb277888995edecfafd83fed4cf2bd510052a4b (patch)
tree9c94054e59035eece0e34e8be10ee77769b1d9e4 /smartpen.h
parent7f3d796c50b1855e690f74b35fd35798142ceb35 (diff)
downloadscribiu-5cb277888995edecfafd83fed4cf2bd510052a4b.tar.gz
scribiu-5cb277888995edecfafd83fed4cf2bd510052a4b.zip
port to qt5, libusb 1.0, and openobex 1.7
Diffstat (limited to 'smartpen.h')
-rw-r--r--smartpen.h14
1 files changed, 12 insertions, 2 deletions
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