Skip to content

Commit

Permalink
Merge pull request #31 from kb1lqc/issue29
Browse files Browse the repository at this point in the history
Add IP and MTU Command Line Interface Options
  • Loading branch information
kb1lqc authored Mar 11, 2018
2 parents bbae925 + 684b2b7 commit 1cac7a2
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 4 deletions.
12 changes: 10 additions & 2 deletions faradayio_cli/faradayio_cli.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""faradayio-cli.faradayio-cli: provides entry point main()."""

__version__ = "0.0.3"
__version__ = "0.0.4"

import argparse
import serial
Expand Down Expand Up @@ -29,8 +29,12 @@ def setupArgparse():
parser.add_argument("id", type=int, help="ID number radio")

# Optional arguments
parser.add_argument("-i", "--addr", default="10.0.0.1",
help="Set IP Address of TUN adapter (Farday Radio)")
parser.add_argument("-l", "--loopback", action="store_true",
help="Use software loopback serial port")
parser.add_argument("-m", "--mtu", default=1500,
help="Set Maximum Transmission Unit (MTU)")
parser.add_argument("-p", "--port", default="/dev/ttyUSB0",
help="Physical serial port of radio")

Expand Down Expand Up @@ -96,7 +100,11 @@ def main():

# Setup TUN adapter and start
try:
tun = Monitor(serialPort=serialPort, name=tunName, isRunning=isRunning)
tun = Monitor(serialPort=serialPort,
name=tunName,
isRunning=isRunning,
addr=args.addr,
mtu=int(args.mtu))
tun.start()

except pytun.Error as error:
Expand Down
13 changes: 12 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,15 +1,26 @@
attrs==17.4.0
faradayio==0.0.3
certifi==2018.1.18
chardet==3.0.4
coverage==4.5.1
coveralls==1.2.0
docopt==0.6.2
faradayio==0.0.4
faradayio-cli==0.0.4
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.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
timeout-decorator==0.4.0
urllib3==1.22
13 changes: 12 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,31 @@
packages=['faradayio_cli'],
install_requires=[
'attrs==17.4.0',
'faradayio==0.0.3',
'certifi==2018.1.18',
'chardet==3.0.4',
'coverage==4.5.1',
'coveralls==1.2.0',
'docopt==0.6.2',
'faradayio==0.0.4',
'faradayio-cli==0.0.4',
'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.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',
'timeout-decorator==0.4.0',
'urllib3==1.22',
],
entry_points={
"console_scripts": ['faradayio-cli = faradayio_cli.faradayio_cli:main']
Expand Down

0 comments on commit 1cac7a2

Please sign in to comment.