samples/net/sockets/can/README.html · samples/net/sockets/can/README.rst 공식 원문 ↗

Zephyr 3.7.0 · Samples · Networking · BSD sockets · CAN

SocketCAN

CAN socket을 network interface에 bind하고 filter를 설치한 뒤 frame을 수신·출력·전송합니다.

Official pathsamples/net/sockets/can/README.html
Source filesamples/net/sockets/can/README.rst
Source versionZephyr 3.7.0
TranslationFull · reviewed

본문 기준: Zephyr 3.7.0 LTS3 · 이후 유지보수 패치는 별도입니다.

Part 1

요약·해설

Setup·receive·send function과 CANBUS board 요구사항, generic·Nucleo build를 보존합니다.

API

BSD sockets

Frames

Raw CAN

Boards

Nucleo · Discovery

Part 2

접을 수 있는 영어 원문 전체

영어 원문 전체 펼치기
원문 SHA-256 600FBF59AA81DBF900FF484C9909720C9BF7DFB65EE7590FCBD89DDF29F84979
.. zephyr:code-sample:: socket-can
   :name: SocketCAN
   :relevant-api: bsd_sockets socket_can

   Send and receive raw CAN frames using BSD sockets API.

Overview
********

The socket CAN sample is a server/client application that sends and receives
raw CAN frames using BSD socket API.

The application consists of these functions:

* Setup function which creates a CAN socket, binds it to a CAN network
  interface, and then installs a CAN filter to the socket so that the
  application can receive CAN frames.
* Receive function which starts to listen the CAN socket and prints
  information about the CAN frames.
* Send function which starts to send raw CAN frames to the bus.

The source code for this sample application can be found at:
:zephyr_file:`samples/net/sockets/can`.

Requirements
************

You need a CANBUS enabled board like :ref:`nucleo_l432kc_board` or
:ref:`stm32f072b_disco_board`.

Building and Running
********************

Build the socket CAN sample application like this:

.. zephyr-app-commands::
   :zephyr-app: samples/net/sockets/can
   :board: <board to use>
   :conf: <config file to use>
   :goals: build
   :compact:

Example building for the nucleo_l432kc:

.. zephyr-app-commands::
   :zephyr-app: samples/net/sockets/can
   :host-os: unix
   :board: nucleo_l432kc
   :goals: run
   :compact:

Part 3

한국어 전문 번역

개요

Socket CAN sample은 BSD socket API를 사용해 raw CAN frame을 송수신하는 server/client application입니다.

Application은 다음 function으로 구성됩니다.

  • Setup function: CAN socket을 만들고 CAN network interface에 bind한 뒤, application이 CAN frame을 받을 수 있도록 socket에 CAN filter를 설치합니다.
  • Receive function: CAN socket 수신을 시작하고 들어온 CAN frame 정보를 출력합니다.
  • Send function: Bus로 raw CAN frame 전송을 시작합니다.

이 sample application의 source code는 samples/net/sockets/can에 있습니다.

요구 사항

CANBUS가 활성화된 board가 필요합니다. 예를 들어 ST Nucleo L432KC 또는 ST STM32F072B Discovery를 사용할 수 있습니다.

빌드 및 실행

Socket CAN sample application은 사용할 board와 configuration file을 지정해 다음처럼 build합니다.

west build -b <board to use> samples/net/sockets/can -- -DCONF_FILE=<config file to use>

nucleo_l432kc용 build·run example은 다음과 같습니다.

west build -b nucleo_l432kc samples/net/sockets/can
west build -t run

Source

출처

영어 원문에는 문단, 문서 지시문, 표, 코드, 코드 심벌, 경로를 그대로 보존했습니다.