wacom: opcode 0xeeff is the time since boot

This is an actual timestamp

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
pull/1/head
Benjamin Tissoires 2018-01-12 19:52:22 +01:00
parent b49225c890
commit 7437cb6f93
1 changed files with 4 additions and 2 deletions

View File

@ -446,7 +446,7 @@ class WacomDevice(GObject.Object):
formatted_args.append(0)
debug_data.append(' ')
logger.debug(f'{" ".join(debug_data)}')
return bitmask, opcode, formatted_args, offset + args_length
return bitmask, opcode, args, formatted_args, offset + args_length
def get_coordinate(self, bitmask, n, data, v, dv):
# drop the first 2 bytes as they are not valuable here
@ -473,7 +473,7 @@ class WacomDevice(GObject.Object):
drawing = None
stroke = None
while offset < len(data):
bitmask, opcode, args, offset = self.next_pen_data(data, offset)
bitmask, opcode, raw_args, args, offset = self.next_pen_data(data, offset)
if opcode == 0x3800:
logger.info(f'beginning of sequence')
drawing = Drawing((self.width, self.height), timestamp)
@ -481,6 +481,8 @@ class WacomDevice(GObject.Object):
continue
elif opcode == 0xeeff:
# some sort of headers
time_offset = list2be(raw_args[4:])
logger.info(f'time offset since boot: {time_offset * 0.005} secs')
stroke = Stroke()
drawing.append(stroke)
continue