doc/doxygen/html/can__uvccm__win32_8cpp-source.html
author greg
Sat, 08 Dec 2007 15:01:14 +0100
changeset 329 7717252e3ed9
parent 240 34654679f262
permissions -rw-r--r--
Changes to compile for win32
215
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
     1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
     2
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
     3
<title>CanFestival: drivers/can_uvccm_win32/can_uvccm_win32.cpp Source File</title>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
     4
<link href="doxygen.css" rel="stylesheet" type="text/css">
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
     5
<link href="tabs.css" rel="stylesheet" type="text/css">
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
     6
</head><body>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
     7
<!-- Generated by Doxygen 1.5.1 -->
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
     8
<div class="tabs">
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
     9
  <ul>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    10
    <li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    11
    <li><a href="annotated.html"><span>Data&nbsp;Structures</span></a></li>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    12
    <li id="current"><a href="files.html"><span>Files</span></a></li>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    13
    <li><a href="dirs.html"><span>Directories</span></a></li>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    14
  </ul></div>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    15
<div class="tabs">
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    16
  <ul>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    17
    <li><a href="files.html"><span>File&nbsp;List</span></a></li>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    18
    <li><a href="globals.html"><span>Globals</span></a></li>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    19
  </ul></div>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    20
<div class="nav">
240
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
    21
<a class="el" href="dir_65dd258ff9b9ef4cd7bd0d22f5e58dba.html">drivers</a>&nbsp;&raquo&nbsp;<a class="el" href="dir_804f450f085be204aa1c743a427619b0.html">can_uvccm_win32</a></div>
215
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    22
<h1>can_uvccm_win32.cpp</h1><a href="can__uvccm__win32_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">// can_uvccm_win32 adapter (http://www.gridconnect.com)</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    23
<a name="l00002"></a>00002 <span class="comment">// driver for CanFestival-3 Win32 port</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    24
<a name="l00003"></a>00003 <span class="comment">// Copyright (C) 2007 Leonid Tochinski, ChattenAssociates, Inc.</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    25
<a name="l00004"></a>00004 
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    26
<a name="l00005"></a>00005 
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    27
<a name="l00006"></a>00006 <span class="preprocessor">#include &lt;sstream&gt;</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    28
<a name="l00007"></a>00007 <span class="preprocessor">#include &lt;iomanip&gt;</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    29
<a name="l00008"></a>00008 <span class="preprocessor">#if 0  // change to 1 if you use boost</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    30
<a name="l00009"></a>00009 <span class="preprocessor"></span><span class="preprocessor">#include &lt;boost/algorithm/string/case_conv.hpp&gt;</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    31
<a name="l00010"></a>00010 <span class="preprocessor">#else</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    32
<a name="l00011"></a>00011 <span class="preprocessor"></span><span class="preprocessor">#include &lt;algorithm&gt;</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    33
<a name="l00012"></a>00012 <span class="preprocessor">#endif</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    34
<a name="l00013"></a>00013 <span class="preprocessor"></span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    35
<a name="l00014"></a>00014 <span class="keyword">extern</span> <span class="stringliteral">"C"</span> {
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    36
<a name="l00015"></a>00015 <span class="preprocessor">#include "<a class="code" href="can__driver_8h.html">can_driver.h</a>"</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    37
<a name="l00016"></a>00016 }
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    38
<a name="l00017"></a><a class="code" href="classcan__uvccm__win32.html">00017</a> <span class="keyword">class </span><a class="code" href="classcan__uvccm__win32.html">can_uvccm_win32</a>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    39
<a name="l00018"></a>00018    {
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    40
<a name="l00019"></a>00019    <span class="keyword">public</span>:
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    41
<a name="l00020"></a><a class="code" href="classcan__uvccm__win32_1_1error.html">00020</a>       <span class="keyword">class </span><a class="code" href="classcan__uvccm__win32_1_1error.html">error</a>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    42
<a name="l00021"></a>00021         {
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    43
<a name="l00022"></a>00022         };
240
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
    44
<a name="l00023"></a>00023       <a class="code" href="classcan__uvccm__win32.html#44d72452ded768c3fff1addb9ea2dfdb">can_uvccm_win32</a>(<a class="code" href="structstruct__s__BOARD.html">s_BOARD</a> *board);
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
    45
<a name="l00024"></a>00024       <a class="code" href="classcan__uvccm__win32.html#ad2604fb37772689e837f1bbb396ee73">~can_uvccm_win32</a>();
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
    46
<a name="l00025"></a>00025       <span class="keywordtype">bool</span> <a class="code" href="classcan__uvccm__win32.html#8cdbccec5f1cd2e26056d296c3087290">send</a>(<span class="keyword">const</span> <a class="code" href="structMessage.html">Message</a> *m);
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
    47
<a name="l00026"></a>00026       <span class="keywordtype">bool</span> <a class="code" href="classcan__uvccm__win32.html#a49341f3f4ae90cb45ba7eba2fa22682">receive</a>(<a class="code" href="structMessage.html">Message</a> *m);
215
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    48
<a name="l00027"></a>00027    <span class="keyword">private</span>:
240
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
    49
<a name="l00028"></a>00028       <span class="keywordtype">bool</span> <a class="code" href="classcan__uvccm__win32.html#b71c16fad5ab189cb3fabc09228dce61">open_rs232</a>(<span class="keywordtype">int</span> port = 1, <span class="keywordtype">int</span> baud_rate = 57600);
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
    50
<a name="l00029"></a>00029       <span class="keywordtype">bool</span> <a class="code" href="classcan__uvccm__win32.html#90d854d7d320ba381ad2b86644f13080">close_rs232</a>();
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
    51
<a name="l00030"></a>00030       <span class="keywordtype">bool</span> <a class="code" href="classcan__uvccm__win32.html#9ffa5f900534ffc1bf5c80a0b29628a6">get_can_data</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* can_cmd_buf, <span class="keywordtype">long</span>&amp; bufsize, <a class="code" href="structMessage.html">Message</a>* m);
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
    52
