nico@207: \hypertarget{unix_8c}{ nico@207: \section{/home/epimerde/documents/tc11/Can\-Festival-3/drivers/unix/unix.c File Reference} nico@207: \label{unix_8c}\index{/home/epimerde/documents/tc11/CanFestival-3/drivers/unix/unix.c@{/home/epimerde/documents/tc11/CanFestival-3/drivers/unix/unix.c}} nico@207: } nico@207: {\tt \#include $<$unistd.h$>$}\par nico@207: {\tt \#include $<$stdio.h$>$}\par nico@207: {\tt \#include $<$stdlib.h$>$}\par nico@207: {\tt \#include \char`\"{}data.h\char`\"{}}\par nico@207: {\tt \#include \char`\"{}canfestival.h\char`\"{}}\par nico@207: {\tt \#include \char`\"{}timers\_\-driver.h\char`\"{}}\par nico@207: {\tt \#include \char`\"{}can\_\-driver.h\char`\"{}}\par nico@207: \subsection*{Data Structures} nico@207: \begin{CompactItemize} nico@207: \item nico@207: struct \hyperlink{structCANPort}{CANPort} nico@207: \end{CompactItemize} nico@207: \subsection*{Defines} nico@207: \begin{CompactItemize} nico@207: \item nico@207: \#define \hyperlink{unix_8c_74c6a27b44fd54de5cb021299ffce612}{DLL\_\-CALL}(funcname)~($\ast$ funcname\#\#\_\-driver) nico@207: \item nico@207: \#define \hyperlink{unix_8c_7f7ce94bf48fde67f4af7b64c7ca4c85}{FCT\_\-PTR\_\-INIT}~=NULL nico@207: \item nico@207: \#define \hyperlink{unix_8c_2af8b26c5600696a026aa95fe49b9dc9}{DLSYM}(name) nico@207: \item nico@207: \#define \hyperlink{unix_8c_c2f10bc5b98269f33af8a74299236e03}{MAX\_\-NB\_\-CAN\_\-PORTS}~16 nico@207: \end{CompactItemize} nico@207: \subsection*{Functions} nico@207: \begin{CompactItemize} nico@207: \item nico@207: UNS8 \hyperlink{unix_8c_cb4f394ec0e040c5962d3dc1957505fb}{Un\-Load\-Can\-Driver} (\hyperlink{win32_2canfestival_8h_c4a0f44120dee396ab6bb57e23effaa8}{LIB\_\-HANDLE} handle) nico@207: \item nico@207: \hyperlink{win32_2canfestival_8h_c4a0f44120dee396ab6bb57e23effaa8}{LIB\_\-HANDLE} \hyperlink{unix_8c_a6eed61fc15f41f772d4645d7a5edeb5}{Load\-Can\-Driver} (char $\ast$driver\_\-name) nico@207: \item nico@207: UNS8 \hyperlink{unix_8c_8d1909a09c50c750e4d8626595acd9f6}{can\-Send} (\hyperlink{win32_2applicfg_8h_7ef59f941603c6680e74fc335523f17e}{CAN\_\-PORT} port, \hyperlink{structMessage}{Message} $\ast$m) nico@207: \item nico@207: void \hyperlink{unix_8c_45ceca3727c2fb7ac93958a215efb827}{can\-Receive\-Loop} (\hyperlink{win32_2applicfg_8h_7ef59f941603c6680e74fc335523f17e}{CAN\_\-PORT} port) nico@207: \item nico@207: \hyperlink{win32_2applicfg_8h_7ef59f941603c6680e74fc335523f17e}{CAN\_\-PORT} \hyperlink{unix_8c_7476146ad15948a22e7f80a00c89c40a}{can\-Open} (\hyperlink{structstruct__s__BOARD}{s\_\-BOARD} $\ast$board, \hyperlink{structstruct__CO__Data}{CO\_\-Data} $\ast$d) nico@207: \item nico@207: int \hyperlink{unix_8c_02957f72a9b951603adb98a142bd447b}{can\-Close} (\hyperlink{structstruct__CO__Data}{CO\_\-Data} $\ast$d) nico@207: \end{CompactItemize} nico@207: \subsection*{Variables} nico@207: \begin{CompactItemize} nico@207: \item nico@207: \hyperlink{structCANPort}{CANPort} \hyperlink{unix_8c_0b740cf913752262ceb23d51648da86a}{canports} \mbox{[}MAX\_\-NB\_\-CAN\_\-PORTS\mbox{]} = \{\{0,\},\{0,\},\{0,\},\{0,\},\{0,\},\{0,\},\{0,\},\{0,\},\{0,\},\{0,\},\{0,\},\{0,\},\{0,\},\{0,\},\{0,\},\{0,\}\} nico@207: \end{CompactItemize} nico@207: nico@207: nico@207: \subsection{Define Documentation} nico@207: \hypertarget{unix_8c_74c6a27b44fd54de5cb021299ffce612}{ nico@207: \index{unix.c@{unix.c}!DLL_CALL@{DLL\_\-CALL}} nico@207: \index{DLL_CALL@{DLL\_\-CALL}!unix.c@{unix.c}} nico@207: \subsubsection[DLL\_\-CALL]{\setlength{\rightskip}{0pt plus 5cm}\#define DLL\_\-CALL(funcname)~($\ast$ funcname\#\#\_\-driver)}} nico@207: \label{unix_8c_74c6a27b44fd54de5cb021299ffce612} nico@207: nico@207: nico@207: nico@207: nico@207: Definition at line 27 of file unix.c.\hypertarget{unix_8c_2af8b26c5600696a026aa95fe49b9dc9}{ nico@207: \index{unix.c@{unix.c}!DLSYM@{DLSYM}} nico@207: \index{DLSYM@{DLSYM}!unix.c@{unix.c}} nico@207: \subsubsection[DLSYM]{\setlength{\rightskip}{0pt plus 5cm}\#define DLSYM(name)}} nico@207: \label{unix_8c_2af8b26c5600696a026aa95fe49b9dc9} nico@207: nico@207: nico@207: \textbf{Value:} nico@207: nico@207: \begin{Code}\begin{verbatim}*(void **) (&name##_driver) = dlsym(handle, #name"_driver");\ nico@207: if ((error = dlerror()) != NULL) {\ nico@207: fprintf (stderr, "%s\n", error);\ nico@207: UnLoadCanDriver(handle);\ nico@207: return NULL;\ nico@207: } nico@207: \end{verbatim}\end{Code} nico@207: nico@207: nico@207: Definition at line 30 of file unix.c.\hypertarget{unix_8c_7f7ce94bf48fde67f4af7b64c7ca4c85}{ nico@207: \index{unix.c@{unix.c}!FCT_PTR_INIT@{FCT\_\-PTR\_\-INIT}} nico@207: \index{FCT_PTR_INIT@{FCT\_\-PTR\_\-INIT}!unix.c@{unix.c}} nico@207: \subsubsection[FCT\_\-PTR\_\-INIT]{\setlength{\rightskip}{0pt plus 5cm}\#define FCT\_\-PTR\_\-INIT~=NULL}} nico@207: \label{unix_8c_7f7ce94bf48fde67f4af7b64c7ca4c85} nico@207: nico@207: nico@207: nico@207: nico@207: Definition at line 28 of file unix.c.\hypertarget{unix_8c_c2f10bc5b98269f33af8a74299236e03}{ nico@207: \index{unix.c@{unix.c}!MAX_NB_CAN_PORTS@{MAX\_\-NB\_\-CAN\_\-PORTS}} nico@207: \index{MAX_NB_CAN_PORTS@{MAX\_\-NB\_\-CAN\_\-PORTS}!unix.c@{unix.c}} nico@207: \subsubsection[MAX\_\-NB\_\-CAN\_\-PORTS]{\setlength{\rightskip}{0pt plus 5cm}\#define MAX\_\-NB\_\-CAN\_\-PORTS~16}} nico@207: \label{unix_8c_c2f10bc5b98269f33af8a74299236e03} nico@207: nico@207: nico@207: nico@207: nico@207: Definition at line 49 of file unix.c. nico@207: nico@207: \subsection{Function Documentation} nico@207: \hypertarget{unix_8c_02957f72a9b951603adb98a142bd447b}{ nico@207: \index{unix.c@{unix.c}!canClose@{canClose}} nico@207: \index{canClose@{canClose}!unix.c@{unix.c}} nico@207: \subsubsection[canClose]{\setlength{\rightskip}{0pt plus 5cm}int can\-Close (\hyperlink{structstruct__CO__Data}{CO\_\-Data} $\ast$ {\em d})}} nico@207: \label{unix_8c_02957f72a9b951603adb98a142bd447b} nico@207: nico@207: nico@207: nico@207: nico@207: Definition at line 178 of file unix.c.\hypertarget{unix_8c_7476146ad15948a22e7f80a00c89c40a}{ nico@207: \index{unix.c@{unix.c}!canOpen@{canOpen}} nico@207: \index{canOpen@{canOpen}!unix.c@{unix.c}} nico@207: \subsubsection[canOpen]{\setlength{\rightskip}{0pt plus 5cm}\hyperlink{win32_2applicfg_8h_7ef59f941603c6680e74fc335523f17e}{CAN\_\-PORT} can\-Open (\hyperlink{structstruct__s__BOARD}{s\_\-BOARD} $\ast$ {\em board}, \hyperlink{structstruct__CO__Data}{CO\_\-Data} $\ast$ {\em d})}} nico@207: \label{unix_8c_7476146ad15948a22e7f80a00c89c40a} nico@207: nico@207: nico@207: nico@207: nico@207: Definition at line 145 of file unix.c.\hypertarget{unix_8c_45ceca3727c2fb7ac93958a215efb827}{ nico@207: \index{unix.c@{unix.c}!canReceiveLoop@{canReceiveLoop}} nico@207: \index{canReceiveLoop@{canReceiveLoop}!unix.c@{unix.c}} nico@207: \subsubsection[canReceiveLoop]{\setlength{\rightskip}{0pt plus 5cm}void can\-Receive\-Loop (\hyperlink{win32_2applicfg_8h_7ef59f941603c6680e74fc335523f17e}{CAN\_\-PORT} {\em port})}} nico@207: \label{unix_8c_45ceca3727c2fb7ac93958a215efb827} nico@207: nico@207: nico@207: nico@207: nico@207: Definition at line 132 of file unix.c. nico@207: nico@207: References can\-Dispatch(), can\-Receive(), DLL\_\-CALL, Enter\-Mutex(), and Leave\-Mutex().\hypertarget{unix_8c_8d1909a09c50c750e4d8626595acd9f6}{ nico@207: \index{unix.c@{unix.c}!canSend@{canSend}} nico@207: \index{canSend@{canSend}!unix.c@{unix.c}} nico@207: \subsubsection[canSend]{\setlength{\rightskip}{0pt plus 5cm}UNS8 can\-Send (\hyperlink{win32_2applicfg_8h_7ef59f941603c6680e74fc335523f17e}{CAN\_\-PORT} {\em port}, \hyperlink{structMessage}{Message} $\ast$ {\em m})}} nico@207: \label{unix_8c_8d1909a09c50c750e4d8626595acd9f6} nico@207: nico@207: nico@207: nico@207: nico@207: Definition at line 120 of file unix.c.\hypertarget{unix_8c_a6eed61fc15f41f772d4645d7a5edeb5}{ nico@207: \index{unix.c@{unix.c}!LoadCanDriver@{LoadCanDriver}} nico@207: \index{LoadCanDriver@{LoadCanDriver}!unix.c@{unix.c}} nico@207: \subsubsection[LoadCanDriver]{\setlength{\rightskip}{0pt plus 5cm}\hyperlink{win32_2canfestival_8h_c4a0f44120dee396ab6bb57e23effaa8}{LIB\_\-HANDLE} Load\-Can\-Driver (char $\ast$ {\em driver\_\-name})}} nico@207: \label{unix_8c_a6eed61fc15f41f772d4645d7a5edeb5} nico@207: nico@207: nico@207: nico@207: nico@207: Definition at line 84 of file unix.c.\hypertarget{unix_8c_cb4f394ec0e040c5962d3dc1957505fb}{ nico@207: \index{unix.c@{unix.c}!UnLoadCanDriver@{UnLoadCanDriver}} nico@207: \index{UnLoadCanDriver@{UnLoadCanDriver}!unix.c@{unix.c}} nico@207: \subsubsection[UnLoadCanDriver]{\setlength{\rightskip}{0pt plus 5cm}UNS8 Un\-Load\-Can\-Driver (\hyperlink{win32_2canfestival_8h_c4a0f44120dee396ab6bb57e23effaa8}{LIB\_\-HANDLE} {\em handle})}} nico@207: \label{unix_8c_cb4f394ec0e040c5962d3dc1957505fb} nico@207: nico@207: nico@207: nico@207: nico@207: Definition at line 71 of file unix.c. nico@207: nico@207: \subsection{Variable Documentation} nico@207: \hypertarget{unix_8c_0b740cf913752262ceb23d51648da86a}{ nico@207: \index{unix.c@{unix.c}!canports@{canports}} nico@207: \index{canports@{canports}!unix.c@{unix.c}} nico@207: \subsubsection[canports]{\setlength{\rightskip}{0pt plus 5cm}\hyperlink{structCANPort}{CANPort} \hyperlink{unix_8c_0b740cf913752262ceb23d51648da86a}{canports}\mbox{[}MAX\_\-NB\_\-CAN\_\-PORTS\mbox{]} = \{\{0,\},\{0,\},\{0,\},\{0,\},\{0,\},\{0,\},\{0,\},\{0,\},\{0,\},\{0,\},\{0,\},\{0,\},\{0,\},\{0,\},\{0,\},\{0,\}\}}} nico@207: \label{unix_8c_0b740cf913752262ceb23d51648da86a} nico@207: nico@207: nico@207: nico@207: nico@207: Definition at line 66 of file unix.c.