From 73bc782a537ea9d1b80607725e044ec3e7b74321 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Mon, 12 Aug 2019 14:10:54 +1000 Subject: [PATCH] protocol: 0xec is simply the GATT selection for file transfers Signed-off-by: Peter Hutterer --- tuhi/protocol.py | 10 +++++++--- tuhi/wacom.py | 8 ++++---- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/tuhi/protocol.py b/tuhi/protocol.py index eb51f01..db6ec7d 100644 --- a/tuhi/protocol.py +++ b/tuhi/protocol.py @@ -74,9 +74,9 @@ class Interactions(enum.Enum): REGISTER_PRESS_BUTTON = enum.auto() REGISTER_WAIT_FOR_BUTTON = enum.auto() REGISTER_COMPLETE = enum.auto() + SET_FILE_TRANSFER_REPORTING_TYPE = enum.auto() UNKNOWN_E3 = enum.auto() - UNKNOWN_EC = enum.auto() def as_hex_string(data): @@ -806,8 +806,12 @@ class MsgUnknownE3Command(Msg): # no arguments, uses the default 0xb3 handler -class MsgUnknownECCommand(Msg): - interaction = Interactions.UNKNOWN_EC +class MsgSetFileTransferReportingType(Msg): + ''' + Changes where the device needs to send the data to. + 0x00 is on the FFEE0003 GATT. + ''' + interaction = Interactions.SET_FILE_TRANSFER_REPORTING_TYPE opcode = 0xec protocol = ProtocolVersion.ANY diff --git a/tuhi/wacom.py b/tuhi/wacom.py index 7fe8ba5..2b46693 100644 --- a/tuhi/wacom.py +++ b/tuhi/wacom.py @@ -720,8 +720,8 @@ class WacomProtocolBase(WacomProtocolLowLevelComm): logger.info(f'dimensions: {msg.width}x{msg.height}') return msg.width, msg.height - def ec_command(self): - self.p.execute(Interactions.UNKNOWN_EC) + def select_transfer_gatt(self): + self.p.execute(Interactions.SET_FILE_TRANSFER_REPORTING_TYPE) def start_live(self, fd): self.p.execute(Interactions.SET_MODE, Mode.LIVE) @@ -992,7 +992,7 @@ class WacomProtocolSlate(WacomProtocolSpark): def register_device_finish(self): self.set_time() self.read_time() - self.ec_command() + self.select_transfer_gatt() self.get_name() w, h = self.get_dimensions() @@ -1016,7 +1016,7 @@ class WacomProtocolSlate(WacomProtocolSpark): self.notify('dimensions') self.get_firmware_version() - self.ec_command() + self.select_transfer_gatt() if self.read_offline_data() == 0: logger.info('no data to retrieve') except WacomEEAGAINException: