\doxysection{Ethernet\+Communication Class Reference}
\hypertarget{a00872}{}\label{a00872}\index{EthernetCommunication@{EthernetCommunication}}


An ETHERNET oriented communication class. It inherits from Base\+Communication. It ensures the ETHERNET communication on both UDP and TCP This class holds the multi process mechanism to hold the command exchange between a HOST and a CLIENT.  




{\ttfamily \#include $<$Ethernet\+Communication.\+h$>$}

Inheritance diagram for Ethernet\+Communication\+:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=2.000000cm]{a00872}
\end{center}
\end{figure}
\doxysubsubsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\mbox{\hyperlink{a00872_a3c646204a0c8ce5280d4d83848249c69}{Ethernet\+Communication}} ()
\begin{DoxyCompactList}\small\item\em Base constructor. \end{DoxyCompactList}\item 
\mbox{\hyperlink{a00872_ac7c1996159e555926af232f22bc9a929}{Ethernet\+Communication}} (MONITORING\+\_\+\+MODE monitoring)
\begin{DoxyCompactList}\small\item\em Copy constructor. \end{DoxyCompactList}\item 
\mbox{\hyperlink{a00872_a94af74f5ca70d1e124ca9bdc7510a596}{Ethernet\+Communication}} (\mbox{\hyperlink{a00876}{Ethernet\+Settings}} \texorpdfstring{$\ast$}{*}settings)
\begin{DoxyCompactList}\small\item\em Copy constructor (sets the ethernet settings) \end{DoxyCompactList}\item 
\mbox{\hyperlink{a00872_a227ce784f7e28612aad8dd1ea3afd354}{Ethernet\+Communication}} (\mbox{\hyperlink{a00876}{Ethernet\+Settings}} \texorpdfstring{$\ast$}{*}settings, MONITORING\+\_\+\+MODE monitoring)
\begin{DoxyCompactList}\small\item\em Copy constructor (sets the ethernet settings) \end{DoxyCompactList}\item 
\mbox{\hyperlink{a00872_a67b51707ab42ac79c9df7a2e74af0368}{\texorpdfstring{$\sim$}{\string~}\+Ethernet\+Communication}} ()
\begin{DoxyCompactList}\small\item\em Destructor, stops the running threads by calling the Stop\+And\+Clean internal method. \end{DoxyCompactList}\item 
\mbox{\hyperlink{a00856}{Communication\+Status}} \mbox{\hyperlink{a00872_ab4428f258b731844dd159fe4b46d4ffd}{Connect}} ()
\begin{DoxyCompactList}\small\item\em Proceed to TCP and UDP connection semaphores and mutex creation and Threads launching. \end{DoxyCompactList}\item 
void \mbox{\hyperlink{a00872_a0910e0fd481db6025795a050c4838007}{Disconnect}} ()
\begin{DoxyCompactList}\small\item\em Disconnects all communication channels, stops the running threads and wait them to join Closes the semaphores and mutex handles. \end{DoxyCompactList}\item 
string \mbox{\hyperlink{a00872_aae4deb1c36c5b4e6b17b66afa4bfc0db}{Send\+Command}} (string command\+To\+Send)
\begin{DoxyCompactList}\small\item\em Send a string command on the appropriate communication channel media. \end{DoxyCompactList}\item 
string \mbox{\hyperlink{a00872_a3596f0fe23c20fc8f3f52bd9fad7f872}{Send\+Command}} (string command\+To\+Send, int specific\+Timeout)
\begin{DoxyCompactList}\small\item\em Send a string command on the appropriate communication channel media ~\newline
 \end{DoxyCompactList}\item 
\mbox{\hyperlink{a00928}{Raw\+Data}} \mbox{\hyperlink{a00872_aea16f65e0fbea29dd94c47acb643a686}{Wait\+For\+Raw\+Data}} (int wait\+Timeout, unsigned long \texorpdfstring{$\ast$}{*}sem\+Status)
\begin{DoxyCompactList}\small\item\em Wait the DATAWORKER to produce a RAW DATA. This method will wait on the \+\_\+sel\+Raw\+Data\+Available semaphore to release the data dequeued from the \+\_\+raw\+Data\+Queue. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsubsection*{Public Attributes}
\begin{DoxyCompactItemize}
\item 
const int \mbox{\hyperlink{a00872_ada9f201c893d3af6645c8525017f16cd}{TCP\+\_\+\+NEWORKQUEUE\+\_\+\+OVERFLOWLIMIT}} = 20
\item 
const int \mbox{\hyperlink{a00872_a2b1a321f14d38714a424157807312eb7}{TCP\+\_\+\+RAWDATA\+\_\+\+QUEUE\+\_\+\+OVERFLOWLIMIT}} = 20
\item 
const int \mbox{\hyperlink{a00872_ab0f5cfd2e4e0ad399f32c639cbc67a4e}{MAX\+\_\+\+SIZE\+\_\+\+TO\+\_\+\+READ}} = 40000
\item 
const int \mbox{\hyperlink{a00872_a56e479c3bba9eeecb6d6ae6a166d0129}{COMMAND\+\_\+\+ACK\+\_\+\+TIMEOUT}} = 8000
\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
An ETHERNET oriented communication class. It inherits from Base\+Communication. It ensures the ETHERNET communication on both UDP and TCP This class holds the multi process mechanism to hold the command exchange between a HOST and a CLIENT. 