<a name="l00031"></a>00031       <span class="keywordtype">bool</span> <a class="code" href="classcan__uvccm__win32.html#dd49e9a91baf22fb46704dfdac74cb46">set_can_data</a>(<span class="keyword">const</span> <a class="code" href="structMessage.html">Message</a>&amp; m, std::string&amp; can_cmd);
215
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    53
<a name="l00032"></a>00032    <span class="keyword">private</span>:
240
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
    54
<a name="l00033"></a><a class="code" href="classcan__uvccm__win32.html#16a0781c6112a96ba32e9c14124624a5">00033</a>       HANDLE <a class="code" href="classcan__uvccm__win32.html#16a0781c6112a96ba32e9c14124624a5">m_port</a>;
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
    55
<a name="l00034"></a><a class="code" href="classcan__uvccm__win32.html#85163a47e3246eba9a55ad63a34727e8">00034</a>       HANDLE <a class="code" href="classcan__uvccm__win32.html#85163a47e3246eba9a55ad63a34727e8">m_read_event</a>;
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
    56
<a name="l00035"></a><a class="code" href="classcan__uvccm__win32.html#c633c03ea1777d7ae38f23adae505ba5">00035</a>       HANDLE <a class="code" href="classcan__uvccm__win32.html#c633c03ea1777d7ae38f23adae505ba5">m_write_event</a>;
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
    57
<a name="l00036"></a><a class="code" href="classcan__uvccm__win32.html#10bd44df6a991527816fc87547a266f5">00036</a>       std::string <a class="code" href="classcan__uvccm__win32.html#10bd44df6a991527816fc87547a266f5">m_residual_buffer</a>;
215
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    58
<a name="l00037"></a>00037    };
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    59
<a name="l00038"></a>00038 
240
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
    60
<a name="l00039"></a><a class="code" href="classcan__uvccm__win32.html#44d72452ded768c3fff1addb9ea2dfdb">00039</a> <a class="code" href="classcan__uvccm__win32.html#44d72452ded768c3fff1addb9ea2dfdb">can_uvccm_win32::can_uvccm_win32</a>(<a class="code" href="structstruct__s__BOARD.html">s_BOARD</a> *board) : m_port(INVALID_HANDLE_VALUE),
215
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    61
<a name="l00040"></a>00040       m_read_event(0),
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    62
<a name="l00041"></a>00041       m_write_event(0)
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    63
<a name="l00042"></a>00042    {
240
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
    64
<a name="l00043"></a>00043    <span class="keywordflow">if</span> (strcmp( board-&gt;<a class="code" href="structstruct__s__BOARD.html#8fa92cf9df3b66e547c079de89b00562">baudrate</a>, <span class="stringliteral">"125K"</span>) || !<a class="code" href="classcan__uvccm__win32.html#b71c16fad5ab189cb3fabc09228dce61">open_rs232</a>(1))
215
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    65
<a name="l00044"></a>00044       <span class="keywordflow">throw</span> <a class="code" href="classcan__uvccm__win32_1_1error.html">error</a>();
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    66
<a name="l00045"></a>00045    }
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    67
<a name="l00046"></a>00046 
240
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
    68
<a name="l00047"></a><a class="code" href="classcan__uvccm__win32.html#ad2604fb37772689e837f1bbb396ee73">00047</a> <a class="code" href="classcan__uvccm__win32.html#ad2604fb37772689e837f1bbb396ee73">can_uvccm_win32::~can_uvccm_win32</a>()
215
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    69
<a name="l00048"></a>00048    {
240
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
    70
<a name="l00049"></a>00049    <a class="code" href="classcan__uvccm__win32.html#90d854d7d320ba381ad2b86644f13080">close_rs232</a>();
215
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    71
<a name="l00050"></a>00050    }
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    72
<a name="l00051"></a>00051 
240
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
    73
<a name="l00052"></a><a class="code" href="classcan__uvccm__win32.html#8cdbccec5f1cd2e26056d296c3087290">00052</a> <span class="keywordtype">bool</span> <a class="code" href="classcan__uvccm__win32.html#8cdbccec5f1cd2e26056d296c3087290">can_uvccm_win32::send</a>(<span class="keyword">const</span> <a class="code" href="structMessage.html">Message</a> *m)
215
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    74
<a name="l00053"></a>00053    {
240
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
    75
<a name="l00054"></a>00054    <span class="keywordflow">if</span> (<a class="code" href="classcan__uvccm__win32.html#16a0781c6112a96ba32e9c14124624a5">m_port</a> == INVALID_HANDLE_VALUE)
215
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    76
<a name="l00055"></a>00055       <span class="keywordflow">return</span> <span class="keyword">false</span>;
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    77
<a name="l00056"></a>00056 
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    78
<a name="l00057"></a>00057    <span class="comment">// build can_uvccm_win32 command string</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    79
<a name="l00058"></a>00058    std::string can_cmd;
240
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
    80
<a name="l00059"></a>00059    <a class="code" href="classcan__uvccm__win32.html#dd49e9a91baf22fb46704dfdac74cb46">set_can_data</a>(*m, can_cmd);
215
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    81
<a name="l00060"></a>00060 
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    82
<a name="l00061"></a>00061    OVERLAPPED overlapped;
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    83
<a name="l00062"></a>00062    ::memset(&amp;overlapped, 0, <span class="keyword">sizeof</span> overlapped);
240
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
    84
<a name="l00063"></a>00063    overlapped.hEvent = <a class="code" href="classcan__uvccm__win32.html#c633c03ea1777d7ae38f23adae505ba5">m_write_event</a>;
215
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    85
<a name="l00064"></a>00064    ::ResetEvent(overlapped.hEvent);
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    86
<a name="l00065"></a>00065 
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    87
<a name="l00066"></a>00066    <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> bytes_written = 0;
240
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
    88
<a name="l00067"></a>00067    ::WriteFile(<a class="code" href="classcan__uvccm__win32.html#16a0781c6112a96ba32e9c14124624a5">m_port</a>, can_cmd.c_str(), (<span class="keywordtype">unsigned</span> long)can_cmd.size(), &amp;bytes_written, &amp;overlapped);
215
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    89
<a name="l00068"></a>00068    <span class="comment">// wait for write operation completion</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    90
<a name="l00069"></a>00069    <span class="keyword">enum</span> { WRITE_TIMEOUT = 1000 };
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    91
<a name="l00070"></a>00070    ::WaitForSingleObject(overlapped.hEvent, WRITE_TIMEOUT);
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    92
<a name="l00071"></a>00071    <span class="comment">// get number of bytes written</span>
240
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
    93
<a name="l00072"></a>00072    ::GetOverlappedResult(<a class="code" href="classcan__uvccm__win32.html#16a0781c6112a96ba32e9c14124624a5">m_port</a>, &amp;overlapped, &amp;bytes_written, <a class="code" href="def_8h.html#b5b5527380b5b259294fa10ae7e3a59b">FALSE</a>);
215
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    94
<a name="l00073"></a>00073 
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    95
<a name="l00074"></a>00074    <span class="keywordtype">bool</span> result = (bytes_written == can_cmd.size());
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    96
<a name="l00075"></a>00075 
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    97
<a name="l00076"></a>00076    <span class="keywordflow">return</span> result;
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    98
<a name="l00077"></a>00077    }
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
    99
