This commit adds a sample application which demonstrates how to use the new driver and modules. The sample uses power management to turn on the modem, uses network management to wait for L4 connected, then uses DNS to get the IP of the server running the python script found in the server folder, which echoes back data recevied to it. A packet containing psudo random data is then sent to the server, which the echoes it back. To validate the capability of the driver to restart the modem, the modem is restarted, and the packet is sent again. The server is hosted by linode, and uses the domain name test-endpoint.com Signed-off-by: Bjarki Arge Andreasen <baa@trackunit.com>
23 lines
472 B
Python
Executable File
23 lines
472 B
Python
Executable File
# Copyright (c) 2023, Bjarki Arge Andreasen
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
import signal
|
|
from te_udp_echo import TEUDPEcho
|
|
from te_udp_receive import TEUDPReceive
|
|
|
|
udp_echo = TEUDPEcho()
|
|
udp_receive = TEUDPReceive()
|
|
|
|
udp_echo.start()
|
|
udp_receive.start()
|
|
|
|
print("started")
|
|
|
|
def terminate_handler(a, b):
|
|
udp_echo.stop()
|
|
udp_receive.stop()
|
|
print("stopped")
|
|
|
|
signal.signal(signal.SIGTERM, terminate_handler)
|
|
signal.signal(signal.SIGINT, terminate_handler)
|