diff options
author | Javier <dev.git@javispedro.com> | 2021-09-12 19:41:12 +0200 |
---|---|---|
committer | Javier <dev.git@javispedro.com> | 2021-09-12 19:41:12 +0200 |
commit | ac7b085449fb49f54225d22c7c229da6ad120e2b (patch) | |
tree | 7910cc8c9a3268dbacbbe434c7f3cea4eedafd3d /smartpen.h | |
parent | 66dd35254724ec5d4471a8be71f92e06cf0fa8e8 (diff) | |
download | scribiu-ac7b085449fb49f54225d22c7c229da6ad120e2b.tar.gz scribiu-ac7b085449fb49f54225d22c7c229da6ad120e2b.zip |
remove PEN_EPOCH mistake and get usertime from the pen
Diffstat (limited to 'smartpen.h')
-rw-r--r-- | smartpen.h | 18 |
1 files changed, 12 insertions, 6 deletions
@@ -27,7 +27,7 @@ #define SMARTPEN_DPI_X (677.3333) #define SMARTPEN_DPI_Y (677.3333) -// TODO: These values are mostly random. +// TODO: These values are obtained by observation and may be wrong #define SMARTPEN_BLEED_X 333.3 #define SMARTPEN_BLEED_Y 333.3 @@ -40,19 +40,26 @@ public: ~Smartpen(); typedef QPair<unsigned int, unsigned int> Address; - typedef qint64 PenTime; typedef quint64 PenId; + typedef quint64 PenTime; bool isConnected() const; - enum Parameters : quint16 { + enum Parameter : quint16 { + /// The offset between the PenTime (see below) and the user's configured time. This value is static. + PenUserTime = 0x8003, + /// The current time as reported by the pen's rtc + PenRtcTime = 0x8004, + PenType = 0x8006, PenName = 0x8011 }; QByteArray getObject(const QString& name); - QString getParameter(Parameters parameter); + QByteArray getParameter(Parameter parameter); QString getPenName(); + PenTime getPenTime(Parameter parameter); + QVariantMap getPenInfo(); struct ChangeReport { @@ -67,8 +74,7 @@ public: QByteArray getLspData(const QString &name, PenTime from = 0); QByteArray getPaperReplay(PenTime from = 0); - static PenTime toPenTime(const QDateTime &dt); - static QDateTime fromPenTime(PenTime t); + static QDateTime fromPenTime(PenTime userTime, PenTime penTime); static QString toPenSerial(PenId id); static PenId toPenId(const QString &serial); |