Skip to content

Commit

Permalink
added gateway_list_file parameter in example_otap.py
Browse files Browse the repository at this point in the history
  • Loading branch information
vg-wp committed Jan 17, 2024
1 parent 0189d74 commit 6659527
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion examples/example_otap.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@
type=str,
nargs='+',
help="Gateway list to use. If specified, the OTAP will be performed on given Gateway IDs",
default=[])
parser.add_argument("--gateway_list_file",
type=argparse.FileType('r'),
help="Path to the gateway list file to use. If specified, the OTAP will be performed on given Gateway IDs",
default=None)
args = parser.parse_args()

Expand All @@ -56,10 +60,21 @@
if args.network is None:
print("No network address provided")
exit()

gateway_id_list = args.gateway

if args.gateway_list_file is not None:
with args.gateway_list_file as file:
for line in file:
line = line.strip()
gateway_id_list.append(line)

if gateway_id_list == []:
gateway_id_list = None

otapHelper = WirepasOtapHelper(wni,
args.network,
args.gateway)
gateway_id_list)

if args.cmd == "update_delay":
delay = wmm.ProcessingDelay.DELAY_THIRTY_MINUTES
Expand Down

0 comments on commit 6659527

Please sign in to comment.