From 958fdef8ca52460435f3d3bc4262f668d0501c8d Mon Sep 17 00:00:00 2001 From: Jed Reynolds Date: Wed, 3 Jun 2020 10:40:13 -0700 Subject: [PATCH] sta_connect_example.py, __init__.py: added example driver --- py-scripts/__init__.py | 0 py-scripts/sta_connect_example.py | 34 +++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 py-scripts/__init__.py create mode 100755 py-scripts/sta_connect_example.py diff --git a/py-scripts/__init__.py b/py-scripts/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/py-scripts/sta_connect_example.py b/py-scripts/sta_connect_example.py new file mode 100755 index 00000000..65cfbe37 --- /dev/null +++ b/py-scripts/sta_connect_example.py @@ -0,0 +1,34 @@ +#!/usr/bin/env python3 + +# Example of how to instantiate StaConnect and run the test + +import sys +if sys.version_info[0] != 3: + print("This script requires Python 3") + exit(1) +if 'py-json' not in sys.path: + sys.path.append('../py-json') + +from LANforge.LFUtils import * +# if you lack __init__.py in this directory you will not find sta_connect module +import sta_connect +from sta_connect import StaConnect + +def main(): + staConnect = StaConnect("localhost", 8080) + staConnect.sta_mode = 0 + staConnect.upstream_resource = 1 + staConnect.upstream_port = "eth1" + staConnect.radio = "wiphy0" + staConnect.resource = 1 + staConnect.dut_ssid = "jedway-wpa2-x2048-5-1" + staConnect.dut_passwd = "jedway-wpa2-x2048-5-1" + staConnect.run() + +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + +if __name__ == '__main__': + main() + +#