Skip to content

Commit

Permalink
Merge pull request #63 from kb1lqc/issue62
Browse files Browse the repository at this point in the history
Catch SlipLib Exception Per #62
  • Loading branch information
kb1lqc authored Mar 9, 2018
2 parents f7fc220 + a921319 commit dcb270a
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 8 deletions.
11 changes: 10 additions & 1 deletion faradayio/faraday.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ def send(self, msg):
slipDriver = sliplib.Driver()

# Package data in slip format
# TODO: Unit test this!
slipData = slipDriver.send(msg)

# Send data over serial port
Expand Down Expand Up @@ -77,7 +78,15 @@ def receive(self, length):
ret = self._serialPort.read(length)

# Decode data from slip format, stores msgs in sliplib.Driver.messages
temp = slipDriver.receive(ret)
try:
temp = slipDriver.receive(ret)
except sliplib.slip.ProtocolError as error:
print("SLIP decode error...")
print(error)
# Return empty list,
# TODO: Unit test this!
return []

return iter(temp)


Expand Down
13 changes: 10 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,17 +1,24 @@
attrs==17.4.0
certifi==2018.1.18
chardet==3.0.4
coverage==4.5.1
coveralls==1.2.0
docopt==0.6.2
flake8==3.5.0
idna==2.6
mccabe==0.6.1
pluggy==0.6.0
py==1.5.2
pycodestyle==2.3.1
pyflakes==1.6.0
pyserial==3.4
pytest==3.3.2
pytest==3.4.1
pytest-cov==2.5.1
python-pytun==2.2.1
requests==2.18.4
scapy-python3==0.23
six==1.11.0
sliplib==0.3.0
sphinx-rtd-theme==0.2.4
coveralls==1.2.0
pytest-cov==2.5.1
timeout-decorator==0.4.0
urllib3==1.22
15 changes: 11 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,31 @@
packages=['faradayio'],
install_requires=[
'attrs==17.4.0',
'certifi==2018.1.18',
'chardet==3.0.4',
'coverage==4.5.1',
'coveralls==1.2.0',
'docopt==0.6.2',
'flake8==3.5.0',
'idna==2.6',
'mccabe==0.6.1',
'pluggy==0.6.0',
'py==1.5.2',
'pycodestyle==2.3.1',
'pyflakes==1.6.0',
'pyserial==3.4',
'pytest==3.3.2',
'pytest==3.4.1',
'pytest-cov==2.5.1',
'python-pytun==2.2.1',
'requests==2.18.4',
'scapy-python3==0.23',
'six==1.11.0',
'sliplib==0.3.0',
'sphinx-rtd-theme==0.2.4',
'coveralls==1.2.0',
'pytest-cov==2.5.1',
'timeout-decorator==0.4.0',
'urllib3==1.22',
],
version='0.0.2a',
version='0.0.4',
description='FaradayRF TUN/TAP adapter',
author='FaradayRF',
author_email='Support@FaradayRF.com',
Expand Down

0 comments on commit dcb270a

Please sign in to comment.