\doxysubsection{Constructor \& Destructor Documentation}
\Hypertarget{a00872_a3c646204a0c8ce5280d4d83848249c69}\index{EthernetCommunication@{EthernetCommunication}!EthernetCommunication@{EthernetCommunication}}
\index{EthernetCommunication@{EthernetCommunication}!EthernetCommunication@{EthernetCommunication}}
\doxysubsubsection{\texorpdfstring{EthernetCommunication()}{EthernetCommunication()}\hspace{0.1cm}{\footnotesize\ttfamily [1/4]}}
{\footnotesize\ttfamily \label{a00872_a3c646204a0c8ce5280d4d83848249c69} 
Ethernet\+Communication\+::\+Ethernet\+Communication (\begin{DoxyParamCaption}{}{}\end{DoxyParamCaption})}



Base constructor. 

\Hypertarget{a00872_ac7c1996159e555926af232f22bc9a929}\index{EthernetCommunication@{EthernetCommunication}!EthernetCommunication@{EthernetCommunication}}
\index{EthernetCommunication@{EthernetCommunication}!EthernetCommunication@{EthernetCommunication}}
\doxysubsubsection{\texorpdfstring{EthernetCommunication()}{EthernetCommunication()}\hspace{0.1cm}{\footnotesize\ttfamily [2/4]}}
{\footnotesize\ttfamily \label{a00872_ac7c1996159e555926af232f22bc9a929} 
Ethernet\+Communication\+::\+Ethernet\+Communication (\begin{DoxyParamCaption}\item[{MONITORING\+\_\+\+MODE}]{monitoring}{}\end{DoxyParamCaption})}



Copy constructor. 

\Hypertarget{a00872_a94af74f5ca70d1e124ca9bdc7510a596}\index{EthernetCommunication@{EthernetCommunication}!EthernetCommunication@{EthernetCommunication}}
\index{EthernetCommunication@{EthernetCommunication}!EthernetCommunication@{EthernetCommunication}}
\doxysubsubsection{\texorpdfstring{EthernetCommunication()}{EthernetCommunication()}\hspace{0.1cm}{\footnotesize\ttfamily [3/4]}}
{\footnotesize\ttfamily \label{a00872_a94af74f5ca70d1e124ca9bdc7510a596} 
Ethernet\+Communication\+::\+Ethernet\+Communication (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{a00876}{Ethernet\+Settings}} \texorpdfstring{$\ast$}{*}}]{settings}{}\end{DoxyParamCaption})}



Copy constructor (sets the ethernet settings) 


\begin{DoxyParams}{Parameters}
{\em settings} & The ethernet settings to be set\\
\hline
\end{DoxyParams}
\Hypertarget{a00872_a227ce784f7e28612aad8dd1ea3afd354}\index{EthernetCommunication@{EthernetCommunication}!EthernetCommunication@{EthernetCommunication}}
\index{EthernetCommunication@{EthernetCommunication}!EthernetCommunication@{EthernetCommunication}}
\doxysubsubsection{\texorpdfstring{EthernetCommunication()}{EthernetCommunication()}\hspace{0.1cm}{\footnotesize\ttfamily [4/4]}}
{\footnotesize\ttfamily \label{a00872_a227ce784f7e28612aad8dd1ea3afd354} 
Ethernet\+Communication\+::\+Ethernet\+Communication (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{a00876}{Ethernet\+Settings}} \texorpdfstring{$\ast$}{*}}]{settings}{, }\item[{MONITORING\+\_\+\+MODE}]{monitoring}{}\end{DoxyParamCaption})}



Copy constructor (sets the ethernet settings) 


\begin{DoxyParams}{Parameters}
{\em settings} & The ethernet settings to be set\\
\hline
{\em monitoring} & The MONITORING\+\_\+\+MASK to be set\\
\hline
\end{DoxyParams}
\Hypertarget{a00872_a67b51707ab42ac79c9df7a2e74af0368}\index{EthernetCommunication@{EthernetCommunication}!````~EthernetCommunication@{\texorpdfstring{$\sim$}{\string~}EthernetCommunication}}
\index{````~EthernetCommunication@{\texorpdfstring{$\sim$}{\string~}EthernetCommunication}!EthernetCommunication@{EthernetCommunication}}
\doxysubsubsection{\texorpdfstring{\texorpdfstring{$\sim$}{\string~}EthernetCommunication()}{\string~EthernetCommunication()}}
{\footnotesize\ttfamily \label{a00872_a67b51707ab42ac79c9df7a2e74af0368} 
Ethernet\+Communication\+::\texorpdfstring{$\sim$}{\string~}\+Ethernet\+Communication (\begin{DoxyParamCaption}{}{}\end{DoxyParamCaption})}



