Generic UDP shell command for any supported network stack.
Generic UDP shell command for any supported network stack.
This command can be used with any network stack in RIOT that offers a UDP sock API interface. Examples include Generic (GNRC) network stack and lwIP network stack.
Module. Add USEMODULE += shell_cmd_udp to your application Makefile.
It is automatically selected with USEMODULE += sys_shell_cmds_default if UDP sock API (USEMODULE += sock_udp) is available in your build.
Send <num> UDP datagrams to <addr>:<port> at the interval specified in <delay> (in microseconds). If the optional parameter -b is given, <data> is interpreted as hexadecimal digits, otherwise <data> is interpreted as a text string.
<num> and <delay> are only supported if ztimer high level timer abstraction layer is available (e.g., via USEMODULE += ztimer_usec or USEMODULE += ztimer_msec).
Note that the shell buffer size may limit the input length (SHELL_DEFAULT_BUFSIZE defaults to 128 bytes).
Module. Add USEMODULE += shell_cmd_udp_server to your application Makefile.
Start a UDP server listening on <port> on any interface in a separate thread.
Stop running the UDP server that was started with udp server start.