Skip to content

Commit

Permalink
fix for emsec#16
Browse files Browse the repository at this point in the history
  • Loading branch information
root authored and root committed Oct 8, 2016
1 parent bca913c commit 8ece4f7
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion Software/Chameleon/Device.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,19 @@ def writeCmd(self, cmd):
result = {'statusCode': statusCode, 'statusText': statusText, 'response': None}

if (statusCode == self.STATUS_CODE_OK_WITH_TEXT):
result['response'] = self.readResponse()
if cmd == "VERSION?":
multi_lines = []
while True:
line = self.serial.readline().decode('ascii').rstrip()
multi_lines.append(line)
timeout = time.time() + 0.1
while not self.serial.inWaiting() and timeout > time.time():
pass
if not self.serial.inWaiting():
break
result['response'] = '\n'.join(multi_lines)
else:
result['response'] = self.readResponse()
elif (statusCode == self.STATUS_CODE_TRUE):
result['response'] = True
elif (statusCode == self.STATUS_CODE_FALSE):
Expand Down

0 comments on commit 8ece4f7

Please sign in to comment.