Part 1
요약·해설
Multicast URI, QEMU·native_sim 실행 조건과 76-byte response sample을 정확히 보존합니다.
GET
ff02::fd
5683
Part 2
접을 수 있는 영어 원문 전체
영어 원문 전체 펼치기
8C55B0665BF5FE9F04263C7AF37270D56F439D793494D7BDEBBB3A3C54F66E45
.. zephyr:code-sample:: coap-client
:name: CoAP client
:relevant-api: coap udp
Use the CoAP library to implement a client that fetches a resource.
Overview
********
This sample is a simple CoAP client showing how to retrieve information
from a resource.
This demo assumes that the platform of choice has networking support,
some adjustments to the configuration may be needed.
This sample will make a GET request with path 'test' to the IPv6
multicast address reserved for CoAP nodes, so the URI can be
represented as:
.. code-block:: none
coap://[ff02::fd]:5683/test
Building and Running
********************
This project will print all the octets of the response received, more context can
be obtained by using a 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`.
Sample output
=============
.. code-block:: console
reply: 60 00 00 00 00 24 11 40 fe 80 00 00 00 00 00 00 5c 25 e2 ff fe
15 01 01 fe 80 00 00 00 00 00 00 5c 25 e2 ff fe 15 01 01 16 33 16 33
00 24 3d 86 60 40 00 01 ff 54 79 70 65 3a 20 30 0a 43 6f 64 65 3a 20
31 0a 4d 49 44 3a 20 31 0a (76 bytes)
.. note: The values shown above might differ.
.. _`net-tools`: https://github.com/zephyrproject-rtos/net-tools
Part 3
한국어 전문 번역
개요
이 sample은 resource에서 정보를 가져오는 방법을 보여 주는 간단한 CoAP client입니다.
선택한 platform이 networking을 지원한다고 가정하며, 필요에 따라 configuration을 조정해야 할 수 있습니다.
Sample은 CoAP node용으로 예약된 IPv6 multicast address에 path test를 지정한 GET request를 보냅니다. URI는 다음과 같이 표현할 수 있습니다.
coap://[ff02::fd]:5683/test
빌드 및 실행
이 project는 받은 response의 모든 octet을 출력합니다. 더 많은 context가 필요하면 tcpdump나 Wireshark 같은 tool로 packet을 관찰할 수 있습니다.
net-tools project에서 자세한 내용을 확인할 수 있습니다.
Host system과 networking 문서에 설명된 방식으로 QEMU 또는 native_sim board에서 이 sample을 build하고 실행할 수 있습니다.
Sample 출력
reply: 60 00 00 00 00 24 11 40 fe 80 00 00 00 00 00 00 5c 25 e2 ff fe
15 01 01 fe 80 00 00 00 00 00 00 5c 25 e2 ff fe 15 01 01 16 33 16 33
00 24 3d 86 60 40 00 01 ff 54 79 70 65 3a 20 30 0a 43 6f 64 65 3a 20
31 0a 4d 49 44 3a 20 31 0a (76 bytes)
Source
출처
영어 원문에는 문단, 문서 지시문, 표, 코드, 코드 심벌, 경로를 그대로 보존했습니다.