Destructor, stops the running threads by calling the Stop\+And\+Clean internal method. 



\doxysubsection{Member Function Documentation}
\Hypertarget{a00872_ab4428f258b731844dd159fe4b46d4ffd}\index{EthernetCommunication@{EthernetCommunication}!Connect@{Connect}}
\index{Connect@{Connect}!EthernetCommunication@{EthernetCommunication}}
\doxysubsubsection{\texorpdfstring{Connect()}{Connect()}}
{\footnotesize\ttfamily \label{a00872_ab4428f258b731844dd159fe4b46d4ffd} 
\mbox{\hyperlink{a00856}{Communication\+Status}} Ethernet\+Communication\+::\+Connect (\begin{DoxyParamCaption}{}{}\end{DoxyParamCaption})}



Proceed to TCP and UDP connection semaphores and mutex creation and Threads launching. 

\Hypertarget{a00872_a0910e0fd481db6025795a050c4838007}\index{EthernetCommunication@{EthernetCommunication}!Disconnect@{Disconnect}}
\index{Disconnect@{Disconnect}!EthernetCommunication@{EthernetCommunication}}
\doxysubsubsection{\texorpdfstring{Disconnect()}{Disconnect()}}
{\footnotesize\ttfamily \label{a00872_a0910e0fd481db6025795a050c4838007} 
void Ethernet\+Communication\+::\+Disconnect (\begin{DoxyParamCaption}{}{}\end{DoxyParamCaption})}



Disconnects all communication channels, stops the running threads and wait them to join Closes the semaphores and mutex handles. 

\Hypertarget{a00872_aae4deb1c36c5b4e6b17b66afa4bfc0db}\index{EthernetCommunication@{EthernetCommunication}!SendCommand@{SendCommand}}
\index{SendCommand@{SendCommand}!EthernetCommunication@{EthernetCommunication}}
\doxysubsubsection{\texorpdfstring{SendCommand()}{SendCommand()}\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily \label{a00872_aae4deb1c36c5b4e6b17b66afa4bfc0db} 
string Ethernet\+Communication\+::\+Send\+Command (\begin{DoxyParamCaption}\item[{string}]{command\+To\+Send}{}\end{DoxyParamCaption})}



Send a string command on the appropriate communication channel media. 


\begin{DoxyParams}{Parameters}
{\em command\+To\+Send} & The command to send as a string\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
A string representing the command replied on the communication channel media
\end{DoxyReturn}
\Hypertarget{a00872_a3596f0fe23c20fc8f3f52bd9fad7f872}\index{EthernetCommunication@{EthernetCommunication}!SendCommand@{SendCommand}}
\index{SendCommand@{SendCommand}!EthernetCommunication@{EthernetCommunication}}
\doxysubsubsection{\texorpdfstring{SendCommand()}{SendCommand()}\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily \label{a00872_a3596f0fe23c20fc8f3f52bd9fad7f872} 
string Ethernet\+Communication\+::\+Send\+Command (\begin{DoxyParamCaption}\item[{string}]{command\+To\+Send}{, }\item[{int}]{specific\+Timeout}{}\end{DoxyParamCaption})}



Send a string command on the appropriate communication channel media ~\newline
 


\begin{DoxyParams}{Parameters}
{\em command\+To\+Send} & A string representing the command to be sent\\
\hline
{\em specific\+Timeout} & A int representing the wished timeout in milliseconds\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}

\end{DoxyReturn}
\Hypertarget{a00872_aea16f65e0fbea29dd94c47acb643a686}\index{EthernetCommunication@{EthernetCommunication}!WaitForRawData@{WaitForRawData}}
\index{WaitForRawData@{WaitForRawData}!EthernetCommunication@{EthernetCommunication}}
\doxysubsubsection{\texorpdfstring{WaitForRawData()}{WaitForRawData()}}
{\footnotesize\ttfamily \label{a00872_aea16f65e0fbea29dd94c47acb643a686} 
\mbox{\hyperlink{a00928}{Raw\+Data}} Ethernet\+Communication\+::\+Wait\+For\+Raw\+Data (\begin{DoxyParamCaption}\item[{int}]{wait\+Timeout}{, }\item[{unsigned long \texorpdfstring{$\ast$}{*}}]{sem\+Status}{}\end{DoxyParamCaption})}



