Go to the documentation of this file.
29 #ifndef CO_EPOLL_INTERFACE_H
30 #define CO_EPOLL_INTERFACE_H
34 #include <sys/epoll.h>
35 #include <sys/eventfd.h>
36 #include <sys/timerfd.h>
109 struct itimerspec tm;
111 struct epoll_event ev;
216 #if ((CO_CONFIG_GTW) & CO_CONFIG_GTW_ASCII) || defined CO_DOXYGEN
221 CO_COMMAND_IF_DISABLED = -100,
222 CO_COMMAND_IF_STDIO = -2,
223 CO_COMMAND_IF_LOCAL_SOCKET = -1,
224 CO_COMMAND_IF_TCP_SOCKET_MIN = 0,
225 CO_COMMAND_IF_TCP_SOCKET_MAX = 0xFFFF
270 char *localSocketPath);
unsigned long int uint32_t
UNSIGNED32 in CANopen (0007h), 32-bit unsigned integer.
Definition: CO_driver.h:155
int epoll_fd
Epoll file descriptor, from CO_epoll_createGtw()
Definition: CO_epoll_interface.h:233
void CO_epoll_processRT(CO_epoll_t *ep, CO_t *co, bool_t realtime)
Process CAN receive and realtime functions.
Definition: CO_epoll_interface.c:304
CO_commandInterface_t
Command interface type for gateway-ascii.
Definition: CO_epoll_interface.h:220
Object for gateway.
Definition: CO_epoll_interface.h:231
CO_ReturnError_t
Return values of some CANopen functions.
Definition: CO_driver.h:488
char * localSocketPath
Path in case of local socket.
Definition: CO_epoll_interface.h:242
int gtwa_fd
Gateway io stream file descriptor.
Definition: CO_epoll_interface.h:246
unsigned char bool_t
Boolean data type for general use.
Definition: CO_driver.h:141
void CO_epoll_processGtw(CO_epoll_gtw_t *epGtw, CO_t *co, CO_epoll_t *ep)
Process CANopen gateway functions.
signed long int int32_t
INTEGER32 in CANopen (0004h), 32-bit signed integer.
Definition: CO_driver.h:147
CO_NMT_reset_cmd_t
Return code from CO_NMT_process() that tells application code what to reset.
Definition: CO_NMT_Heartbeat.h:112
unsigned long long int uint64_t
UNSIGNED64 in CANopen (001Bh), 64-bit unsigned integer.
Definition: CO_driver.h:157
void CO_epoll_wait(CO_epoll_t *ep)
Wait for an epoll event.
Definition: CO_epoll_interface.c:138
void CO_epoll_processMain(CO_epoll_t *ep, CO_t *co, bool_t enableGateway, CO_NMT_reset_cmd_t *reset)
Process CANopen mainline functions.
Definition: CO_epoll_interface.c:286
int timer_fd
Interval timer file descriptor.
Definition: CO_epoll_interface.h:95
int32_t commandInterface
Command interface type or tcp port number, see CO_commandInterface_t.
Definition: CO_epoll_interface.h:236
void CO_epoll_initCANopenMain(CO_epoll_t *ep, CO_t *co)
Initialization of functions in CANopen reset-communication section.
Definition: CO_epoll_interface.c:232
uint32_t timerNext_us
Timer value in microseconds, which can be changed by application and can shorten time of next CO_epol...
Definition: CO_epoll_interface.h:103
uint32_t socketTimeoutTmr_us
Socket timeout timer in microseconds.
Definition: CO_epoll_interface.h:240
bool_t timerEvent
True,if timer event is inside CO_epoll_wait()
Definition: CO_epoll_interface.h:105
Object for epoll, timer and event API.
Definition: CO_epoll_interface.h:89
bool_t epoll_new
true, if new epoll event is necessary to process
Definition: CO_epoll_interface.h:113
CO_ReturnError_t CO_epoll_create(CO_epoll_t *ep, uint32_t timerInterval_us)
Create Linux epoll, timerfd and eventfd.
Definition: CO_epoll_interface.c:63
uint32_t timeDifference_us
Time difference since last CO_epoll_wait() execution in microseconds.
Definition: CO_epoll_interface.h:100
uint32_t socketTimeout_us
Socket timeout in microseconds.
Definition: CO_epoll_interface.h:238
void CO_epoll_close(CO_epoll_t *ep)
Close epoll, timerfd and eventfd.
Definition: CO_epoll_interface.c:122
void CO_epoll_processLast(CO_epoll_t *ep)
Closing function for an epoll event.
Definition: CO_epoll_interface.c:187
void CO_epoll_initCANopenGtw(CO_epoll_gtw_t *epGtw, CO_t *co)
Initialization of gateway functions in CANopen reset-communication section.
void CO_epoll_closeGtw(CO_epoll_gtw_t *epGtw)
Close gateway-ascii sockets.
int event_fd
Notification event file descriptor.
Definition: CO_epoll_interface.h:93
CANopen object - collection of all CANopenNode objects.
Definition: CANopen.h:301
int epoll_fd
Epoll file descriptor.
Definition: CO_epoll_interface.h:91
uint32_t timerInterval_us
Interval of the timer in microseconds, from CO_epoll_create()
Definition: CO_epoll_interface.h:97
CO_ReturnError_t CO_epoll_createGtw(CO_epoll_gtw_t *epGtw, int epoll_fd, int32_t commandInterface, uint32_t socketTimeout_ms, char *localSocketPath)
Create socket for gateway-ascii command interface and add it to epoll.
uint64_t previousTime_us
time value from the last process call in microseconds
Definition: CO_epoll_interface.h:107
bool_t freshCommand
Indication of fresh command.
Definition: CO_epoll_interface.h:248
int gtwa_fdSocket
Gateway socket file descriptor.
Definition: CO_epoll_interface.h:244