protocol: 0xec is simply the GATT selection for file transfers

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
pull/153/head
Peter Hutterer 2019-08-12 14:10:54 +10:00
parent c39c20ede2
commit 73bc782a53
2 changed files with 11 additions and 7 deletions

View File

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

View File

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