Loading...
Searching...
No Matches
candev_linux.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2016 OTA keys S.A.
3 *
4 * This file is subject to the terms and conditions of the GNU Lesser
5 * General Public License v2.1. See the file LICENSE in the top level
6 * directory for more details.
7 */
8
23#ifndef CANDEV_LINUX_H
24#define CANDEV_LINUX_H
25
26#ifdef __cplusplus
27extern "C" {
28#endif
29
30#if defined(__linux__) /* SocketCAN is supported only on Linux */ || defined(DOXYGEN)
31
32#include <stdbool.h>
33
34#include "can/device.h"
35#include "can/candev.h"
36#include "mutex.h"
37
41#define CAN_MAX_SIZE_INTERFACE_NAME (5)
42
50
52#define HAVE_CAN_CONF_T
53
54#ifndef CANDEV_LINUX_MAX_FILTERS_RX
58#define CANDEV_LINUX_MAX_FILTERS_RX (16)
59#endif
60
61#ifndef CANDEV_LINUX_DEFAULT_BITRATE
65#define CANDEV_LINUX_DEFAULT_BITRATE (500000)
66#endif
67
68#ifndef CANDEV_LINUX_DEFAULT_SPT
72#define CANDEV_LINUX_DEFAULT_SPT (875)
73#endif
74
85
87#define HAVE_CAN_T
88
93
94#endif /* defined(__linux__) */
95
96#ifdef __cplusplus
97}
98#endif
99
100#endif /* CANDEV_LINUX_H */
Definitions for low-level CAN driver interface.
#define CAN_MAX_SIZE_INTERFACE_NAME
Maximum size of an interface name.
struct candev_conf can_conf_t
Linux candev configuration.
struct candev_linux can_t
The candev_linux struct.
#define CANDEV_LINUX_MAX_FILTERS_RX
Max number of rx filters which can be set.
Mutex for thread synchronization.
ESP CAN device configuration.
Definition can_esp.h:88
Controller Area Network filter.
Definition can.h:101
Linux candev configuration.
char interface_name[CAN_MAX_SIZE_INTERFACE_NAME+1]
local interface name
The candev_linux struct.
const can_conf_t * conf
device configuration
int sock
local socket id
candev_t candev
candev base structure
struct can_filter filters[CANDEV_LINUX_MAX_FILTERS_RX]
filter list
Structure to hold driver state.
Definition candev.h:77
Definitions of CAN device interface.
#define CAN_DLL_NUMOF
Maximum number of interfaces which can be registered on DLL.
Definition device.h:49