From b60dab00bc265906f9c31e845fd1d9586c8b5a04 Mon Sep 17 00:00:00 2001 From: Emanuele De Donatis Date: Tue, 11 May 2021 17:14:02 +0200 Subject: [PATCH] Add stationsim --- examples/simulation/README.md | 1 + examples/simulation/makefile | 3 +++ examples/simulation/sim.py | 5 +++++ 3 files changed, 9 insertions(+) diff --git a/examples/simulation/README.md b/examples/simulation/README.md index a34f8d4..39ff615 100644 --- a/examples/simulation/README.md +++ b/examples/simulation/README.md @@ -50,4 +50,5 @@ The simulation example is controlled via a makefile with multiple targets: * `make station`: Build the `testsim` station variant which provides a Unix domain socket adapter to the lgw API * `make sim`: Run the simulation in a single process. Log output of all components is interleaved in one terminal * `make tmux`: Run the simulation in multiple processes inside different panes of a tmux split window. +* `make stationsim`: Start a basic station that generates an uplink every 10 seconds. Edit `tc.uri` with the LNS endpoint. * `make clean`: Clean local directory of temporary files diff --git a/examples/simulation/makefile b/examples/simulation/makefile index 51da284..2440f5b 100644 --- a/examples/simulation/makefile +++ b/examples/simulation/makefile @@ -36,6 +36,9 @@ station: sim: station PATH=${TD}/build-${platform}-${variant}/bin:${PATH} python sim.py +stationsim: station + PATH=${TD}/build-${platform}-${variant}/bin:${PATH} python sim.py stationsim + tmux: station @if [ -z "${TMUX}" ]; then \ echo "Starting new tmux session" ; \ diff --git a/examples/simulation/sim.py b/examples/simulation/sim.py index 07de890..de9e3d8 100644 --- a/examples/simulation/sim.py +++ b/examples/simulation/sim.py @@ -147,11 +147,16 @@ async def start_test(): await start_sim() await start_station() +async def start_stationsim(): + await start_lgwsim() + await start_station() + func = None if len(sys.argv) > 1: func = { 'tc': start_tcsim, 'lgwsim': start_lgwsim, + 'stationsim': start_stationsim, 'sim': start_sim, 'station': start_station }.get(sys.argv[1], None)