主要内容

About SocketCAN Blocks in Real-Time Linux Support Package

R2026b

The SocketCAN package is an implementation of CAN protocols (Controller Area Network) for Linux. CAN is a networking technology which has widespread use in automation, embedded devices, and automotive fields.

SocketCAN uses the Berkeley socket API, the Linux network stack and implements the CAN device drivers as network interfaces. A device driver for CAN controller hardware registers itself with the Linux network layer as a network device, so that CAN frames from the controller can be passed up to the network layer and on to the CAN protocol family module and also vice-versa.

There have been CAN implementations, but conventional implementations come as a device driver for CAN hardware, they are based on character devices. Usually, there is only a hardware-specific device driver which provides a character device interface to send and receive raw CAN frames, directly to/from the controller hardware.

For more information, see SocketCAN - Controller Area Network at https://docs.kernel.org/.

The table lists the SocketCAN capabilities that are provided by the CAN Receive and CAN Transmit blocks available in the support package.

SocketCAN Capabilities

Availability in

Real-Time Linux Support Package

Simulation support

No

Remote code generation support

Yes

Configure message filter/mask for CAN receiver

No

Configure CAN bus speed

Done by user separately

CAN interface setup on hardware

No. Done by user separately

CANFD support

No

I/O format

Raw bits

CAN_MESSAGE bus