README.rst
1.. zephyr:code-sample:: coap-server
2 :name: CoAP server
3 :relevant-api: coap udp
4
5 Use the CoAP library to implement a server that exposes CoAP resources.
6
7Overview
8********
9
10This sample is a simple CoAP server showing how to expose a simple resource.
11
12This demo assumes that the platform of choice has networking support,
13some adjustments to the configuration may be needed.
14
15The sample will listen for requests in the CoAP UDP port (5683) in the
16site-local IPv6 multicast address reserved for CoAP nodes.
17
18The sample exports the following resources:
19
20.. code-block:: none
21
22 /test
23 /seg1/seg2/seg3
24 /query
25 /separate
26 /large
27 /location-query
28 /large-update
29
30These resources allow a good part of the ETSI test cases to be run
31against coap-server.
32
33Building And Running
34********************
35
36This project has no output in case of success, the correct
37functionality can be verified by using some external tool such as tcpdump
38or wireshark.
39
40See the `net-tools`_ project for more details
41
42This sample can be built and executed on QEMU or native_posix board as
43described in :ref:`networking_with_host`.
44
45Use this command on the host to run the `libcoap`_ implementation of
46the ETSI test cases:
47
48.. code-block:: console
49
50 sudo ./examples/etsi_coaptest.sh -i tap0 2001:db8::1
51
52To build the version supporting the TI CC2520 radio, use the supplied
53prj_cc2520.conf configuration file enabling IEEE 802.15.4.
54
55.. _`net-tools`: https://github.com/zephyrproject-rtos/net-tools
56
57.. _`libcoap`: https://github.com/obgm/libcoap
58