Add simple UDP echo server example
This example used to be considered specific to the CC2538DK platform. However, there was nothing really platform-specific to it. This commit moves the example to the top-level examples directory and documents it.
This commit is contained in:
parent
f50671ce37
commit
d605dc3b82
@ -1 +0,0 @@
|
|||||||
TARGET = cc2538dk
|
|
@ -2,6 +2,6 @@ CONTIKI_PROJECT = udp-echo-server
|
|||||||
|
|
||||||
all: $(CONTIKI_PROJECT)
|
all: $(CONTIKI_PROJECT)
|
||||||
|
|
||||||
CONTIKI = ../../../..
|
CONTIKI = ../..
|
||||||
CFLAGS += -DUIP_CONF_ND6_SEND_NS=1
|
|
||||||
include $(CONTIKI)/Makefile.include
|
include $(CONTIKI)/Makefile.include
|
14
examples/udp-echo-server/README.md
Normal file
14
examples/udp-echo-server/README.md
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
UDP echo server example
|
||||||
|
=======================
|
||||||
|
This example demonstrates how to implement a simple UDP-server by
|
||||||
|
using the original UDP API (as opposed to using the simple-udp module).
|
||||||
|
|
||||||
|
It is anticipated that this example will run on all supported platforms.
|
||||||
|
|
||||||
|
To test, compile and programme your device (or execute on the native
|
||||||
|
platform). Then you can use netcat, like so:
|
||||||
|
|
||||||
|
$ nc -6u <your device's IPv6 address> 3000
|
||||||
|
|
||||||
|
Type something in your console and you should see it echoed back by the
|
||||||
|
UDP server running on your device.
|
@ -28,18 +28,7 @@
|
|||||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
||||||
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
/** \addtogroup cc2538-examples
|
/*---------------------------------------------------------------------------*/
|
||||||
* @{
|
|
||||||
*
|
|
||||||
* \defgroup cc2538-echo-server cc2538dk UDP Echo Server Project
|
|
||||||
*
|
|
||||||
* Tests that a node can correctly join an RPL network and also tests UDP
|
|
||||||
* functionality
|
|
||||||
* @{
|
|
||||||
*
|
|
||||||
* \file
|
|
||||||
* An example of a simple UDP echo server for the cc2538dk platform
|
|
||||||
*/
|
|
||||||
#include "contiki.h"
|
#include "contiki.h"
|
||||||
#include "contiki-lib.h"
|
#include "contiki-lib.h"
|
||||||
#include "contiki-net.h"
|
#include "contiki-net.h"
|
||||||
@ -107,7 +96,3 @@ PROCESS_THREAD(udp_echo_server_process, ev, data)
|
|||||||
PROCESS_END();
|
PROCESS_END();
|
||||||
}
|
}
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
/**
|
|
||||||
* @}
|
|
||||||
* @}
|
|
||||||
*/
|
|
@ -16,7 +16,7 @@ ipv6/rpl-border-router/cc2538dk \
|
|||||||
ipv6/rpl-udp/cc2538dk \
|
ipv6/rpl-udp/cc2538dk \
|
||||||
ipv6/coap-example/cc2538dk \
|
ipv6/coap-example/cc2538dk \
|
||||||
ipso-objects/cc2538dk \
|
ipso-objects/cc2538dk \
|
||||||
platform-specific/cc2538dk/udp-ipv6-echo-server/cc2538dk \
|
udp-echo-server/cc2538dk \
|
||||||
ipv6/multicast/cc2538dk \
|
ipv6/multicast/cc2538dk \
|
||||||
platform-specific/cc2538-common/cc2538dk \
|
platform-specific/cc2538-common/cc2538dk \
|
||||||
platform-specific/cc2538-common/mqtt-demo/cc2538dk \
|
platform-specific/cc2538-common/mqtt-demo/cc2538dk \
|
||||||
|
Loading…
Reference in New Issue
Block a user