18 <h1>/home/epimerde/documents/tc11/CanFestival-3/src/pdo.c File Reference</h1><code>#include "pdo.h"</code><br> |
18 <h1>/home/epimerde/documents/tc11/CanFestival-3/src/pdo.c File Reference</h1><code>#include "pdo.h"</code><br> |
19 <code>#include "objacces.h"</code><br> |
19 <code>#include "objacces.h"</code><br> |
20 <code>#include "canfestival.h"</code><br> |
20 <code>#include "canfestival.h"</code><br> |
21 |
21 |
22 <p> |
22 <p> |
|
23 Include dependency graph for pdo.c:<p><center><img src="pdo_8c__incl.png" border="0" usemap="#/home/epimerde/documents/tc11/CanFestival-3/src/pdo.c_map" alt=""></center> |
|
24 |
|
25 <p> |
23 <a href="pdo_8c-source.html">Go to the source code of this file.</a><table border="0" cellpadding="0" cellspacing="0"> |
26 <a href="pdo_8c-source.html">Go to the source code of this file.</a><table border="0" cellpadding="0" cellspacing="0"> |
24 <tr><td></td></tr> |
27 <tr><td></td></tr> |
25 <tr><td colspan="2"><br><h2>Functions</h2></td></tr> |
28 <tr><td colspan="2"><br><h2>Functions</h2></td></tr> |
26 <tr><td class="memItemLeft" nowrap align="right" valign="top">UNS8 </td><td class="memItemRight" valign="bottom"><a class="el" href="pdo_8c.html#d9a4a4f0a4ef48866c6184ccbd30f210">sendPDO</a> (CO_Data *d, s_PDO pdo, UNS8 req)</td></tr> |
29 <tr><td class="memItemLeft" nowrap align="right" valign="top">UNS8 </td><td class="memItemRight" valign="bottom"><a class="el" href="pdo_8c.html#d9a4a4f0a4ef48866c6184ccbd30f210">sendPDO</a> (CO_Data *d, s_PDO pdo, UNS8 req)</td></tr> |
27 |
30 |
32 <tr><td class="memItemLeft" nowrap align="right" valign="top">UNS8 </td><td class="memItemRight" valign="bottom"><a class="el" href="pdo_8c.html#ae7d661cd3ef7adf93a0d08fdb15b7f2">proceedPDO</a> (CO_Data *d, Message *m)</td></tr> |
35 <tr><td class="memItemLeft" nowrap align="right" valign="top">UNS8 </td><td class="memItemRight" valign="bottom"><a class="el" href="pdo_8c.html#ae7d661cd3ef7adf93a0d08fdb15b7f2">proceedPDO</a> (CO_Data *d, Message *m)</td></tr> |
33 |
36 |
34 <tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="pdo_8c.html#e468510c9f77f502207d961d26389918">CopyBits</a> (UNS8 NbBits, UNS8 *SrcByteIndex, UNS8 SrcBitIndex, UNS8 SrcBigEndian, UNS8 *DestByteIndex, UNS8 DestBitIndex, UNS8 DestBigEndian)</td></tr> |
37 <tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="pdo_8c.html#e468510c9f77f502207d961d26389918">CopyBits</a> (UNS8 NbBits, UNS8 *SrcByteIndex, UNS8 SrcBitIndex, UNS8 SrcBigEndian, UNS8 *DestByteIndex, UNS8 DestBitIndex, UNS8 DestBigEndian)</td></tr> |
35 |
38 |
36 </table> |
39 </table> |
37 <hr><h2>Function Documentation</h2> |
40 <hr><a name="_details"></a><h2>Detailed Description</h2> |
|
41 <dl class="author" compact><dt><b>Author:</b></dt><dd>Edouard TISSERANT and Francis DUPIN </dd></dl> |
|
42 <dl class="date" compact><dt><b>Date:</b></dt><dd>Tue Jun 5 09:32:32 2007 </dd></dl> |
|
43 |
|
44 <p> |
|
45 Definition in file <a class="el" href="pdo_8c-source.html">pdo.c</a>.<hr><h2>Function Documentation</h2> |
38 <a class="anchor" name="e468510c9f77f502207d961d26389918"></a><!-- doxytag: member="pdo.c::CopyBits" ref="e468510c9f77f502207d961d26389918" args="(UNS8 NbBits, UNS8 *SrcByteIndex, UNS8 SrcBitIndex, UNS8 SrcBigEndian, UNS8 *DestByteIndex, UNS8 DestBitIndex, UNS8 DestBigEndian)" --> |
46 <a class="anchor" name="e468510c9f77f502207d961d26389918"></a><!-- doxytag: member="pdo.c::CopyBits" ref="e468510c9f77f502207d961d26389918" args="(UNS8 NbBits, UNS8 *SrcByteIndex, UNS8 SrcBitIndex, UNS8 SrcBigEndian, UNS8 *DestByteIndex, UNS8 DestBitIndex, UNS8 DestBigEndian)" --> |
39 <div class="memitem"> |
47 <div class="memitem"> |
40 <div class="memproto"> |
48 <div class="memproto"> |
41 <table class="memname"> |
49 <table class="memname"> |
42 <tr> |
50 <tr> |
89 </table> |
97 </table> |
90 </div> |
98 </div> |
91 <div class="memdoc"> |
99 <div class="memdoc"> |
92 |
100 |
93 <p> |
101 <p> |
94 |
102 <dl compact><dt><b>Parameters:</b></dt><dd> |
95 <p> |
103 <table border="0" cellspacing="2" cellpadding="0"> |
96 Definition at line <a class="el" href="pdo_8c-source.html#l00376">376</a> of file <a class="el" href="pdo_8c-source.html">pdo.c</a>. |
104 <tr><td valign="top"></td><td valign="top"><em>NbBits</em> </td><td></td></tr> |
|
105 <tr><td valign="top"></td><td valign="top"><em>SrcByteIndex</em> </td><td></td></tr> |
|
106 <tr><td valign="top"></td><td valign="top"><em>SrcBitIndex</em> </td><td></td></tr> |
|
107 <tr><td valign="top"></td><td valign="top"><em>SrcBigEndian</em> </td><td></td></tr> |
|
108 <tr><td valign="top"></td><td valign="top"><em>DestByteIndex</em> </td><td></td></tr> |
|
109 <tr><td valign="top"></td><td valign="top"><em>DestBitIndex</em> </td><td></td></tr> |
|
110 <tr><td valign="top"></td><td valign="top"><em>DestBigEndian</em> </td><td></td></tr> |
|
111 </table> |
|
112 </dl> |
|
113 |
|
114 <p> |
|
115 This loop copy as many bits that it can each time, crossing<p> |
|
116 successively bytes<p> |
|
117 Bit missalignement between src and dest<p> |
|
118 We can now get src and align it to dest<p> |
|
119 Compute the nb of bit we will be able to copy<p> |
|
120 Create a mask that will serve in:<p> |
|
121 <ul> |
|
122 <li>Filtering src</li></ul> |
|
123 <p> |
|
124 <ul> |
|
125 <li>and erase bits where we write, preserve where we don't</li></ul> |
|
126 <p> |
|
127 Then write.<p> |
|
128 Compute next time cursors for src<p> |
|
129 cross boundary ?<p> |
|
130 First bit<p> |
|
131 Next byte<p> |
|
132 Compute next time cursors for dest<p> |
|
133 First bit<p> |
|
134 Next byte<p> |
|
135 And decrement counter. |
|
136 <p> |
|
137 Definition at line <a class="el" href="pdo_8c-source.html#l00430">430</a> of file <a class="el" href="pdo_8c-source.html">pdo.c</a>. |
|
138 <p> |
|
139 Referenced by <a class="el" href="pdo_8c-source.html#l00221">proceedPDO()</a>, and <a class="el" href="sync_8c-source.html#l00141">proceedSYNC()</a>. |
97 </div> |
140 </div> |
98 </div><p> |
141 </div><p> |
99 <a class="anchor" name="298b8291fa35cca22264cf8a70bf138a"></a><!-- doxytag: member="pdo.c::PDOmGR" ref="298b8291fa35cca22264cf8a70bf138a" args="(CO_Data *d, UNS32 cobId)" --> |
142 <a class="anchor" name="298b8291fa35cca22264cf8a70bf138a"></a><!-- doxytag: member="pdo.c::PDOmGR" ref="298b8291fa35cca22264cf8a70bf138a" args="(CO_Data *d, UNS32 cobId)" --> |
100 <div class="memitem"> |
143 <div class="memitem"> |
101 <div class="memproto"> |
144 <div class="memproto"> |
120 </table> |
163 </table> |
121 </div> |
164 </div> |
122 <div class="memdoc"> |
165 <div class="memdoc"> |
123 |
166 |
124 <p> |
167 <p> |
125 |
168 PDO Manager<p> |
126 <p> |
169 <dl compact><dt><b>Parameters:</b></dt><dd> |
127 Definition at line <a class="el" href="pdo_8c-source.html#l00061">61</a> of file <a class="el" href="pdo_8c-source.html">pdo.c</a>. |
170 <table border="0" cellspacing="2" cellpadding="0"> |
128 <p> |
171 <tr><td valign="top"></td><td valign="top"><em>d</em> </td><td></td></tr> |
129 References <a class="el" href="pdo_8c-source.html#l00027">sendPDO()</a>. |
172 <tr><td valign="top"></td><td valign="top"><em>cobId</em> </td><td></td></tr> |
|
173 </table> |
|
174 </dl> |
|
175 <dl class="return" compact><dt><b>Returns:</b></dt><dd></dd></dl> |
|
176 |
|
177 <p> |
|
178 if PDO is waiting for transmission, preparation of the message to send<p> |
|
179 memcpy(&(pdo.data), &(process_var.data), pdo.len); |
|
180 <p> |
|
181 Definition at line <a class="el" href="pdo_8c-source.html#l00079">79</a> of file <a class="el" href="pdo_8c-source.html">pdo.c</a>. |
|
182 <p> |
|
183 References <a class="el" href="pdo_8c-source.html#l00037">sendPDO()</a>. |
|
184 <p> |
|
185 Referenced by <a class="el" href="pdo_8c-source.html#l00221">proceedPDO()</a>, and <a class="el" href="sync_8c-source.html#l00141">proceedSYNC()</a>. |
|
186 <p> |
|
187 Here is the call graph for this function:<p><center><img src="pdo_8c_298b8291fa35cca22264cf8a70bf138a_cgraph.png" border="0" usemap="#pdo_8c_298b8291fa35cca22264cf8a70bf138a_cgraph_map" alt=""></center> |
|
188 <map name="pdo_8c_298b8291fa35cca22264cf8a70bf138a_cgraph_map"> |
|
189 <area href="pdo_8c.html#d9a4a4f0a4ef48866c6184ccbd30f210" shape="rect" coords="140,6,223,30" alt=""> |
|
190 </map> |
|
191 |
130 </div> |
192 </div> |
131 </div><p> |
193 </div><p> |
132 <a class="anchor" name="ae7d661cd3ef7adf93a0d08fdb15b7f2"></a><!-- doxytag: member="pdo.c::proceedPDO" ref="ae7d661cd3ef7adf93a0d08fdb15b7f2" args="(CO_Data *d, Message *m)" --> |
194 <a class="anchor" name="ae7d661cd3ef7adf93a0d08fdb15b7f2"></a><!-- doxytag: member="pdo.c::proceedPDO" ref="ae7d661cd3ef7adf93a0d08fdb15b7f2" args="(CO_Data *d, Message *m)" --> |
133 <div class="memitem"> |
195 <div class="memitem"> |
134 <div class="memproto"> |
196 <div class="memproto"> |
153 </table> |
215 </table> |
154 </div> |
216 </div> |
155 <div class="memdoc"> |
217 <div class="memdoc"> |
156 |
218 |
157 <p> |
219 <p> |
158 |
220 <dl compact><dt><b>Parameters:</b></dt><dd> |
159 <p> |
221 <table border="0" cellspacing="2" cellpadding="0"> |
160 Definition at line <a class="el" href="pdo_8c-source.html#l00187">187</a> of file <a class="el" href="pdo_8c-source.html">pdo.c</a>. |
222 <tr><td valign="top"></td><td valign="top"><em>d</em> </td><td></td></tr> |
161 <p> |
223 <tr><td valign="top"></td><td valign="top"><em>m</em> </td><td></td></tr> |
162 References <a class="el" href="pdo_8c-source.html#l00376">CopyBits()</a>, <a class="el" href="objacces_8c-source.html#l00145">getODentry()</a>, <a class="el" href="pdo_8c-source.html#l00061">PDOmGR()</a>, and <a class="el" href="objacces_8c-source.html#l00257">setODentry()</a>. |
224 </table> |
|
225 </dl> |
|
226 <dl class="return" compact><dt><b>Returns:</b></dt><dd></dd></dl> |
|
227 |
|
228 <p> |
|
229 Number of the mapped varable<p> |
|
230 count of mapped objects...<p> |
|
231 pointer to the var which is mapped to a pdo...<p> |
|
232 void * pMappedAppObject = NULL;<p> |
|
233 pointer fo the var which holds the mapping parameter of an mapping entry<p> |
|
234 pointer to the transmission type<p> |
|
235 The PDO received is not a request.<p> |
|
236 study of all the PDO stored in the dictionary<p> |
|
237 data are stored in process_var array<p> |
|
238 memcpy(&(process_var.data), &m->data, (*m).len);<p> |
|
239 Ce memcpy devrait etre portable<p> |
|
240 get CobId of the dictionary correspondant to the received PDO<p> |
|
241 check the CobId coherance<p> |
|
242 pwCobId is the cobId read in the dictionary at the state 3<p> |
|
243 The cobId is recognized<p> |
|
244 cobId received does not match with those write in the dictionnary<p> |
|
245 Get Mapped Objects Number<p> |
|
246 The cobId of the message received has been found in the dictionnary.<p> |
|
247 Get the addresse of the mapped variable.<p> |
|
248 detail of *pMappingParameter :<p> |
|
249 The 16 hight bits contains the index, the medium 8 bits contains the subindex,<p> |
|
250 and the lower 8 bits contains the size of the mapped variable.<p> |
|
251 copy bit per bit in little endian<p> |
|
252 MSG_WAR(0x3945, " data : ",*((UNS32*)pMappedAppObject));<p> |
|
253 end loop while on mapped variables<p> |
|
254 end switch status<p> |
|
255 end while<p> |
|
256 end if Donnees<p> |
|
257 study of all PDO stored in the objects dictionary<p> |
|
258 check the CobId<p> |
|
259 get CobId of the dictionary which match to the received PDO<p> |
|
260 check transmission type (after request?)<p> |
|
261 The requested PDO is not to send on request. So, does nothing.<p> |
|
262 get mapped objects number<p> |
|
263 Get the mapped variable<p> |
|
264 end while<p> |
|
265 Transmit the PDO<p> |
|
266 end switch status<p> |
|
267 end while<p> |
|
268 end if Requete |
|
269 <p> |
|
270 Definition at line <a class="el" href="pdo_8c-source.html#l00221">221</a> of file <a class="el" href="pdo_8c-source.html">pdo.c</a>. |
|
271 <p> |
|
272 References <a class="el" href="pdo_8c-source.html#l00430">CopyBits()</a>, <a class="el" href="objacces_8c-source.html#l00198">getODentry()</a>, <a class="el" href="pdo_8c-source.html#l00079">PDOmGR()</a>, and <a class="el" href="objacces_8c-source.html#l00350">setODentry()</a>. |
|
273 <p> |
|
274 Referenced by <a class="el" href="states_8c-source.html#l00065">canDispatch()</a>. |
|
275 <p> |
|
276 Here is the call graph for this function:<p><center><img src="pdo_8c_ae7d661cd3ef7adf93a0d08fdb15b7f2_cgraph.png" border="0" usemap="#pdo_8c_ae7d661cd3ef7adf93a0d08fdb15b7f2_cgraph_map" alt=""></center> |
|
277 <map name="pdo_8c_ae7d661cd3ef7adf93a0d08fdb15b7f2_cgraph_map"> |
|
278 <area href="pdo_8c.html#e468510c9f77f502207d961d26389918" shape="rect" coords="171,6,251,30" alt=""> |
|
279 <area href="objacces_8c.html#39c263a4bc5d2d824fefe22fdb4c2dac" shape="rect" coords="162,54,260,78" alt=""> |
|
280 <area href="pdo_8c.html#298b8291fa35cca22264cf8a70bf138a" shape="rect" coords="170,102,252,126" alt=""> |
|
281 <area href="objacces_8c.html#17e598cc1b2e60380e2e4e75afe9b3b0" shape="rect" coords="162,150,260,174" alt=""> |
|
282 <area href="objacces_8c.html#49e9444c8c8d39906a40a153366ed09c" shape="rect" coords="311,54,418,78" alt=""> |
|
283 <area href="objacces_8c.html#75d39b2dadcdb48f7321c6f3766aad26" shape="rect" coords="468,102,636,126" alt=""> |
|
284 <area href="pdo_8c.html#d9a4a4f0a4ef48866c6184ccbd30f210" shape="rect" coords="323,102,406,126" alt=""> |
|
285 <area href="objacces_8c.html#72f69950be4a1352fc78648c71454820" shape="rect" coords="311,150,418,174" alt=""> |
|
286 </map> |
|
287 |
163 </div> |
288 </div> |
164 </div><p> |
289 </div><p> |
165 <a class="anchor" name="d9a4a4f0a4ef48866c6184ccbd30f210"></a><!-- doxytag: member="pdo.c::sendPDO" ref="d9a4a4f0a4ef48866c6184ccbd30f210" args="(CO_Data *d, s_PDO pdo, UNS8 req)" --> |
290 <a class="anchor" name="d9a4a4f0a4ef48866c6184ccbd30f210"></a><!-- doxytag: member="pdo.c::sendPDO" ref="d9a4a4f0a4ef48866c6184ccbd30f210" args="(CO_Data *d, s_PDO pdo, UNS8 req)" --> |
166 <div class="memitem"> |
291 <div class="memitem"> |
167 <div class="memproto"> |
292 <div class="memproto"> |
223 </table> |
350 </table> |
224 </div> |
351 </div> |
225 <div class="memdoc"> |
352 <div class="memdoc"> |
226 |
353 |
227 <p> |
354 <p> |
228 |
355 <dl compact><dt><b>Parameters:</b></dt><dd> |
229 <p> |
356 <table border="0" cellspacing="2" cellpadding="0"> |
230 Definition at line <a class="el" href="pdo_8c-source.html#l00154">154</a> of file <a class="el" href="pdo_8c-source.html">pdo.c</a>. |
357 <tr><td valign="top"></td><td valign="top"><em>d</em> </td><td></td></tr> |
231 <p> |
358 <tr><td valign="top"></td><td valign="top"><em>cobId</em> </td><td></td></tr> |
232 References <a class="el" href="pdo_8c-source.html#l00027">sendPDO()</a>. |
359 </table> |
233 </div> |
360 </dl> |
234 </div><p> |
361 <dl class="return" compact><dt><b>Returns:</b></dt><dd></dd></dl> |
235 <hr size="1"><address style="align: right;"><small>Generated on Mon Jun 4 17:09:27 2007 for CanFestival by |
362 |
|
363 <p> |
|
364 Sending the request only if the cobid have been found on the PDO receive<p> |
|
365 part dictionary<p> |
|
366 get the CobId |
|
367 <p> |
|
368 Definition at line <a class="el" href="pdo_8c-source.html#l00181">181</a> of file <a class="el" href="pdo_8c-source.html">pdo.c</a>. |
|
369 <p> |
|
370 References <a class="el" href="pdo_8c-source.html#l00037">sendPDO()</a>. |
|
371 <p> |
|
372 Here is the call graph for this function:<p><center><img src="pdo_8c_cc08547009d3d2755d2291999941694c_cgraph.png" border="0" usemap="#pdo_8c_cc08547009d3d2755d2291999941694c_cgraph_map" alt=""></center> |
|
373 <map name="pdo_8c_cc08547009d3d2755d2291999941694c_cgraph_map"> |
|
374 <area href="pdo_8c.html#d9a4a4f0a4ef48866c6184ccbd30f210" shape="rect" coords="191,6,273,30" alt=""> |
|
375 </map> |
|
376 |
|
377 </div> |
|
378 </div><p> |
|
379 <hr size="1"><address style="align: right;"><small>Generated on Tue Jun 5 18:32:07 2007 for CanFestival by |
236 <a href="http://www.doxygen.org/index.html"> |
380 <a href="http://www.doxygen.org/index.html"> |
237 <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.1 </small></address> |
381 <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.1 </small></address> |
238 </body> |
382 </body> |
239 </html> |
383 </html> |