Part 1
요약·해설
7개 resource path, linker file 조건, libcoap ETSI test와 CC2520 configuration을 보존합니다.
7 paths
Compile-time sections
ETSI · libcoap
Part 2
접을 수 있는 영어 원문 전체
영어 원문 전체 펼치기
55A94DC3841A4D3A83CD64DC4810A3CF84035595590EAB47AB30A900160FACBC
.. zephyr:code-sample:: coap-server
:name: CoAP service
:relevant-api: coap coap_service udp
Use the CoAP server subsystem to register CoAP resources.
Overview
********
This sample shows how to register CoAP resources to a main CoAP service.
The CoAP server implementation expects all services and resources to be
available at compile time, as they are put into dedicated sections.
The resource is placed into the correct linker section based on the owning
service's name. A linker file is required, see ``sections-ram.ld`` for an example.
This demo assumes that the platform of choice has networking support,
some adjustments to the configuration may be needed.
The sample will listen for requests in the CoAP UDP port (5683) in the
site-local IPv6 multicast address reserved for CoAP nodes.
The sample exports the following resources:
.. code-block:: none
/test
/seg1/seg2/seg3
/query
/separate
/large
/location-query
/large-update
These resources allow a good part of the ETSI test cases to be run
against coap-server.
Building And Running
********************
This project has no output in case of success, the correct
functionality can be verified by using some external tool such as tcpdump
or wireshark.
See the `net-tools`_ project for more details
This sample can be built and executed on QEMU or native_sim board as
described in :ref:`networking_with_host`.
Use this command on the host to run the `libcoap`_ implementation of
the ETSI test cases:
.. code-block:: console
sudo ./examples/etsi_coaptest.sh -i tap0 2001:db8::1
To build the version supporting the TI CC2520 radio, use the supplied
prj_cc2520.conf configuration file enabling IEEE 802.15.4.
.. _`net-tools`: https://github.com/zephyrproject-rtos/net-tools
.. _`libcoap`: https://github.com/obgm/libcoap
Part 3
한국어 전문 번역
개요
이 sample은 main CoAP service에 CoAP resource를 등록하는 방법을 보여 줍니다. CoAP server implementation은 service와 resource가 전용 section에 배치되므로 모두 compile time에 존재할 것으로 가정합니다.
Resource는 자신을 소유한 service 이름에 따라 올바른 linker section에 배치됩니다. Linker file이 필요하며 sections-ram.ld를 example로 참조할 수 있습니다.
선택한 platform이 networking을 지원한다고 가정하며, 필요에 따라 configuration을 조정해야 할 수 있습니다.
Sample은 CoAP node용으로 예약된 site-local IPv6 multicast address에서 CoAP UDP port 5683으로 들어오는 request를 수신합니다.
Sample은 다음 resource를 export합니다.
/test
/seg1/seg2/seg3
/query
/separate
/large
/location-query
/large-update
이 resource를 사용하면 ETSI test case의 상당 부분을 coap-server에 대해 실행할 수 있습니다.
빌드 및 실행
이 project는 성공한 경우 output을 내지 않습니다. tcpdump나 Wireshark 같은 external tool로 올바른 동작을 검증할 수 있습니다.
net-tools project에서 자세한 내용을 확인할 수 있습니다.
Host system과 networking 문서에 설명된 방식으로 QEMU 또는 native_sim board에서 이 sample을 build하고 실행할 수 있습니다.
Host에서 libcoap implementation의 ETSI test case를 실행하려면 다음 명령을 사용합니다.
sudo ./examples/etsi_coaptest.sh -i tap0 2001:db8::1
TI CC2520 radio를 지원하는 version을 build하려면 IEEE 802.15.4를 활성화하는 제공된 prj_cc2520.conf configuration file을 사용합니다.
libcoap project에서 test implementation을 확인할 수 있습니다.
Source
출처
영어 원문에는 문단, 문서 지시문, 표, 코드, 코드 심벌, 경로를 그대로 보존했습니다.