Skip to content

Commit

Permalink
Merge pull request fossasia#75 from CloudyPadmal/development
Browse files Browse the repository at this point in the history
Fixes fossasia#74: Device support for old and new PSLabs
  • Loading branch information
CloudyPadmal authored Apr 9, 2018
2 parents 4a8eade + 483ed32 commit aa3e6e2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions PSL/packet_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ def __init__(self, timeout=1.0, **kwargs):
self.version_string = b''
self.connected = False
self.fd = None
self.expected_version = b'CS'
self.expected_version1 = b'CS'
self.expected_version2 = b'PS'
self.occupiedPorts = set()
self.blockingSocket = None
if 'port' in kwargs:
Expand Down Expand Up @@ -83,7 +84,7 @@ def connectToPort(self, portname):
fd.flush()
fd.setTimeout(1.0)
version = self.get_version(fd)
if version[:len(self.expected_version)] == self.expected_version:
if version[:len(self.expected_version1)] == self.expected_version1 or version[:len(self.expected_version2)] == self.expected_version2:
return fd, version, True

return None, '', False
Expand Down

0 comments on commit aa3e6e2

Please sign in to comment.