From c39c20ede2607cd4eb71ed32a54e1fdc24f82b8b Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Mon, 12 Aug 2019 14:01:15 +1000 Subject: [PATCH] protocol: drop the UNKNOWN_B1 class 0xb1 is the SetMode command, the rest is just the argument for which mode we want Signed-off-by: Peter Hutterer --- tuhi/protocol.py | 13 ------------- tuhi/wacom.py | 6 +++--- 2 files changed, 3 insertions(+), 16 deletions(-) diff --git a/tuhi/protocol.py b/tuhi/protocol.py index 11a45e2..eb51f01 100644 --- a/tuhi/protocol.py +++ b/tuhi/protocol.py @@ -75,7 +75,6 @@ class Interactions(enum.Enum): REGISTER_WAIT_FOR_BUTTON = enum.auto() REGISTER_COMPLETE = enum.auto() - UNKNOWN_B1 = enum.auto() UNKNOWN_E3 = enum.auto() UNKNOWN_EC = enum.auto() @@ -819,18 +818,6 @@ class MsgUnknownECCommand(Msg): # uses the default 0xb3 handler -class MsgUnknownB1Command(Msg): - interaction = Interactions.UNKNOWN_B1 - opcode = 0xb1 - protocol = ProtocolVersion.ANY - - def __init__(self, *args, **kwargs): - super().__init__(*args, **kwargs) - self.args = [0x01] - - # uses the default 0xb3 handler - - class MsgSetMode(Msg): ''' :param mode: one of :class:`Mode` diff --git a/tuhi/wacom.py b/tuhi/wacom.py index 41b4cb4..7fe8ba5 100644 --- a/tuhi/wacom.py +++ b/tuhi/wacom.py @@ -165,7 +165,7 @@ class DataLogger(object): return self.parent._recv(self.source, data) commands = { - 0xb1: 'start/stop live', + 0xb1: 'set mode', 0xb6: 'set time', 0xb7: 'get firmware', 0xb9: 'read battery info', @@ -743,7 +743,7 @@ class WacomProtocolBase(WacomProtocolLowLevelComm): def stop_live(self): self.p.execute(Interactions.SET_MODE, Mode.IDLE) - def b1_command(self): + def set_paper_mode(self): self.p.execute(Interactions.SET_MODE, Mode.PAPER).execute() def is_data_available(self): @@ -886,7 +886,7 @@ class WacomProtocolBase(WacomProtocolLowLevelComm): return drawing def read_offline_data(self): - self.b1_command() + self.set_paper_mode() transaction_count = 0 while self.is_data_available(): count, timestamp = self.get_stroke_data()