<a name="l00078"></a>00078 
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   100
<a name="l00079"></a>00079 
240
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
   101
<a name="l00080"></a><a class="code" href="classcan__uvccm__win32.html#a49341f3f4ae90cb45ba7eba2fa22682">00080</a> <span class="keywordtype">bool</span> <a class="code" href="classcan__uvccm__win32.html#a49341f3f4ae90cb45ba7eba2fa22682">can_uvccm_win32::receive</a>(<a class="code" href="structMessage.html">Message</a> *m)
215
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   102
<a name="l00081"></a>00081    {
240
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
   103
<a name="l00082"></a>00082    <span class="keywordflow">if</span> (<a class="code" href="classcan__uvccm__win32.html#16a0781c6112a96ba32e9c14124624a5">m_port</a> == INVALID_HANDLE_VALUE)
215
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   104
<a name="l00083"></a>00083       <span class="keywordflow">return</span> <span class="keyword">false</span>;
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   105
<a name="l00084"></a>00084 
240
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
   106
<a name="l00085"></a>00085    <span class="keywordtype">long</span> res_buffer_size = (long)<a class="code" href="classcan__uvccm__win32.html#10bd44df6a991527816fc87547a266f5">m_residual_buffer</a>.size();
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
   107
<a name="l00086"></a>00086    <span class="keywordtype">bool</span> result = <a class="code" href="classcan__uvccm__win32.html#9ffa5f900534ffc1bf5c80a0b29628a6">get_can_data</a>(<a class="code" href="classcan__uvccm__win32.html#10bd44df6a991527816fc87547a266f5">m_residual_buffer</a>.c_str(), res_buffer_size, m);
215
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   108
<a name="l00087"></a>00087    <span class="keywordflow">if</span> (result)
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   109
<a name="l00088"></a>00088       {
240
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
   110
<a name="l00089"></a>00089       <a class="code" href="classcan__uvccm__win32.html#10bd44df6a991527816fc87547a266f5">m_residual_buffer</a>.erase(0, res_buffer_size);
215
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   111
<a name="l00090"></a>00090       <span class="keywordflow">return</span> <span class="keyword">true</span>;
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   112
<a name="l00091"></a>00091       }
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   113
<a name="l00092"></a>00092 
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   114
<a name="l00093"></a>00093    <span class="keyword">enum</span> { READ_TIMEOUT = 500 };
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   115
<a name="l00094"></a>00094 
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   116
<a name="l00095"></a>00095    OVERLAPPED overlapped;
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   117
<a name="l00096"></a>00096    ::memset(&amp;overlapped, 0, <span class="keyword">sizeof</span> overlapped);
240
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
   118
<a name="l00097"></a>00097    overlapped.hEvent = <a class="code" href="classcan__uvccm__win32.html#85163a47e3246eba9a55ad63a34727e8">m_read_event</a>;
215
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   119
<a name="l00098"></a>00098    ::ResetEvent(overlapped.hEvent);
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   120
<a name="l00099"></a>00099    <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> event_mask = 0;
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   121
<a name="l00100"></a>00100 
240
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
   122
<a name="l00101"></a>00101    <span class="keywordflow">if</span> (<a class="code" href="def_8h.html#b5b5527380b5b259294fa10ae7e3a59b">FALSE</a> == ::WaitCommEvent(<a class="code" href="classcan__uvccm__win32.html#16a0781c6112a96ba32e9c14124624a5">m_port</a>, &amp;event_mask, &amp;overlapped) &amp;&amp; ERROR_IO_PENDING == ::GetLastError())
215
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   123
<a name="l00102"></a>00102       {
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   124
<a name="l00103"></a>00103       <span class="keywordflow">if</span> (WAIT_TIMEOUT == ::WaitForSingleObject(overlapped.hEvent, READ_TIMEOUT))
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   125
<a name="l00104"></a>00104          <span class="keywordflow">return</span> <span class="keyword">false</span>;
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   126
<a name="l00105"></a>00105       }
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   127
<a name="l00106"></a>00106 
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   128
<a name="l00107"></a>00107    <span class="comment">// get number of bytes in the input que</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   129
<a name="l00108"></a>00108    COMSTAT stat;
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   130
<a name="l00109"></a>00109    ::memset(&amp;stat, 0, <span class="keyword">sizeof</span> stat);
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   131
<a name="l00110"></a>00110    <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> errors = 0;
240
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
   132
<a name="l00111"></a>00111    ::ClearCommError(<a class="code" href="classcan__uvccm__win32.html#16a0781c6112a96ba32e9c14124624a5">m_port</a>, &amp;errors, &amp;stat);
215
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   133
<a name="l00112"></a>00112    <span class="keywordflow">if</span> (stat.cbInQue == 0)
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   134
<a name="l00113"></a>00113       <span class="keywordflow">return</span> <span class="keyword">false</span>;
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   135
<a name="l00114"></a>00114    <span class="keywordtype">char</span> buffer[3000];
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   136
<a name="l00115"></a>00115 
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   137
<a name="l00116"></a>00116    <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> bytes_to_read = min(stat.cbInQue, sizeof (buffer));
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   138
<a name="l00117"></a>00117 
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   139
<a name="l00118"></a>00118    <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> bytes_read = 0;
240
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
   140
<a name="l00119"></a>00119    ::ReadFile(<a class="code" href="classcan__uvccm__win32.html#16a0781c6112a96ba32e9c14124624a5">m_port</a>, buffer, bytes_to_read, &amp;bytes_read, &amp;overlapped);
215
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   141
<a name="l00120"></a>00120    <span class="comment">// wait for read operation completion</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   142
<a name="l00121"></a>00121    ::WaitForSingleObject(overlapped.hEvent, READ_TIMEOUT);
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   143
<a name="l00122"></a>00122    <span class="comment">// get number of bytes read</span>
240
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
   144
<a name="l00123"></a>00123    ::GetOverlappedResult(<a class="code" href="classcan__uvccm__win32.html#16a0781c6112a96ba32e9c14124624a5">m_port</a>, &amp;overlapped, &amp;bytes_read, <a class="code" href="def_8h.html#b5b5527380b5b259294fa10ae7e3a59b">FALSE</a>);
215
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   145
<a name="l00124"></a>00124    result = <span class="keyword">false</span>;
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   146
<a name="l00125"></a>00125    <span class="keywordflow">if</span> (bytes_read &gt; 0)
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   147
<a name="l00126"></a>00126       {
240
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
   148
<a name="l00127"></a>00127       <a class="code" href="classcan__uvccm__win32.html#10bd44df6a991527816fc87547a266f5">m_residual_buffer</a>.append(buffer, bytes_read);
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
   149
<a name="l00128"></a>00128       res_buffer_size = (long)<a class="code" href="classcan__uvccm__win32.html#10bd44df6a991527816fc87547a266f5">m_residual_buffer</a>.size();
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
   150
<a name="l00129"></a>00129       result = <a class="code" href="classcan__uvccm__win32.html#9ffa5f900534ffc1bf5c80a0b29628a6">get_can_data</a>(<a class="code" href="classcan__uvccm__win32.html#10bd44df6a991527816fc87547a266f5">m_residual_buffer</a>.c_str(), res_buffer_size, m);
215
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   151
<a name="l00130"></a>00130       <span class="keywordflow">if</span> (result)
240
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
   152
<a name="l00131"></a>00131          <a class="code" href="classcan__uvccm__win32.html#10bd44df6a991527816fc87547a266f5">m_residual_buffer</a>.erase(0, res_buffer_size);
215
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   153
<a name="l00132"></a>00132       }
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   154
<a name="l00133"></a>00133    <span class="keywordflow">return</span> result;
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   155
<a name="l00134"></a>00134    }
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   156
<a name="l00135"></a>00135 
240
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
   157
