1.. zephyr:code-sample:: socket-can 2 :name: SocketCAN 3 :relevant-api: bsd_sockets socket_can 4 5 Send and receive raw CAN frames using BSD sockets API. 6 7Overview 8******** 9 10The socket CAN sample is a server/client application that sends and receives 11raw CAN frames using BSD socket API. 12 13The application consists of these functions: 14 15* Setup function which creates a CAN socket, binds it to a CAN network 16 interface, and then installs a CAN filter to the socket so that the 17 application can receive CAN frames. 18* Receive function which starts to listen the CAN socket and prints 19 information about the CAN frames. 20* Send function which starts to send raw CAN frames to the bus. 21 22The source code for this sample application can be found at: 23:zephyr_file:`samples/net/sockets/can`. 24 25Requirements 26************ 27 28You need a CANBUS enabled board like :zephyr:board:`nucleo_l432kc` or 29:zephyr:board:`stm32f072b_disco`. 30 31Building and Running 32******************** 33 34Build the socket CAN sample application like this: 35 36.. zephyr-app-commands:: 37 :zephyr-app: samples/net/sockets/can 38 :board: <board to use> 39 :conf: <config file to use> 40 :goals: build 41 :compact: 42 43Example building for the nucleo_l432kc: 44 45.. zephyr-app-commands:: 46 :zephyr-app: samples/net/sockets/can 47 :host-os: unix 48 :board: nucleo_l432kc 49 :goals: run 50 :compact: 51