\doxysection{WUsb\+Communication.\+h}
\hypertarget{a00599_source}{}\label{a00599_source}\index{WUsbCommunication.h@{WUsbCommunication.h}}

\begin{DoxyCode}{0}
\DoxyCodeLine{00001\ \textcolor{preprocessor}{\#pragma\ once}}
\DoxyCodeLine{00002\ \textcolor{preprocessor}{\#include\ "{}WUsbSettings.h"{}}}
\DoxyCodeLine{00003\ \textcolor{preprocessor}{\#include\ "{}UsbCommunication.h"{}}}
\DoxyCodeLine{00004\ \textcolor{preprocessor}{\#include\ "{}WUsbInformation.h"{}}}
\DoxyCodeLine{00005\ \textcolor{keyword}{using\ namespace\ }System::Collections::Generic;}
\DoxyCodeLine{00006\ \textcolor{keyword}{namespace\ }\mbox{\hyperlink{a00637}{WCommunication}}\ \{}
\DoxyCodeLine{00010\ \ \ \ \ \textcolor{keyword}{public\ ref\ class}\ \mbox{\hyperlink{a01032}{WUsbCommunication}}\ :\ \textcolor{keyword}{public}\ WBaseCommunication}
\DoxyCodeLine{00011\ \ \ \ \ \{}
\DoxyCodeLine{00012\ \ \ \ \ \textcolor{keyword}{public}:}
\DoxyCodeLine{00016\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{a01032_a154855e8c505523ff964d8c4b80a507a}{WUsbCommunication}}()\ \{}
\DoxyCodeLine{00017\ \ \ \ \ \ \ \ \ \ \ \ \ \_communication\ =\ \textcolor{keyword}{new}\ \mbox{\hyperlink{a00948}{UsbCommunication}}(AUTO\_RECONNECT);}
\DoxyCodeLine{00018\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{00019\ }
\DoxyCodeLine{00023\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{a01032_a57402900a641b3ecc0ed8ebfde8595dd}{\string~WUsbCommunication}}()\ \{}
\DoxyCodeLine{00024\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keyword}{delete}(\_communication);}
\DoxyCodeLine{00025\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{00026\ }
\DoxyCodeLine{00030\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{a01032_a2d657bf1cdb78a050bd75dabafb2b0f5}{WUsbCommunication}}(\mbox{\hyperlink{a01040}{WUsbSettings}}\string^\ pUsbSettings)\ :\ WBaseCommunication()\ \{}
\DoxyCodeLine{00031\ \ \ \ \ \ \ \ \ \ \ \ \ Settings\ =\ pUsbSettings;}
\DoxyCodeLine{00032\ \ \ \ \ \ \ \ \ \ \ \ \ \_communication\ =\ \textcolor{keyword}{new}\ \mbox{\hyperlink{a00948}{UsbCommunication}}((\mbox{\hyperlink{a00956}{UsbSettings}}*)pUsbSettings-\/>\_\_nativeSettings,\ AUTO\_RECONNECT);}
\DoxyCodeLine{00033\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{00037\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{a00988}{WCommunicationStatus}}\string^\ \mbox{\hyperlink{a01032_a5c6e630d7ed665f259fcfd444bb3e89d}{Connect}}()\textcolor{keyword}{\ override\ }\{}
\DoxyCodeLine{00038\ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{a00856}{CommunicationStatus}}\ status\ =\ \_communication-\/>Connect();}
\DoxyCodeLine{00039\ }
\DoxyCodeLine{00040\ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{a00988}{WCommunicationStatus}}\string^\ toReturn\ =\ gcnew\ \mbox{\hyperlink{a00988}{WCommunicationStatus}}();}
\DoxyCodeLine{00041\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{for}\ (\textcolor{keywordtype}{int}\ i\ =\ 0;\ i\ <\ status.\mbox{\hyperlink{a00856_a87cc1983ca0089337a5f71ad795dcff8}{Channels}}.size();\ i++)\ \{}
\DoxyCodeLine{00042\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{a00976}{WChannel}}\string^\ toAdd\ =\ gcnew\ \mbox{\hyperlink{a00976}{WChannel}}();}
\DoxyCodeLine{00043\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ toAdd-\/>RawDataAvailability\ =\ \textcolor{keyword}{static\_cast<}DataAvailabilityEnum\textcolor{keyword}{>}(status.\mbox{\hyperlink{a00856_a87cc1983ca0089337a5f71ad795dcff8}{Channels}}[i].RawDataAvailability);}
\DoxyCodeLine{00044\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ toAdd-\/>\mbox{\hyperlink{a00976_a7cc59dd4b6cab51b0f1155dde4f85a36}{Type}}\ =\ \textcolor{keyword}{static\_cast<}ChannelTypeEnum\textcolor{keyword}{>}(status.\mbox{\hyperlink{a00856_a87cc1983ca0089337a5f71ad795dcff8}{Channels}}[i].Type);}
\DoxyCodeLine{00045\ }
\DoxyCodeLine{00046\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ toReturn-\/>\mbox{\hyperlink{a00988_a8c45b6f68a51768ba69be0c4fa95c763}{Channels}}-\/>Add(toAdd);}
\DoxyCodeLine{00047\ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{00048\ }
\DoxyCodeLine{00049\ \ \ \ \ \ \ \ \ \ \ \ \ toReturn-\/>ErrorCode\ =\ gcnew\ \mbox{\hyperlink{a00980}{WCommunicationErrorCode}}();}
\DoxyCodeLine{00050\ \ \ \ \ \ \ \ \ \ \ \ \ toReturn-\/>ErrorCode-\/>ErrorCode\ =\ status.\mbox{\hyperlink{a00856_aa6728b7808f69b23990630e64d37fbc0}{ErrorCode}}.\mbox{\hyperlink{a00848_af710215988a642bb36b0e93f61341e9a}{ErrorCode}};}
\DoxyCodeLine{00051\ \ \ \ \ \ \ \ \ \ \ \ \ toReturn-\/>ErrorCode-\/>ErrorMeaning\ =\ gcnew\ String(status.\mbox{\hyperlink{a00856_aa6728b7808f69b23990630e64d37fbc0}{ErrorCode}}.\mbox{\hyperlink{a00848_a2411f96315b686ae04af6c8ce56432fe}{ErrorMeaning}}.c\_str());}
\DoxyCodeLine{00052\ }
\DoxyCodeLine{00053\ \ \ \ \ \ \ \ \ \ \ \ \ toReturn-\/>Status\ =\ \textcolor{keyword}{static\_cast<}ConnectionStatusEnum\textcolor{keyword}{>}(status.\mbox{\hyperlink{a00856_a35b90bc5c1c8a18f59c0118b1181a95a}{Status}});}
\DoxyCodeLine{00054\ }
\DoxyCodeLine{00055\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ toReturn;}
\DoxyCodeLine{00056\ \ \ \ \ \ \ \ \ \ \ \ \ }
\DoxyCodeLine{00057\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{00061\ \ \ \ \ \ \ \ \ \textcolor{keywordtype}{void}\ \mbox{\hyperlink{a01032_a5a36a863fa08c5d0a92981c74d3acaf5}{Disconnect}}()\textcolor{keyword}{\ override\ }\{}
\DoxyCodeLine{00062\ \ \ \ \ \ \ \ \ \ \ \ \ \_communication-\/>Disconnect();}
\DoxyCodeLine{00063\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{00064\ }
\DoxyCodeLine{00070\ \ \ \ \ \ \ \ \ \textcolor{keyword}{static}\ List<WUsbInformation\string^>\string^\ \mbox{\hyperlink{a01032_aecb00e7b21789685b61504a5dac92ba6}{GetDeviceList}}()\ \{}
\DoxyCodeLine{00071\ \ \ \ \ \ \ \ \ \ \ \ \ List<WUsbInformation\string^>\string^\ toReturn\ =\ gcnew\ List<WUsbInformation\string^>();}
\DoxyCodeLine{00072\ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{a01036}{WUsbInformation}}\string^\ toAdd;}
\DoxyCodeLine{00073\ }
\DoxyCodeLine{00074\ \ \ \ \ \ \ \ \ \ \ \ \ vector<UsbInformation>\ infos\ =\ \mbox{\hyperlink{a00948_ad3fad861589b3b90cbaca811a55c0d0c}{UsbCommunication::GetDeviceList}}();}
\DoxyCodeLine{00075\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{for}\ (\textcolor{keywordtype}{int}\ i\ =\ 0;\ i\ <\ infos.size();\ i++)\ \{}
\DoxyCodeLine{00076\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ toAdd\ =\ gcnew\ \mbox{\hyperlink{a01036}{WUsbInformation}}();}
\DoxyCodeLine{00077\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ toAdd-\/>\mbox{\hyperlink{a01036_a2ea955fec12bd9d2c567ab00ea316432}{BusNumber}}\ =\ infos[i].GetBusNumber();}
\DoxyCodeLine{00078\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ toAdd-\/>DeviceAddress\ =\ infos[i].GetDeviceAddress();}
\DoxyCodeLine{00079\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ toAdd-\/>Manufacturer\ =\ gcnew\ String(infos[i].GetManufacturer().c\_str());}
\DoxyCodeLine{00080\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ toAdd-\/>ProductDescription\ =\ gcnew\ String(infos[i].GetProductDescription().c\_str());}
\DoxyCodeLine{00081\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ toAdd-\/>ProductId\ =\ infos[i].GetProductId();}
\DoxyCodeLine{00082\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ toAdd-\/>SerialNumber\ =\ gcnew\ String(infos[i].GetSerialNumber().c\_str());}
\DoxyCodeLine{00083\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ toAdd-\/>Speed\ =\ gcnew\ String(infos[i].GetSpeed().c\_str());}
\DoxyCodeLine{00084\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ toAdd-\/>VendorId\ =\ infos[i].GetVendorId();}
\DoxyCodeLine{00085\ }
\DoxyCodeLine{00086\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ toReturn-\/>Add(toAdd);}
\DoxyCodeLine{00087\ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{00088\ }
\DoxyCodeLine{00089\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ toReturn;}
\DoxyCodeLine{00090\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{00091\ \ \ \ \ \textcolor{keyword}{protected}:}
\DoxyCodeLine{00092\ \ \ \ \ \};}
\DoxyCodeLine{00093\ \}}
\DoxyCodeLine{00094\ }

\end{DoxyCode}