<a name="l00136"></a><a class="code" href="classcan__uvccm__win32.html#b71c16fad5ab189cb3fabc09228dce61">00136</a> <span class="keywordtype">bool</span> <a class="code" href="classcan__uvccm__win32.html#b71c16fad5ab189cb3fabc09228dce61">can_uvccm_win32::open_rs232</a>(<span class="keywordtype">int</span> port, <span class="keywordtype">int</span> baud_rate)
215
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   158
<a name="l00137"></a>00137    {
240
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
   159
<a name="l00138"></a>00138    <span class="keywordflow">if</span> (<a class="code" href="classcan__uvccm__win32.html#16a0781c6112a96ba32e9c14124624a5">m_port</a> != INVALID_HANDLE_VALUE)
215
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   160
<a name="l00139"></a>00139       <span class="keywordflow">return</span> <span class="keyword">true</span>;
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   161
<a name="l00140"></a>00140 
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   162
<a name="l00141"></a>00141    std::ostringstream device_name;
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   163
<a name="l00142"></a>00142    device_name &lt;&lt; <span class="stringliteral">"COM"</span> &lt;&lt; port;
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   164
<a name="l00143"></a>00143 
240
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
   165
<a name="l00144"></a>00144    <a class="code" href="classcan__uvccm__win32.html#16a0781c6112a96ba32e9c14124624a5">m_port</a> = ::CreateFile(device_name.str().c_str(),
215
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   166
<a name="l00145"></a>00145                          GENERIC_READ | GENERIC_WRITE,
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   167
<a name="l00146"></a>00146                          0,   <span class="comment">// exclusive access</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   168
<a name="l00147"></a>00147                          NULL,   <span class="comment">// no security</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   169
<a name="l00148"></a>00148                          OPEN_EXISTING,
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   170
<a name="l00149"></a>00149                          FILE_FLAG_OVERLAPPED,   <span class="comment">// overlapped I/O</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   171
<a name="l00150"></a>00150                          NULL); <span class="comment">// null template</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   172
<a name="l00151"></a>00151 
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   173
<a name="l00152"></a>00152    <span class="comment">// Check the returned handle for INVALID_HANDLE_VALUE and then set the buffer sizes.</span>
240
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
   174
<a name="l00153"></a>00153    <span class="keywordflow">if</span> (<a class="code" href="classcan__uvccm__win32.html#16a0781c6112a96ba32e9c14124624a5">m_port</a> == INVALID_HANDLE_VALUE)
215
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   175
<a name="l00154"></a>00154       <span class="keywordflow">return</span> <span class="keyword">false</span>;
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   176
<a name="l00155"></a>00155 
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   177
<a name="l00156"></a>00156    <span class="comment">//  SetCommMask(m_hCom,EV_RXCHAR|EV_TXEMPTY|EV_CTS|EV_DSR|EV_RLSD|EV_BREAK|EV_ERR|EV_RING); //</span>
240
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
   178
<a name="l00157"></a>00157    ::SetCommMask(<a class="code" href="classcan__uvccm__win32.html#16a0781c6112a96ba32e9c14124624a5">m_port</a>, EV_RXFLAG);
215
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   179
<a name="l00158"></a>00158 
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   180
<a name="l00159"></a>00159    COMMTIMEOUTS timeouts;
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   181
<a name="l00160"></a>00160    ::memset(&amp;timeouts, 0, <span class="keyword">sizeof</span> (timeouts));
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   182
<a name="l00161"></a>00161    timeouts.ReadIntervalTimeout = -1;
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   183
<a name="l00162"></a>00162    timeouts.ReadTotalTimeoutConstant = 0;
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   184
<a name="l00163"></a>00163    timeouts.ReadTotalTimeoutMultiplier = 0;
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   185
<a name="l00164"></a>00164    timeouts.WriteTotalTimeoutConstant = 5000;
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   186
<a name="l00165"></a>00165    timeouts.WriteTotalTimeoutMultiplier = 0;
240
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
   187
<a name="l00166"></a>00166    SetCommTimeouts(<a class="code" href="classcan__uvccm__win32.html#16a0781c6112a96ba32e9c14124624a5">m_port</a>, &amp;timeouts); <span class="comment">//</span>
215
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   188
<a name="l00167"></a>00167 
240
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
   189
<a name="l00168"></a>00168    ::SetupComm(<a class="code" href="classcan__uvccm__win32.html#16a0781c6112a96ba32e9c14124624a5">m_port</a>, 1024, 512); <span class="comment">// set buffer sizes</span>
215
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   190
<a name="l00169"></a>00169 
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   191
<a name="l00170"></a>00170    <span class="comment">// Port settings are specified in a Data Communication Block (DCB). The easiest way to initialize a DCB is to call GetCommState to fill in its default values, override the values that you want to change and then call SetCommState to set the values.</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   192
<a name="l00171"></a>00171    DCB dcb;
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   193
<a name="l00172"></a>00172    ::memset(&amp;dcb, 0, <span class="keyword">sizeof</span> (dcb));
240
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
   194
<a name="l00173"></a>00173    ::GetCommState(<a class="code" href="classcan__uvccm__win32.html#16a0781c6112a96ba32e9c14124624a5">m_port</a>, &amp;dcb);
215
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   195
<a name="l00174"></a>00174    dcb.BaudRate = baud_rate;
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   196
<a name="l00175"></a>00175    dcb.ByteSize = 8;
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   197
<a name="l00176"></a>00176    dcb.Parity = NOPARITY;
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   198
<a name="l00177"></a>00177    dcb.StopBits = ONESTOPBIT;
240
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
   199
<a name="l00178"></a>00178    dcb.fAbortOnError = <a class="code" href="def_8h.html#528a67cfb212764fdec08c7c065a04f8">TRUE</a>;
215
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   200
<a name="l00179"></a>00179    dcb.EvtChar = 0x0A; <span class="comment">// '\n' character</span>
240
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
   201
<a name="l00180"></a>00180    ::SetCommState(<a class="code" href="classcan__uvccm__win32.html#16a0781c6112a96ba32e9c14124624a5">m_port</a>, &amp;dcb);
215
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   202
<a name="l00181"></a>00181 
240
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
   203
<a name="l00182"></a>00182    ::PurgeComm(<a class="code" href="classcan__uvccm__win32.html#16a0781c6112a96ba32e9c14124624a5">m_port</a>, PURGE_RXABORT | PURGE_RXCLEAR | PURGE_TXABORT | PURGE_TXCLEAR);
215
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   204
<a name="l00183"></a>00183 
240
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
   205
<a name="l00184"></a>00184    <a class="code" href="classcan__uvccm__win32.html#85163a47e3246eba9a55ad63a34727e8">m_read_event</a> = ::CreateEvent(NULL, <a class="code" href="def_8h.html#528a67cfb212764fdec08c7c065a04f8">TRUE</a>, <a class="code" href="def_8h.html#b5b5527380b5b259294fa10ae7e3a59b">FALSE</a>, NULL);
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
   206
<a name="l00185"></a>00185    <a class="code" href="classcan__uvccm__win32.html#c633c03ea1777d7ae38f23adae505ba5">m_write_event</a> = ::CreateEvent(NULL, TRUE, FALSE, NULL);
215
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   207
<a name="l00186"></a>00186 
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   208
<a name="l00187"></a>00187    <span class="keywordflow">return</span> <span class="keyword">true</span>;
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   209
<a name="l00188"></a>00188    }
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   210
<a name="l00189"></a>00189 
240
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
   211
