protocol: on the spark treat a general error during connect as wrong uuid
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
7a121cfe6c
commit
f21af42131
|
@ -602,7 +602,13 @@ class MsgConnectSpark(Msg):
|
|||
if len(self.args) != 6:
|
||||
raise ValueError('UUID must be 6 bytes long')
|
||||
|
||||
# uses the default 0xb3 handler
|
||||
def _handle_reply(self, reply):
|
||||
try:
|
||||
super()._handle_reply(reply)
|
||||
except DeviceError as e:
|
||||
if e.errorcode == DeviceError.ErrorCode.GENERAL_ERROR:
|
||||
raise AuthorizationError()
|
||||
raise e
|
||||
|
||||
|
||||
class MsgGetName(Msg):
|
||||
|
|
|
@ -395,12 +395,9 @@ class WacomRegisterHelper(WacomProtocolLowLevelComm):
|
|||
# expected
|
||||
try:
|
||||
self.p.execute(Interactions.CONNECT, uuid)
|
||||
except tuhi.protocol.DeviceError as e:
|
||||
if e.errorcode == tuhi.protocol.DeviceError.ErrorCode.GENERAL_ERROR:
|
||||
# this is expected
|
||||
pass
|
||||
else:
|
||||
raise e
|
||||
except AuthorizationError:
|
||||
# this is expected
|
||||
pass
|
||||
|
||||
# The "press button now command" on the spark
|
||||
self.p.execute(Interactions.REGISTER_PRESS_BUTTON)
|
||||
|
|
Loading…
Reference in New Issue