mirror of
https://github.com/RfidResearchGroup/ChameleonMini.git
synced 2026-05-12 11:20:37 -07:00
Fix chamtool: upgrade command gives exception
(cherry picked from commit 592b851)
This commit is contained in:
@@ -251,4 +251,7 @@ class Device:
|
||||
return self.getSetCmd(self.COMMAND_THRESHOLD, value)
|
||||
|
||||
def cmdUpgrade(self):
|
||||
return self.execCmd(self.COMMAND_UPGRADE)
|
||||
# Execute command
|
||||
cmdLine = self.COMMAND_UPGRADE + self.LINE_ENDING
|
||||
self.serial.write(cmdLine.encode('ascii'))
|
||||
return 0
|
||||
|
||||
@@ -143,8 +143,10 @@ def cmdThreshold(chameleon, arg):
|
||||
return "Setting threshold failed: {}".format(arg, result['statusText'])
|
||||
|
||||
def cmdUpgrade(chameleon, arg):
|
||||
result = chameleon.cmdUpgrade()
|
||||
return ""
|
||||
if(chameleon.cmdUpgrade() == 0):
|
||||
print ("Device changed into Upgrade Mode")
|
||||
exit(0)
|
||||
|
||||
# Custom class for argparse
|
||||
class CmdListAction(argparse.Action):
|
||||
def __init__(self, option_strings, dest, default=False, required=False,
|
||||
|
||||
Reference in New Issue
Block a user