<a name="l00190"></a><a class="code" href="classcan__uvccm__win32.html#90d854d7d320ba381ad2b86644f13080">00190</a> <span class="keywordtype">bool</span> <a class="code" href="classcan__uvccm__win32.html#90d854d7d320ba381ad2b86644f13080">can_uvccm_win32::close_rs232</a>()
215
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   212
<a name="l00191"></a>00191    {
240
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
   213
<a name="l00192"></a>00192    <span class="keywordflow">if</span> (<a class="code" href="classcan__uvccm__win32.html#16a0781c6112a96ba32e9c14124624a5">m_port</a> != INVALID_HANDLE_VALUE)
215
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   214
<a name="l00193"></a>00193       {
240
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
   215
<a name="l00194"></a>00194       ::PurgeComm(<a class="code" href="classcan__uvccm__win32.html#16a0781c6112a96ba32e9c14124624a5">m_port</a>, PURGE_RXABORT | PURGE_RXCLEAR | PURGE_TXABORT | PURGE_TXCLEAR);
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
   216
<a name="l00195"></a>00195       ::CloseHandle(<a class="code" href="classcan__uvccm__win32.html#16a0781c6112a96ba32e9c14124624a5">m_port</a>);
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
   217
<a name="l00196"></a>00196       <a class="code" href="classcan__uvccm__win32.html#16a0781c6112a96ba32e9c14124624a5">m_port</a> = INVALID_HANDLE_VALUE;
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
   218
<a name="l00197"></a>00197       ::CloseHandle(<a class="code" href="classcan__uvccm__win32.html#85163a47e3246eba9a55ad63a34727e8">m_read_event</a>);
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
   219
<a name="l00198"></a>00198       <a class="code" href="classcan__uvccm__win32.html#85163a47e3246eba9a55ad63a34727e8">m_read_event</a> = 0;
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
   220
<a name="l00199"></a>00199       ::CloseHandle(<a class="code" href="classcan__uvccm__win32.html#c633c03ea1777d7ae38f23adae505ba5">m_write_event</a>);
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
   221
<a name="l00200"></a>00200       <a class="code" href="classcan__uvccm__win32.html#c633c03ea1777d7ae38f23adae505ba5">m_write_event</a> = 0;
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
   222
<a name="l00201"></a>00201       <a class="code" href="classcan__uvccm__win32.html#10bd44df6a991527816fc87547a266f5">m_residual_buffer</a>.clear();
215
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   223
<a name="l00202"></a>00202       }
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   224
<a name="l00203"></a>00203    <span class="keywordflow">return</span> <span class="keyword">true</span>;
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   225
<a name="l00204"></a>00204    }
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   226
<a name="l00205"></a>00205 
240
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
   227
