There's just no point to that and if the tablet is currently in live mode, it
refuses the GET_WIDTH request anyway.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Previously, the YAML output was basically:
- send: [0xb9, 0x01, 0x00]
- recv: [0xba, 0x02, 0x44, 0x00]
using a context manager where replies are expeced we can now group the
replies in the yaml file:
with logger as _:
self.send_nordic_command(...)
self.wait_nordic_data(...)
And that will prodice a grouped entry in the YAML file:
- send: [0xb9, 0x01, 0x00]
recv: [0xba, 0x02, 0x44, 0x00]
Which means processing those becomes a bit easier.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
The session id is a UUID, postfixed by an incrementing number. The UUID stays
the same for Tuhi's livetime, the number increments with every bluetooth
connect/disconnect. Result is e.g. 4e55c30035d043ce9f6f4914fb223820-2.
This session id is printed to the log file, added to the YAML raw logs and to
the JSON file, making it easier which log part resulted in which drawing, etc.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
It's caused by a timeout but the underlying issue is that we never got the
reply that we wanted.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This situation will never be handled correctly b a GUI and there's no need to,
our settings aren't supposed to be edited by puny humans. So just log an error
and treat the device as unregistered.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
And since this function was the only one generating some of the exceptions,
let's remove those too.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Use --peek to download the first (oldest) drawing on the device but do not
delete it. This is primarily intended as a debugging option, so we can debug
the tablet handling without having to draw new drawings (which cause the
protocol messages to change slightly).
Since the tablet only has a "download oldest file" command this isn't very
useful to end users. If there are two or more files on the tablet, we can only
ever retrieve the oldest one.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
0xc3 is 'download the oldest file'
0xca is 'delete the oldest file' (usually the one we just received) from the tablet.
0xc1 is 'how many files are there'
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Not actually used at this point, but this way we have default
width/height/orientation etc. all in one place.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This is a slightly different model as the messages, primarily because it's not
quite as model-specific. So there's only one parse function and it can handle
both file types that we currently support (intuos pro and the spark/slate
bits).
All wrapped into their own classes to make future extensions a bit easier.
It's not a 1:1 implementation of the tuhi/wacom.py bits either because we now
know about a few extra bits like the flags in stroke headers.
Most importantly though, this can be easily tested now, with one test case
searching for raw logs in $XDG_DATA_HOME/tuhi/raw and parsing all of those. So
the more files are sitting in there (i.e. the more the tablet is used), the
better the test suite becomes.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Make sure our dimensions are in actual µm.
Note that this will mess with any cached JSON files since they are now on a
different scale.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
gresources and svgwrite don't (yet?) take a Path though, so we have to use
os.fspath() to convert those.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
The reachable range is 2100x14800, highest pressure is 1023. Unlike the slate
the paper block still affords to address almost the whole range even though
the paper is slightly narrower than the range - but it can slide left/right by
about 5mm.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Because it's annoying when there's an issue with the timestamp in the file and
you have to grep for the file name.
And while we're there, change the human readable date to be actually readable.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
It's the same message with a different argument, let's try not to do
gymnastics in the Msg code just so we can return a tuple.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
We can hook into the ProtocolVersion here, so let's de-duplicate this.
Should be backwards-compatible for config files but new config files will have
the uppercase name written now.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>