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 <peter.hutterer@who-t.net>
This commit is contained in:
Peter Hutterer 2019-08-12 14:01:15 +10:00
parent 5e4ab89f41
commit c39c20ede2
2 changed files with 3 additions and 16 deletions

View File

@ -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`

View File

@ -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()