<a name="l00206"></a><a class="code" href="classcan__uvccm__win32.html#9ffa5f900534ffc1bf5c80a0b29628a6">00206</a> <span class="keywordtype">bool</span> <a class="code" href="classcan__uvccm__win32.html#9ffa5f900534ffc1bf5c80a0b29628a6">can_uvccm_win32::get_can_data</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* can_cmd_buf, <span class="keywordtype">long</span>&amp; bufsize, <a class="code" href="structMessage.html">Message</a>* m)
215
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   228
<a name="l00207"></a>00207    {
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   229
<a name="l00208"></a>00208    <span class="keywordflow">if</span> (bufsize &lt; 5)
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   230
<a name="l00209"></a>00209       {
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   231
<a name="l00210"></a>00210       bufsize = 0;
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   232
<a name="l00211"></a>00211       <span class="keywordflow">return</span> <span class="keyword">false</span>;
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   233
<a name="l00212"></a>00212       }
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   234
<a name="l00213"></a>00213 
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   235
<a name="l00214"></a>00214    <a class="code" href="structMessage.html">Message</a> msg;
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   236
<a name="l00215"></a>00215    ::memset(&amp;msg, 0 , <span class="keyword">sizeof</span> (msg));
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   237
<a name="l00216"></a>00216    <span class="keywordtype">char</span> colon = 0, type = 0, request = 0;
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   238
<a name="l00217"></a>00217    std::istringstream buf(std::string(can_cmd_buf, bufsize));
240
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
   239
<a name="l00218"></a>00218    buf &gt;&gt; colon &gt;&gt; type &gt;&gt; std::hex &gt;&gt; msg.<a class="code" href="structMessage.html#21cda7edcf0800d296151c83e7f9948e">cob_id</a>.<a class="code" href="structSHORT__CAN.html#e77854035fa72dc0769724a2d056bc9d">w</a> &gt;&gt; request;
215
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   240
<a name="l00219"></a>00219    <span class="keywordflow">if</span> (colon != <span class="charliteral">':'</span> || (type != <span class="charliteral">'S'</span> &amp;&amp; type != <span class="charliteral">'X'</span>))
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   241
<a name="l00220"></a>00220       {
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   242
<a name="l00221"></a>00221       bufsize = 0;
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   243
<a name="l00222"></a>00222       <span class="keywordflow">return</span> <span class="keyword">false</span>;
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   244
<a name="l00223"></a>00223       }
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   245
<a name="l00224"></a>00224    <span class="keywordflow">if</span> (request == <span class="charliteral">'N'</span>)
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   246
<a name="l00225"></a>00225       {
240
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
   247
<a name="l00226"></a>00226       msg.<a class="code" href="structMessage.html#4fea58e2ceec365228be253ba3d8bdba">rtr</a> = 0;
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
   248
<a name="l00227"></a>00227       <span class="keywordflow">for</span> (msg.<a class="code" href="structMessage.html#a8c32de83f67079897508203c8e2198c">len</a> = 0; msg.<a class="code" href="structMessage.html#a8c32de83f67079897508203c8e2198c">len</a> &lt; 8; ++msg.<a class="code" href="structMessage.html#a8c32de83f67079897508203c8e2198c">len</a>)
215
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   249
<a name="l00228"></a>00228          {
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   250
<a name="l00229"></a>00229          std::string data_byte_str;
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   251
<a name="l00230"></a>00230          buf &gt;&gt; std::setw(2) &gt;&gt; data_byte_str;
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   252
<a name="l00231"></a>00231          <span class="keywordflow">if</span> (data_byte_str[0] == <span class="charliteral">';'</span>)
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   253
<a name="l00232"></a>00232             <span class="keywordflow">break</span>;
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   254
<a name="l00233"></a>00233          <span class="keywordtype">long</span> byte_val = -1;
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   255
<a name="l00234"></a>00234          std::istringstream(data_byte_str) &gt;&gt; std::hex &gt;&gt; byte_val;
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   256
<a name="l00235"></a>00235          <span class="keywordflow">if</span> (byte_val == -1)
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   257
<a name="l00236"></a>00236             {
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   258
<a name="l00237"></a>00237             bufsize = 0;
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   259
<a name="l00238"></a>00238             <span class="keywordflow">return</span> <span class="keyword">false</span>;
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   260
<a name="l00239"></a>00239             }
240
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
   261
<a name="l00240"></a>00240          msg.<a class="code" href="structMessage.html#9f53ff2fea190c14dd66e2c92a32ec45">data</a>[msg.<a class="code" href="structMessage.html#a8c32de83f67079897508203c8e2198c">len</a>] = (<a class="code" href="hcs12_2applicfg_8h.html#c2e754635928189b98cf3f5b7e6dbffb">UNS8</a>)byte_val;
215
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   262
<a name="l00241"></a>00241          }
240
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
   263
<a name="l00242"></a>00242       <span class="keywordflow">if</span> (msg.<a class="code" href="structMessage.html#a8c32de83f67079897508203c8e2198c">len</a> == 8)
215
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   264
<a name="l00243"></a>00243          {
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   265
<a name="l00244"></a>00244          <span class="keywordtype">char</span> semicolon = 0;
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   266
<a name="l00245"></a>00245          buf &gt;&gt; semicolon;
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   267
<a name="l00246"></a>00246          <span class="keywordflow">if</span> (semicolon != <span class="charliteral">';'</span>)
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   268
<a name="l00247"></a>00247             {
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   269
<a name="l00248"></a>00248             bufsize = 0;
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   270
<a name="l00249"></a>00249             <span class="keywordflow">return</span> <span class="keyword">false</span>;
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   271
<a name="l00250"></a>00250             }
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   272
<a name="l00251"></a>00251          }
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   273
<a name="l00252"></a>00252 
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   274
<a name="l00253"></a>00253       }
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   275
<a name="l00254"></a>00254    <span class="keywordflow">else</span> <span class="keywordflow">if</span> (request == <span class="charliteral">'R'</span>)
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   276
<a name="l00255"></a>00255       {
240
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
   277
<a name="l00256"></a>00256       msg.<a class="code" href="structMessage.html#4fea58e2ceec365228be253ba3d8bdba">rtr</a> = 1;
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
   278
<a name="l00257"></a>00257       buf &gt;&gt; msg.<a class="code" href="structMessage.html#a8c32de83f67079897508203c8e2198c">len</a>;
215
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   279
<a name="l00258"></a>00258       }
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   280
<a name="l00259"></a>00259    <span class="keywordflow">else</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   281
<a name="l00260"></a>00260       {
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   282
<a name="l00261"></a>00261       bufsize = 0;
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   283
<a name="l00262"></a>00262       <span class="keywordflow">return</span> <span class="keyword">false</span>;
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   284
<a name="l00263"></a>00263       }
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   285
<a name="l00264"></a>00264 
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   286
<a name="l00265"></a>00265    bufsize = buf.tellg();
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   287
<a name="l00266"></a>00266 
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   288
<a name="l00267"></a>00267    *m = msg;
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   289
<a name="l00268"></a>00268    <span class="keywordflow">return</span> <span class="keyword">true</span>;
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   290
<a name="l00269"></a>00269    }
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   291
<a name="l00270"></a>00270 
240
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
   292
