diff --git a/Software/Chameleon/Device.py b/Software/Chameleon/Device.py index 1852cf0..bfe2267 100644 --- a/Software/Chameleon/Device.py +++ b/Software/Chameleon/Device.py @@ -251,4 +251,7 @@ class Device: return self.getSetCmd(self.COMMAND_THRESHOLD, value) def cmdUpgrade(self): - return self.execCmd(self.COMMAND_UPGRADE) \ No newline at end of file + # Execute command + cmdLine = self.COMMAND_UPGRADE + self.LINE_ENDING + self.serial.write(cmdLine.encode('ascii')) + return 0 diff --git a/Software/chamtool.py b/Software/chamtool.py index 8d7febc..aff659c 100755 --- a/Software/chamtool.py +++ b/Software/chamtool.py @@ -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,