24#ifndef CO_EPOLL_INTERFACE_H
25#define CO_EPOLL_INTERFACE_H
30#include <sys/eventfd.h>
31#include <sys/timerfd.h>
87 struct epoll_event ev;
175#if ((CO_CONFIG_GTW)&CO_CONFIG_GTW_ASCII) || defined CO_DOXYGEN
180 CO_COMMAND_IF_DISABLED = -100,
181 CO_COMMAND_IF_STDIO = -2,
182 CO_COMMAND_IF_LOCAL_SOCKET = -1,
183 CO_COMMAND_IF_TCP_SOCKET_MIN = 0,
184 CO_COMMAND_IF_TCP_SOCKET_MAX = 0xFFFF
215 uint32_t socketTimeout_ms,
char* localSocketPath);
unsigned long int uint32_t
unsigned long long int uint64_t
void CO_epoll_initCANopenGtw(CO_epoll_gtw_t *epGtw, CO_t *co)
Initialization of gateway functions in CANopen reset-communication section.
void CO_epoll_processLast(CO_epoll_t *ep)
Closing function for an epoll event.
Definition CO_epoll_interface.c:183
void CO_epoll_initCANopenMain(CO_epoll_t *ep, CO_t *co)
Initialization of functions in CANopen reset-communication section.
Definition CO_epoll_interface.c:226
void CO_epoll_wait(CO_epoll_t *ep)
Wait for an epoll event.
Definition CO_epoll_interface.c:140
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:289
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.
void CO_epoll_close(CO_epoll_t *ep)
Close epoll, timerfd and eventfd.
Definition CO_epoll_interface.c:124
void CO_epoll_processGtw(CO_epoll_gtw_t *epGtw, CO_t *co, CO_epoll_t *ep)
Process CANopen gateway functions.
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:64
void CO_epoll_closeGtw(CO_epoll_gtw_t *epGtw)
Close gateway-ascii sockets.
CO_commandInterface_t
Command interface type for gateway-ascii.
Definition CO_epoll_interface.h:179
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:273
Object for gateway.
Definition CO_epoll_interface.h:190
int gtwa_fdSocket
Gateway socket file descriptor.
Definition CO_epoll_interface.h:196
char * localSocketPath
Path in case of local socket.
Definition CO_epoll_interface.h:195
int epoll_fd
Epoll file descriptor, from CO_epoll_createGtw()
Definition CO_epoll_interface.h:191
int gtwa_fd
Gateway io stream file descriptor.
Definition CO_epoll_interface.h:197
uint32_t socketTimeout_us
Socket timeout in microseconds.
Definition CO_epoll_interface.h:193
uint32_t socketTimeoutTmr_us
Socket timeout timer in microseconds.
Definition CO_epoll_interface.h:194
int32_t commandInterface
Command interface type or tcp port number, see CO_commandInterface_t.
Definition CO_epoll_interface.h:192
bool_t freshCommand
Indication of fresh command.
Definition CO_epoll_interface.h:198
Object for epoll, timer and event API.
Definition CO_epoll_interface.h:76
uint32_t timerInterval_us
Interval of the timer in microseconds, from CO_epoll_create()
Definition CO_epoll_interface.h:80
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:82
uint32_t timeDifference_us
Time difference since last CO_epoll_wait() execution in microseconds.
Definition CO_epoll_interface.h:81
int epoll_fd
Epoll file descriptor.
Definition CO_epoll_interface.h:77
bool_t timerEvent
True,if timer event is inside CO_epoll_wait()
Definition CO_epoll_interface.h:84
uint64_t previousTime_us
time value from the last process call in microseconds
Definition CO_epoll_interface.h:85
bool_t epoll_new
true, if new epoll event is necessary to process
Definition CO_epoll_interface.h:88
int timer_fd
Interval timer file descriptor.
Definition CO_epoll_interface.h:79
int event_fd
Notification event file descriptor.
Definition CO_epoll_interface.h:78