<a name="l00271"></a><a class="code" href="classcan__uvccm__win32.html#dd49e9a91baf22fb46704dfdac74cb46">00271</a> <span class="keywordtype">bool</span> <a class="code" href="classcan__uvccm__win32.html#dd49e9a91baf22fb46704dfdac74cb46">can_uvccm_win32::set_can_data</a>(<span class="keyword">const</span> <a class="code" href="structMessage.html">Message</a>&amp; m, std::string&amp; can_cmd)
215
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   293
<a name="l00272"></a>00272    {
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   294
<a name="l00273"></a>00273    <span class="comment">// build can_uvccm_win32 command string</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   295
<a name="l00274"></a>00274    std::ostringstream can_cmd_str;
240
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
   296
<a name="l00275"></a>00275    can_cmd_str &lt;&lt; <span class="stringliteral">":S"</span> &lt;&lt; std::hex &lt;&lt; m.<a class="code" href="structMessage.html#21cda7edcf0800d296151c83e7f9948e">cob_id</a>.<a class="code" href="structSHORT__CAN.html#e77854035fa72dc0769724a2d056bc9d">w</a>;
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
   297
<a name="l00276"></a>00276    <span class="keywordflow">if</span> (m.<a class="code" href="structMessage.html#4fea58e2ceec365228be253ba3d8bdba">rtr</a> == 1)
215
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   298
<a name="l00277"></a>00277       {
240
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
   299
<a name="l00278"></a>00278       can_cmd_str &lt;&lt; <span class="charliteral">'R'</span> &lt;&lt; (long)m.<a class="code" href="structMessage.html#a8c32de83f67079897508203c8e2198c">len</a>;
215
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   300
<a name="l00279"></a>00279       }
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   301
<a name="l00280"></a>00280    <span class="keywordflow">else</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   302
<a name="l00281"></a>00281       {
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   303
<a name="l00282"></a>00282       can_cmd_str &lt;&lt; <span class="charliteral">'N'</span>;
240
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
   304
<a name="l00283"></a>00283       <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; m.<a class="code" href="structMessage.html#a8c32de83f67079897508203c8e2198c">len</a>; ++i)
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
   305
<a name="l00284"></a>00284          can_cmd_str &lt;&lt; std::hex &lt;&lt; std::setfill(<span class="charliteral">'0'</span>) &lt;&lt; std::setw(2) &lt;&lt; (<span class="keywordtype">long</span>)m.<a class="code" href="structMessage.html#9f53ff2fea190c14dd66e2c92a32ec45">data</a>[i];
215
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   306
<a name="l00285"></a>00285       }
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   307
<a name="l00286"></a>00286    can_cmd_str &lt;&lt; <span class="charliteral">';'</span>;
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   308
<a name="l00287"></a>00287    can_cmd = can_cmd_str.str();
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   309
<a name="l00288"></a>00288 <span class="preprocessor">#ifdef BOOST_VERSION</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   310
<a name="l00289"></a>00289 <span class="preprocessor"></span>   boost::to_upper(can_cmd);
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   311
<a name="l00290"></a>00290 <span class="preprocessor">#else</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   312
<a name="l00291"></a>00291 <span class="preprocessor"></span>   std::transform(can_cmd.begin(),can_cmd.end(),can_cmd.begin(),::toupper);
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   313
<a name="l00292"></a>00292 <span class="preprocessor">#endif</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   314
<a name="l00293"></a>00293 <span class="preprocessor"></span>   <span class="keywordflow">return</span> <span class="keyword">true</span>;
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   315
<a name="l00294"></a>00294    }
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   316
<a name="l00295"></a>00295 
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   317
<a name="l00296"></a>00296 
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   318
<a name="l00297"></a>00297 <span class="comment">//------------------------------------------------------------------------</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   319
<a name="l00298"></a>00298 <span class="keyword">extern</span> <span class="stringliteral">"C"</span>
240
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
   320
