Commit Graph

10 Commits (master)

Author SHA1 Message Date
Peter Hutterer b54ac6e99e Fix flake8 errors - module import not at top of the file
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2021-01-22 17:09:27 +10:00
Peter Hutterer fcdacb7187 test: switch the message tests from unittest to pytest
We're already running the meson test through pytest anyway and pytest is more
powerfull than unittest. So let's switch, it's just a search/replace away.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-01-08 10:39:45 +01:00
Peter Hutterer 785c1e5f58 test: append the required \0xa to the spark messages
f5ea08f171 added this effective requirement for
the Spark and older generations, so let's make sure the test passes.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-01-08 10:08:36 +10:00
Peter Hutterer bffe41fbb6 protocol: handle 0xb3 automatically
0xb3 is the generic error code (or success, where applicable). Let's handle
those by default so that the rest of the messages only have to care about
replies with message-specific opcodes.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-08-29 12:38:21 +10:00
Peter Hutterer 6e4b190169 protocol: rename a few protocol messages to better reflect what they do
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>
2019-08-22 09:59:14 +10:00
Peter Hutterer 643dd34476 protocol: add the message for getting the point size
The dimensions of the tablet are in device units, the point size tells us how
big the actual tablet is.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-08-20 12:02:30 +10:00
Peter Hutterer 57aa0de954 protocol: the spark doesn't support get width/height
Let's make those noop messages that return the hardcoded width/height instead.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-08-20 12:02:30 +10:00
Peter Hutterer ff2618e68a protocol: add helper functions for converting to/from little endians
A few messages where we assumed the argument is a single byte are actually
little-endian 16 bits. let's add easy-to-use wrappers.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-08-20 12:02:30 +10:00
Peter Hutterer d73da09e26 protocol: 0xc7 on the spark seems to be in big-endian
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-08-15 15:10:25 +10:00
Peter Hutterer 3d5c0aa23c test: add unit-testing for the various protocol messages
This only tests for the success cases, but at least we know that path is
executed.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-08-14 07:37:30 +10:00