Zephyr Project API 3.7.0
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 <include/zephyr/net/socketcan.h>
CAN frame MTU.
#define CAN_RAW 1 |
#include <include/zephyr/net/socketcan.h>
Protocols of the protocol family PF_CAN.
#define CANFD_BRS 0x01 |
#include <include/zephyr/net/socketcan.h>
Bit rate switch (second bitrate for payload data)
#define CANFD_ESI 0x02 |
#include <include/zephyr/net/socketcan.h>
Error state indicator of the transmitting node.
#define CANFD_FDF 0x04 |
#include <include/zephyr/net/socketcan.h>
Mark CAN FD for dual use of struct canfd_frame.
#define SOCKETCAN_MAX_DLEN 8U |
#include <include/zephyr/net/socketcan.h>
SocketCAN max data length.
typedef uint32_t socketcan_id_t |
#include <include/zephyr/net/socketcan.h>
CAN Identifier structure for Linux SocketCAN compatibility.
The fields in this type are:
|
inlinestatic |
#include <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 <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. |
|
inlinestatic |
#include <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 <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. |