\section{CBernstein\-Msg Klassenreferenz}
\label{classCBernsteinMsg}\index{CBernsteinMsg@{CBernsteinMsg}}
Klasse f\"{u}r den Nachrichtenaustausch.von seriell auf Netzwerk.  


{\tt \#include $<$Bernstein\-Msg.h$>$}

Klassendiagramm f\"{u}r CBernstein\-Msg::\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=3cm]{classCBernsteinMsg}
\end{center}
\end{figure}
\subsection*{\"{O}ffentliche Methoden}
\begin{CompactItemize}
\item 
{\bf CBernstein\-Msg} (const char $\ast$c\-COMPort, const int n\-Baud\-Rate, const int n\-Byte\-Size, const int n\-Parity, const int n\-Stop\-Bits, bool b\-Auto\-Start=true)
\begin{CompactList}\small\item\em Konstruktor. \item\end{CompactList}\item 
virtual {\bf $\sim$CBernstein\-Msg} ()\label{classCBernsteinMsg_a1}

\begin{CompactList}\small\item\em Destruktor. \item\end{CompactList}\item 
void {\bf Send\-RS232} (const char $\ast$p\-Data, int n\-Data\-Len)
\begin{CompactList}\small\item\em Sendet \"{u}ber die serielle Schnittstelle die Daten an TCP/IP. \item\end{CompactList}\item 
virtual void {\bf Receive\-RS232} (const char $\ast$p\-Data, long Data\-Len)
\begin{CompactList}\small\item\em Wird beim Empfang von Daten aufgerufen. \item\end{CompactList}\item 
bool {\bf Is\-Open} (void) const\label{classCBernsteinMsg_a4}

\item 
const std::string \& {\bf Get\-Last\-Error\-Msg} (void) const\label{classCBernsteinMsg_a5}

\item 
const std::string \& {\bf Get\-Port} (void) const\label{classCBernsteinMsg_a6}

\item 
void {\bf Set\-Port} (const std::string \&s\-COMPort)\label{classCBernsteinMsg_a7}

\item 
bool {\bf IOStart} (void)
\begin{CompactList}\small\item\em RS232Komunikation wird gestartet. \item\end{CompactList}\end{CompactItemize}
\subsection*{\"{O}ffentliche, statische Methoden}
\begin{CompactItemize}
\item 
DWORD WINAPI {\bf Receive\-Thread} (LPVOID p\-Args)
\begin{CompactList}\small\item\em Startmethode f\"{u}r den Empfangsthread. \item\end{CompactList}\end{CompactItemize}
\subsection*{Gesch\"{u}tzte Methoden}
\begin{CompactItemize}
\item 
{\bf CBernstein\-Msg} (void)\label{classCBernsteinMsg_b0}

\begin{CompactList}\small\item\em Konstruktor. \item\end{CompactList}\item 
void {\bf Receive\-COM} ()\label{classCBernsteinMsg_b1}

\begin{CompactList}\small\item\em Holt vom COM-Port Daten. \item\end{CompactList}\item 
bool {\bf IOStop} (void)
\begin{CompactList}\small\item\em RS232Komunikation wird gestoppt. \item\end{CompactList}\item 
bool {\bf Init\-RS232} (const char $\ast$c\-COMPort, const int n\-Baud\-Rate, const int n\-Byte\-Size, const int n\-Parity, const int n\-Stop\-Bits)
\begin{CompactList}\small\item\em Setzt die Parameter der COM-Schnittstelle. \item\end{CompactList}\end{CompactItemize}
\subsection*{Private Methoden}
\begin{CompactItemize}
\item 
bool {\bf Set\-Com\-Parameter} (void)
\begin{CompactList}\small\item\em Setzt die Eigenschaften, mit denen der COM-Port betrieben werden soll. \item\end{CompactList}\item 
bool {\bf Open\-Port} (void)
\begin{CompactList}\small\item\em \"{O}ffnet den COM-Port. \item\end{CompactList}\item 
void {\bf Close\-Port} (void)\label{classCBernsteinMsg_d2}

\begin{CompactList}\small\item\em Schlie\ss{}t den COM-Port. \item\end{CompactList}\end{CompactItemize}
\subsection*{Private Attribute}
\begin{CompactItemize}
\item 
int {\bf m\_\-n\-Last\-RS232Error}\label{classCBernsteinMsg_r0}

\begin{CompactList}\small\item\em Letzter Fehlercode. \item\end{CompactList}\item 
OVERLAPPED {\bf m\_\-o\-Overlapped\-Read}\label{classCBernsteinMsg_r1}

\begin{CompactList}\small\item\em Overlapped-Struktur zum lesen von seriellen Port. \item\end{CompactList}\item 
OVERLAPPED {\bf m\_\-o\-Overlapped\-Write}\label{classCBernsteinMsg_r2}

\begin{CompactList}\small\item\em Overlapped-Struktur zum schreiben auf seriellen Port. \item\end{CompactList}\item 
std::string {\bf m\_\-s\-COMPort}\label{classCBernsteinMsg_r3}

\begin{CompactList}\small\item\em COMPort. \item\end{CompactList}\item 
std::string {\bf m\_\-s\-Last\-Error\-Msg}\label{classCBernsteinMsg_r4}

\item 
DCB {\bf m\_\-o\-Port\-DCB}\label{classCBernsteinMsg_r5}

\begin{CompactList}\small\item\em DCB-Struktur, um die Initialisierungswerte f\"{u}r seriellen Port zu setzen. \item\end{CompactList}\item 
HANDLE {\bf m\_\-h\-COMPort}\label{classCBernsteinMsg_r6}

\begin{CompactList}\small\item\em Handle auf das File (serieller Port). \item\end{CompactList}\item 
HANDLE {\bf m\_\-h\-Receive\-Thread\-Handle}\label{classCBernsteinMsg_r7}

\begin{CompactList}\small\item\em Handle auf den Thread. \item\end{CompactList}\item 
DWORD {\bf m\_\-dw\-Bytes\-Written}\label{classCBernsteinMsg_r8}

\begin{CompactList}\small\item\em Kontrollwert f\"{u}r die Kommunikation. \item\end{CompactList}\item 
DWORD {\bf m\_\-dw\-Bytes\-Read}\label{classCBernsteinMsg_r9}

\begin{CompactList}\small\item\em Kontrollwert f\"{u}r die Kommunikation. \item\end{CompactList}\item 
DWORD {\bf m\_\-dw\-Rec\-Thread\-ID}\label{classCBernsteinMsg_r10}

\begin{CompactList}\small\item\em Kontrollwert f\"{u}r die Kommunikation. \item\end{CompactList}\end{CompactItemize}


\subsection{Ausf\"{u}hrliche Beschreibung}
Klasse f\"{u}r den Nachrichtenaustausch.von seriell auf Netzwerk. 

\begin{Desc}
\item[Revision]1.10 \end{Desc}
\begin{Desc}
\item[Autor:]Simon Linder \end{Desc}




\subsection{Beschreibung der Konstruktoren und Destruktoren}
\index{CBernsteinMsg@{CBernstein\-Msg}!CBernsteinMsg@{CBernsteinMsg}}
\index{CBernsteinMsg@{CBernsteinMsg}!CBernsteinMsg@{CBernstein\-Msg}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}CBernstein\-Msg::CBernstein\-Msg (const char $\ast$ {\em c\-COMPort}, const int {\em n\-Baud\-Rate}, const int {\em n\-Byte\-Size}, const int {\em n\-Parity}, const int {\em n\-Stop\-Bits}, bool {\em b\-Auto\-Start} = {\tt true})}\label{classCBernsteinMsg_a0}


Konstruktor. 

\begin{Desc}
\item[Parameter:]
\begin{description}
\item[{\em p\-Gateway}]der Gatewayserver \item[{\em c\-COMPort}]COM Port des zu verbindenden Rechners \item[{\em n\-Baud\-Rate}]Baud Rate des zu verbindenden COM Ports \item[{\em n\-Byte\-Size}]Byte\-Size des zu verbindenden COM Ports \item[{\em n\-Parity}]Parity des zu verbindenden COM Ports \item[{\em n\-Stop\-Bits}]Stop\-Bits des zu verbindenden COM Ports \end{description}
\end{Desc}


\subsection{Dokumentation der Elementfunktionen}
\index{CBernsteinMsg@{CBernstein\-Msg}!InitRS232@{InitRS232}}
\index{InitRS232@{InitRS232}!CBernsteinMsg@{CBernstein\-Msg}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool CBernstein\-Msg::Init\-RS232 (const char $\ast$ {\em c\-COMPort}, const int {\em n\-Baud\-Rate}, const int {\em n\-Byte\-Size}, const int {\em n\-Parity}, const int {\em n\-Stop\-Bits})\hspace{0.3cm}{\tt  [protected]}}\label{classCBernsteinMsg_b3}


Setzt die Parameter der COM-Schnittstelle. 

\begin{Desc}
\item[Parameter:]
\begin{description}
\item[{\em c\-COMPort}]COM Port des zu verbindenden Rechners \item[{\em n\-Baud\-Rate}]Baud Rate des zu verbindenden COM Ports \item[{\em n\-Byte\-Size}]Byte\-Size des zu verbindenden COM Ports \item[{\em n\-Parity}]Parity des zu verbindenden COM Ports \item[{\em n\-Stop\-Bits}]Stop\-Bits des zu verbindenden COM Ports \end{description}
\end{Desc}
\begin{Desc}
\item[R\"{u}ckgabe:]false bei Fehler. sonst true \end{Desc}
\index{CBernsteinMsg@{CBernstein\-Msg}!IOStart@{IOStart}}
\index{IOStart@{IOStart}!CBernsteinMsg@{CBernstein\-Msg}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool CBernstein\-Msg::IOStart (void)}\label{classCBernsteinMsg_a8}


RS232Komunikation wird gestartet. 

\begin{Desc}
\item[R\"{u}ckgabe:]false bei Fehler. sonst true \end{Desc}
\index{CBernsteinMsg@{CBernstein\-Msg}!IOStop@{IOStop}}
\index{IOStop@{IOStop}!CBernsteinMsg@{CBernstein\-Msg}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool CBernstein\-Msg::IOStop (void)\hspace{0.3cm}{\tt  [protected]}}\label{classCBernsteinMsg_b2}


RS232Komunikation wird gestoppt. 

\begin{Desc}
\item[R\"{u}ckgabe:]false bei Fehler. sonst true \end{Desc}
\index{CBernsteinMsg@{CBernstein\-Msg}!OpenPort@{OpenPort}}
\index{OpenPort@{OpenPort}!CBernsteinMsg@{CBernstein\-Msg}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool CBernstein\-Msg::Open\-Port (void)\hspace{0.3cm}{\tt  [private]}}\label{classCBernsteinMsg_d1}


\"{O}ffnet den COM-Port. 

\begin{Desc}
\item[R\"{u}ckgabe:]true, falls kein Fehler aufgetreten \end{Desc}
\index{CBernsteinMsg@{CBernstein\-Msg}!ReceiveRS232@{ReceiveRS232}}
\index{ReceiveRS232@{ReceiveRS232}!CBernsteinMsg@{CBernstein\-Msg}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void CBernstein\-Msg::Receive\-RS232 (const char $\ast$ {\em p\-Data}, long {\em Data\-Len})\hspace{0.3cm}{\tt  [virtual]}}\label{classCBernsteinMsg_a3}


Wird beim Empfang von Daten aufgerufen. 

\begin{Desc}
\item[Parameter:]
\begin{description}
\item[{\em p\-Data}]Zeiger auf den empfangenen Datenbereich. \item[{\em Data\-Len}]L\"{a}nge dieses Datenbereiches. \end{description}
\end{Desc}


Erneute Implementation in {\bf CGateway\-Server} {\rm (S.\,\pageref{classCGatewayServer_a5})} und {\bf CCOMConnector} {\rm (S.\,\pageref{classCCOMConnector_a2})}.\index{CBernsteinMsg@{CBernstein\-Msg}!ReceiveThread@{ReceiveThread}}
\index{ReceiveThread@{ReceiveThread}!CBernsteinMsg@{CBernstein\-Msg}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}DWORD WINAPI CBernstein\-Msg::Receive\-Thread (LPVOID {\em p\-Args})\hspace{0.3cm}{\tt  [static]}}\label{classCBernsteinMsg_e0}


Startmethode f\"{u}r den Empfangsthread. 

\begin{Desc}
\item[Parameter:]
\begin{description}
\item[{\em p\-Args}]\end{description}
\end{Desc}
\begin{Desc}
\item[R\"{u}ckgabe:]0 \end{Desc}
\index{CBernsteinMsg@{CBernstein\-Msg}!SendRS232@{SendRS232}}
\index{SendRS232@{SendRS232}!CBernsteinMsg@{CBernstein\-Msg}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void CBernstein\-Msg::Send\-RS232 (const char $\ast$ {\em p\-Data}, int {\em n\-Data\-Len})}\label{classCBernsteinMsg_a2}


Sendet \"{u}ber die serielle Schnittstelle die Daten an TCP/IP. 

\begin{Desc}
\item[Parameter:]
\begin{description}
\item[{\em p\-Data}]Zeiger auf den Datenbereich \item[{\em n\-Data\-Len}]L\"{a}nge des Datenbereiches \end{description}
\end{Desc}
\index{CBernsteinMsg@{CBernstein\-Msg}!SetComParameter@{SetComParameter}}
\index{SetComParameter@{SetComParameter}!CBernsteinMsg@{CBernstein\-Msg}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool CBernstein\-Msg::Set\-Com\-Parameter (void)\hspace{0.3cm}{\tt  [private]}}\label{classCBernsteinMsg_d0}


Setzt die Eigenschaften, mit denen der COM-Port betrieben werden soll. 

\begin{Desc}
\item[R\"{u}ckgabe:]true, falls kein Fehler aufgetreten \end{Desc}


Die Dokumentation f\"{u}r diese Klasse wurde erzeugt aufgrund der Dateien:\begin{CompactItemize}
\item 
Bernstein\-Msg.h\item 
Bernstein\-Msg.cpp\end{CompactItemize}
