Zephyr API Documentation 4.0.99
A Scalable Open Source RTOS
|
SocketCAN library . More...
Data Structures | |
struct | sockaddr_can |
struct sockaddr_can - The sockaddr structure for CAN sockets More... | |
struct | socketcan_frame |
CAN frame for Linux SocketCAN compatibility. More... | |
struct | socketcan_filter |
CAN filter for Linux SocketCAN compatibility. More... | |
Macros | |
#define | CAN_RAW 1 |
Protocols of the protocol family PF_CAN. | |
#define | SOCKETCAN_MAX_DLEN 8U |
SocketCAN max data length. | |
#define | CAN_MTU (sizeof(struct socketcan_frame)) |
CAN frame MTU. | |
#define | CANFD_BRS 0x01 |
Bit rate switch (second bitrate for payload data) | |
#define | CANFD_ESI 0x02 |
Error state indicator of the transmitting node. | |
#define | CANFD_FDF 0x04 |
Mark CAN FD for dual use of struct canfd_frame. | |
Functions | |
static void | socketcan_to_can_frame (const struct socketcan_frame *sframe, struct can_frame *zframe) |
Translate a socketcan_frame struct to a can_frame struct. | |
static void | socketcan_from_can_frame (const struct can_frame *zframe, struct socketcan_frame *sframe) |
Translate a can_frame struct to a socketcan_frame struct. | |
static void | socketcan_to_can_filter (const struct socketcan_filter *sfilter, struct can_filter *zfilter) |
Translate a socketcan_filter struct to a can_filter struct. | |
static void | socketcan_from_can_filter (const struct can_filter *zfilter, struct socketcan_filter *sfilter) |
Translate a can_filter struct to a socketcan_filter struct. | |
Linux SocketCAN compatibility | |
The following structures and functions provide compatibility with the CAN frame and CAN filter formats used by Linux SocketCAN. | |
typedef uint32_t | socketcan_id_t |
CAN Identifier structure for Linux SocketCAN compatibility. | |
SocketCAN library .
SocketCAN utilities .
#define CAN_MTU (sizeof(struct socketcan_frame)) |
#include <zephyr/net/socketcan.h>
CAN frame MTU.
#define CAN_RAW 1 |
#include <zephyr/net/socketcan.h>
Protocols of the protocol family PF_CAN.
#define CANFD_BRS 0x01 |
#include <zephyr/net/socketcan.h>
Bit rate switch (second bitrate for payload data)
#define CANFD_ESI 0x02 |
#include <zephyr/net/socketcan.h>
Error state indicator of the transmitting node.
#define CANFD_FDF 0x04 |
#include <zephyr/net/socketcan.h>
Mark CAN FD for dual use of struct canfd_frame.
#define SOCKETCAN_MAX_DLEN 8U |
#include <zephyr/net/socketcan.h>
SocketCAN max data length.
typedef uint32_t socketcan_id_t |
#include <zephyr/net/socketcan.h>
CAN Identifier structure for Linux SocketCAN compatibility.
The fields in this type are:
|
inlinestatic |
#include <zephyr/net/socketcan_utils.h>
Translate a can_filter struct to a socketcan_filter struct.
zfilter | Pointer to can_filter struct. |
sfilter | Pointer to socketcan_filter struct. |
|
inlinestatic |
#include <zephyr/net/socketcan_utils.h>
Translate a can_frame struct to a socketcan_frame struct.
zframe | Pointer to can_frame struct. |
sframe | Pointer to socketcan_frame struct. |
< Mark CAN FD for dual use of struct canfd_frame
< Bit rate switch (second bitrate for payload data)
|
inlinestatic |
#include <zephyr/net/socketcan_utils.h>
Translate a socketcan_filter struct to a can_filter struct.
sfilter | Pointer to socketcan_filter struct. |
zfilter | Pointer to can_filter struct. |
|
inlinestatic |
#include <zephyr/net/socketcan_utils.h>
Translate a socketcan_frame struct to a can_frame struct.
sframe | Pointer to sockecan_frame struct. |
zframe | Pointer to can_frame struct. |
< Mark CAN FD for dual use of struct canfd_frame
< Bit rate switch (second bitrate for payload data)