<a name="l00299"></a><a class="code" href="can__uvccm__win32_8cpp.html#b0b7065be05f6d53009b7bd46626e2c0">00299</a>    <a class="code" href="hcs12_2applicfg_8h.html#c2e754635928189b98cf3f5b7e6dbffb">UNS8</a> <a class="code" href="can__lincan_8c.html#b0b7065be05f6d53009b7bd46626e2c0">canReceive_driver</a>(<a class="code" href="unix_2applicfg_8h.html#324227f7b01d51ee83a883174769ac8f">CAN_HANDLE</a> fd0, <a class="code" href="structMessage.html">Message</a> *m)
215
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   321
<a name="l00300"></a>00300    {
240
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
   322
<a name="l00301"></a>00301    <span class="keywordflow">return</span> (<a class="code" href="hcs12_2applicfg_8h.html#c2e754635928189b98cf3f5b7e6dbffb">UNS8</a>)(!(reinterpret_cast&lt;can_uvccm_win32*&gt;(fd0)-&gt;receive(m)));
215
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   323
<a name="l00302"></a>00302    }
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   324
<a name="l00303"></a>00303 
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   325
<a name="l00304"></a>00304 <span class="keyword">extern</span> <span class="stringliteral">"C"</span>
240
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
   326
<a name="l00305"></a><a class="code" href="can__uvccm__win32_8cpp.html#36327c9e0ec6d284b346963a321e3c2b">00305</a>    <a class="code" href="hcs12_2applicfg_8h.html#c2e754635928189b98cf3f5b7e6dbffb">UNS8</a> <a class="code" href="can__lincan_8c.html#36327c9e0ec6d284b346963a321e3c2b">canSend_driver</a>(<a class="code" href="unix_2applicfg_8h.html#324227f7b01d51ee83a883174769ac8f">CAN_HANDLE</a> fd0, <a class="code" href="structMessage.html">Message</a> *m)
215
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   327
<a name="l00306"></a>00306    {
240
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
   328
<a name="l00307"></a>00307    <span class="keywordflow">return</span> (<a class="code" href="hcs12_2applicfg_8h.html#c2e754635928189b98cf3f5b7e6dbffb">UNS8</a>)reinterpret_cast&lt;can_uvccm_win32*&gt;(fd0)-&gt;send(m);
215
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   329
<a name="l00308"></a>00308    }
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   330
<a name="l00309"></a>00309 
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   331
<a name="l00310"></a>00310 <span class="keyword">extern</span> <span class="stringliteral">"C"</span>
240
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
   332
<a name="l00311"></a><a class="code" href="can__uvccm__win32_8cpp.html#a91c5884b47322592815c82427be3fac">00311</a>    <a class="code" href="unix_2applicfg_8h.html#324227f7b01d51ee83a883174769ac8f">CAN_HANDLE</a> <a class="code" href="can__lincan_8c.html#a91c5884b47322592815c82427be3fac">canOpen_driver</a>(<a class="code" href="structstruct__s__BOARD.html">s_BOARD</a> *board)
215
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   333
<a name="l00312"></a>00312    {
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   334
<a name="l00313"></a>00313    <span class="keywordflow">try</span>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   335
<a name="l00314"></a>00314       {
240
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
   336
<a name="l00315"></a>00315       <span class="keywordflow">return</span> (<a class="code" href="unix_2applicfg_8h.html#324227f7b01d51ee83a883174769ac8f">CAN_HANDLE</a>) <span class="keyword">new</span> <a class="code" href="classcan__uvccm__win32.html">can_uvccm_win32</a>(board);
215
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   337
<a name="l00316"></a>00316       }
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   338
<a name="l00317"></a>00317    <span class="keywordflow">catch</span> (<a class="code" href="classcan__uvccm__win32_1_1error.html">can_uvccm_win32::error</a>&amp;)
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   339
<a name="l00318"></a>00318       {
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   340
<a name="l00319"></a>00319       <span class="keywordflow">return</span> NULL;
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   341
<a name="l00320"></a>00320       }
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   342
<a name="l00321"></a>00321    }
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   343
<a name="l00322"></a>00322 
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   344
<a name="l00323"></a>00323 <span class="keyword">extern</span> <span class="stringliteral">"C"</span>
240
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
   345
<a name="l00324"></a><a class="code" href="can__uvccm__win32_8cpp.html#2e54f30ed2522c21b5e4190c234b9e97">00324</a>    <span class="keywordtype">int</span> <a class="code" href="can__lincan_8c.html#d2f4803f3a623c82a4c3e92d4e75e5a5">canClose_driver</a>(<a class="code" href="unix_2applicfg_8h.html#324227f7b01d51ee83a883174769ac8f">CAN_HANDLE</a> inst)
215
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   346
<a name="l00325"></a>00325    {
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   347
<a name="l00326"></a>00326    <span class="keyword">delete</span> reinterpret_cast&lt;can_uvccm_win32*&gt;(inst);
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   348
<a name="l00327"></a>00327    <span class="keywordflow">return</span> 1;
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   349
<a name="l00328"></a>00328    }
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   350
<a name="l00329"></a>00329 
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   351
<a name="l00330"></a>00330 
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   352
<a name="l00331"></a>00331    
240
34654679f262 Udpated doxygen
etisserant
parents: 215
diff changeset
   353
</pre></div><hr size="1"><address style="align: right;"><small>Generated on Mon Jul 2 19:10:16 2007 for CanFestival by&nbsp;
215
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   354
<a href="http://www.doxygen.org/index.html">
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   355
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.1 </small></address>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   356
</body>
f49e5a6b7804 Manual and Documentation finish
nico
parents:
diff changeset
   357
</html>