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:
|
if len(self.args) != 6:
|
||||||
raise ValueError('UUID must be 6 bytes long')
|
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):
|
class MsgGetName(Msg):
|
||||||
|
|
|
@ -395,12 +395,9 @@ class WacomRegisterHelper(WacomProtocolLowLevelComm):
|
||||||
# expected
|
# expected
|
||||||
try:
|
try:
|
||||||
self.p.execute(Interactions.CONNECT, uuid)
|
self.p.execute(Interactions.CONNECT, uuid)
|
||||||
except tuhi.protocol.DeviceError as e:
|
except AuthorizationError:
|
||||||
if e.errorcode == tuhi.protocol.DeviceError.ErrorCode.GENERAL_ERROR:
|
# this is expected
|
||||||
# this is expected
|
pass
|
||||||
pass
|
|
||||||
else:
|
|
||||||
raise e
|
|
||||||
|
|
||||||
# The "press button now command" on the spark
|
# The "press button now command" on the spark
|
||||||
self.p.execute(Interactions.REGISTER_PRESS_BUTTON)
|
self.p.execute(Interactions.REGISTER_PRESS_BUTTON)
|
||||||
|
|
Loading…
Reference in New Issue