feat: 支持 piico 设备国密加密

This commit is contained in:
Aaron3S
2022-08-23 17:40:01 +08:00
parent 60cb1f8136
commit 8772cd8c71
11 changed files with 450 additions and 2 deletions

View File

@@ -0,0 +1,12 @@
class PiicoError(Exception):
def __init__(self, msg, ret):
super().__init__(self)
self.__ret = ret
self.__msg = msg
def __str__(self):
return "piico error: {} return code: {}".format(self.__msg, self.hex_ret(self.__ret))
@staticmethod
def hex_ret(ret):
return hex(ret & ((1 << 32) - 1))