diff --git a/doc/source/documentation.rst b/doc/source/documentation.rst index 9036b524..3562e85c 100644 --- a/doc/source/documentation.rst +++ b/doc/source/documentation.rst @@ -159,8 +159,7 @@ components locally. Once leshan and Zephyr are running, the Zephyr application can be started in emulation with the following command: .. code-block:: console - - host:lwm2m_server/server$ zephyr_build_run_sim.sh + host:lwm2m_server$ zephyr_build_run_sim.sh *** Booting nRF Connect SDK zephyr-v3.5.0-3024-g7c3e830729b7 *** [00:00:00.000,000] net_lwm2m_engine: lwm2m_engine_init: LWM2M engine socket receive thread started diff --git a/server/zephyr_build_run.sh b/server/zephyr_build_run.sh deleted file mode 100755 index 7248e7c6..00000000 --- a/server/zephyr_build_run.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash - -## Build and run Zephyr -cd ../ -#west build -b qemu_x86 fw_test/lwm2m_client -p -- -DCONF=overlay-lwm2m-1.1.conf -west build -t run diff --git a/server/zephyr_build_run_sim.sh b/server/zephyr_build_run_sim.sh deleted file mode 100755 index 25469f3f..00000000 --- a/server/zephyr_build_run_sim.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash -# -# Start networking via net-tools -../../tools/net-tools/net-setup.sh & - -## Build and run Zephyr -west build -b qemu_x86 ../../zephyr/samples/net/lwm2m_client -- -DCONF=overlay-lwm2m-1.1.conf -west build -t run diff --git a/zephyr_build_run.sh b/zephyr_build_run.sh new file mode 100755 index 00000000..6b46c303 --- /dev/null +++ b/zephyr_build_run.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +## Build and run Zephyr +west build -p=auto -b qemu_x86 fw_test/lwm2m_client -p -- -DCONF=overlay-lwm2m-1.1.conf +west build -t run diff --git a/zephyr_build_run_sim.sh b/zephyr_build_run_sim.sh new file mode 100755 index 00000000..5d407692 --- /dev/null +++ b/zephyr_build_run_sim.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +# Function to stop networking +cleanup() { + ../tools/net-tools/net-setup.sh stop +} + +# Register the cleanup function to be called on the EXIT signal +trap cleanup EXIT + +# Start networking via net-tools +../tools/net-tools/net-setup.sh start + +## Build and run Zephyr +west build -p=auto -b qemu_x86 ../zephyr/samples/net/lwm2m_client -- -DCONF=overlay-lwm2m-1.1.conf +west build -t run + +cleanup