/* This work is licensed under a Creative Commons CCZero 1.0 Universal License. * See http://creativecommons.org/publicdomain/zero/1.0/ for more information. * * Copyright 2016-2017 (c) Julius Pfrommer, Fraunhofer IOSB * Copyright 2017 (c) Stefan Profanter, fortiss GmbH */ #ifndef PLUGINS_ARCH_POSIX_UA_ARCHITECTURE_H_ #define PLUGINS_ARCH_POSIX_UA_ARCHITECTURE_H_ #define UA_THREAD_LOCAL #define UA_ECOS_HOSTNAME "172.20.12.151" #include #include #include #include #include #include #include #include #define UA_sleep_ms(X) cyg_thread_delay(1 + ((1000 * X * CYGNUM_HAL_RTC_DENOMINATOR) / (CYGNUM_HAL_RTC_NUMERATOR / 1000))); #define OPTVAL_TYPE int #define UA_fd_set(fd, fds) FD_SET((unsigned int)fd, fds) #define UA_fd_isset(fd, fds) FD_ISSET((unsigned int)fd, fds) #define UA_access(x,y) 0 #define UA_IPV6 1 #define UA_SOCKET int #define UA_INVALID_SOCKET -1 #define UA_ERRNO errno #define UA_INTERRUPTED EINTR #define UA_AGAIN EAGAIN #define UA_EAGAIN EAGAIN #define UA_WOULDBLOCK EWOULDBLOCK #define UA_ERR_CONNECTION_PROGRESS EINPROGRESS #define UA_getnameinfo getnameinfo #define UA_send send #define UA_recv recv #define UA_close close #define UA_select select #define UA_shutdown shutdown #define UA_socket socket #define UA_bind bind #define UA_listen listen #define UA_accept accept #define UA_connect connect #define UA_getaddrinfo getaddrinfo #define UA_getsockopt getsockopt #define UA_setsockopt setsockopt #define UA_freeaddrinfo freeaddrinfo #define UA_gethostname gethostname_ecos int gethostname_ecos(char* name, size_t len); #define UA_free free #define UA_malloc malloc #define UA_calloc calloc #define UA_realloc realloc #define UA_snprintf snprintf #define UA_LOG_SOCKET_ERRNO_WRAP(LOG) { \ char *errno_str = strerror(errno); \ LOG; \ } #define UA_LOG_SOCKET_ERRNO_GAI_WRAP(LOG) { \ const char *errno_str = gai_strerror(errno); \ LOG; \ } #include "../ua_architecture_functions.h" #undef SLIST_EMPTY #undef SLIST_FOREACH #undef SLIST_INIT #undef SLIST_REMOVE #undef LIST_EMPTY #undef LIST_FOREACH #undef LIST_INIT #undef LIST_REMOVE #undef TAILQ_EMPTY #undef TAILQ_FOREACH #undef TAILQ_INIT #undef TAILQ_REMOVE #undef TAILQ_FOREACH_REVERSE #undef CIRCLEQ_EMPTY #undef CIRCLEQ_FOREACH #undef CIRCLEQ_INIT #undef CIRCLEQ_FOREACH_REVERSE #undef CIRCLEQ_REMOVE #undef CIRCLEQ_INSERT_TAIL #undef CIRCLEQ_INSERT_HEAD #undef CIRCLEQ_INSERT_AFTER #undef CIRCLEQ_INSERT_BEFORE #undef _SYS_QUEUE_H_ //#include "../deps/queue.h" //in some compilers there's already a _SYS_QUEUE_H_ who is included first and doesn't have all functions #endif /* PLUGINS_ARCH_POSIX_UA_ARCHITECTURE_H_ */