Wait the DATAWORKER to produce a RAW DATA. This method will wait on the \+\_\+sel\+Raw\+Data\+Available semaphore to release the data dequeued from the \+\_\+raw\+Data\+Queue. 


\begin{DoxyParams}{Parameters}
{\em wait\+Timeout} & The amount of miliseconds the process has to wait befor being released\\
\hline
{\em sem\+Status} & The status of the semaphore (updated by reference)\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
A pointer to the RAW Data
\end{DoxyReturn}



\begin{DoxyParams}{Parameters}
{\em wait\+Timeout} & The amount of miliseconds the process has to wait befor being released\\
\hline
{\em sem\+Status} & The status of the semaphore (updated by reference)\\
\hline
\end{DoxyParams}
~\newline
 \begin{DoxyReturn}{Returns}
A pointer to the RAW Data
\end{DoxyReturn}


\doxysubsection{Member Data Documentation}
\Hypertarget{a00872_a56e479c3bba9eeecb6d6ae6a166d0129}\index{EthernetCommunication@{EthernetCommunication}!COMMAND\_ACK\_TIMEOUT@{COMMAND\_ACK\_TIMEOUT}}
\index{COMMAND\_ACK\_TIMEOUT@{COMMAND\_ACK\_TIMEOUT}!EthernetCommunication@{EthernetCommunication}}
\doxysubsubsection{\texorpdfstring{COMMAND\_ACK\_TIMEOUT}{COMMAND\_ACK\_TIMEOUT}}
{\footnotesize\ttfamily \label{a00872_a56e479c3bba9eeecb6d6ae6a166d0129} 
const int Ethernet\+Communication\+::\+COMMAND\+\_\+\+ACK\+\_\+\+TIMEOUT = 8000}

\Hypertarget{a00872_ab0f5cfd2e4e0ad399f32c639cbc67a4e}\index{EthernetCommunication@{EthernetCommunication}!MAX\_SIZE\_TO\_READ@{MAX\_SIZE\_TO\_READ}}
\index{MAX\_SIZE\_TO\_READ@{MAX\_SIZE\_TO\_READ}!EthernetCommunication@{EthernetCommunication}}
\doxysubsubsection{\texorpdfstring{MAX\_SIZE\_TO\_READ}{MAX\_SIZE\_TO\_READ}}
{\footnotesize\ttfamily \label{a00872_ab0f5cfd2e4e0ad399f32c639cbc67a4e} 
const int Ethernet\+Communication\+::\+MAX\+\_\+\+SIZE\+\_\+\+TO\+\_\+\+READ = 40000}

\Hypertarget{a00872_ada9f201c893d3af6645c8525017f16cd}\index{EthernetCommunication@{EthernetCommunication}!TCP\_NEWORKQUEUE\_OVERFLOWLIMIT@{TCP\_NEWORKQUEUE\_OVERFLOWLIMIT}}
\index{TCP\_NEWORKQUEUE\_OVERFLOWLIMIT@{TCP\_NEWORKQUEUE\_OVERFLOWLIMIT}!EthernetCommunication@{EthernetCommunication}}
\doxysubsubsection{\texorpdfstring{TCP\_NEWORKQUEUE\_OVERFLOWLIMIT}{TCP\_NEWORKQUEUE\_OVERFLOWLIMIT}}
{\footnotesize\ttfamily \label{a00872_ada9f201c893d3af6645c8525017f16cd} 
const int Ethernet\+Communication\+::\+TCP\+\_\+\+NEWORKQUEUE\+\_\+\+OVERFLOWLIMIT = 20}

\Hypertarget{a00872_a2b1a321f14d38714a424157807312eb7}\index{EthernetCommunication@{EthernetCommunication}!TCP\_RAWDATA\_QUEUE\_OVERFLOWLIMIT@{TCP\_RAWDATA\_QUEUE\_OVERFLOWLIMIT}}
\index{TCP\_RAWDATA\_QUEUE\_OVERFLOWLIMIT@{TCP\_RAWDATA\_QUEUE\_OVERFLOWLIMIT}!EthernetCommunication@{EthernetCommunication}}
\doxysubsubsection{\texorpdfstring{TCP\_RAWDATA\_QUEUE\_OVERFLOWLIMIT}{TCP\_RAWDATA\_QUEUE\_OVERFLOWLIMIT}}
{\footnotesize\ttfamily \label{a00872_a2b1a321f14d38714a424157807312eb7} 
const int Ethernet\+Communication\+::\+TCP\+\_\+\+RAWDATA\+\_\+\+QUEUE\+\_\+\+OVERFLOWLIMIT = 20}



The documentation for this class was generated from the following files\+:\begin{DoxyCompactItemize}
\item 
Ethernet\+Communication.\+h\item 
Ethernet\+Communication.\+cpp\end{DoxyCompactItemize}
