Temps-Reel_Lejeune_Robert_L.../software/raspberry/superviseur-robot/lib/doc/html/monitor_8h_source.html

109 lines
20 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Bibliotheques TP RT: monitor.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
$(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectlogo"><img alt="Logo" src="robot-icon.resized.png"/></td>
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">Bibliotheques TP RT
&#160;<span id="projectnumber">1.0</span>
</div>
<div id="projectbrief">Bibliotheque de support pour TP/RT</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('monitor_8h_source.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div class="header">
<div class="headertitle">
<div class="title">monitor.h</div> </div>
</div><!--header-->
<div class="contents">
<a href="monitor_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span>&#160;<span class="comment">/*</span></div><div class="line"><a name="l00002"></a><span class="lineno"> 2</span>&#160;<span class="comment"> * Copyright (C) 2018 dimercur</span></div><div class="line"><a name="l00003"></a><span class="lineno"> 3</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00004"></a><span class="lineno"> 4</span>&#160;<span class="comment"> * This program is free software: you can redistribute it and/or modify</span></div><div class="line"><a name="l00005"></a><span class="lineno"> 5</span>&#160;<span class="comment"> * it under the terms of the GNU General Public License as published by</span></div><div class="line"><a name="l00006"></a><span class="lineno"> 6</span>&#160;<span class="comment"> * the Free Software Foundation, either version 3 of the License, or</span></div><div class="line"><a name="l00007"></a><span class="lineno"> 7</span>&#160;<span class="comment"> * (at your option) any later version.</span></div><div class="line"><a name="l00008"></a><span class="lineno"> 8</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00009"></a><span class="lineno"> 9</span>&#160;<span class="comment"> * This program is distributed in the hope that it will be useful,</span></div><div class="line"><a name="l00010"></a><span class="lineno"> 10</span>&#160;<span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div><div class="line"><a name="l00011"></a><span class="lineno"> 11</span>&#160;<span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the</span></div><div class="line"><a name="l00012"></a><span class="lineno"> 12</span>&#160;<span class="comment"> * GNU General Public License for more details.</span></div><div class="line"><a name="l00013"></a><span class="lineno"> 13</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00014"></a><span class="lineno"> 14</span>&#160;<span class="comment"> * You should have received a copy of the GNU General Public License</span></div><div class="line"><a name="l00015"></a><span class="lineno"> 15</span>&#160;<span class="comment"> * along with this program. If not, see &lt;http://www.gnu.org/licenses/&gt;.</span></div><div class="line"><a name="l00016"></a><span class="lineno"> 16</span>&#160;<span class="comment"> */</span></div><div class="line"><a name="l00017"></a><span class="lineno"> 17</span>&#160;</div><div class="line"><a name="l00026"></a><span class="lineno"> 26</span>&#160;<span class="preprocessor">#ifndef _MONITOR_H_</span></div><div class="line"><a name="l00027"></a><span class="lineno"> 27</span>&#160;<span class="preprocessor">#define _MONITOR_H_</span></div><div class="line"><a name="l00028"></a><span class="lineno"> 28</span>&#160;</div><div class="line"><a name="l00029"></a><span class="lineno"> 29</span>&#160;<span class="preprocessor">#include &lt;sys/types.h&gt;</span></div><div class="line"><a name="l00030"></a><span class="lineno"> 30</span>&#160;<span class="preprocessor">#include &lt;sys/socket.h&gt;</span></div><div class="line"><a name="l00031"></a><span class="lineno"> 31</span>&#160;<span class="preprocessor">#include &lt;netinet/in.h&gt;</span></div><div class="line"><a name="l00032"></a><span class="lineno"> 32</span>&#160;<span class="preprocessor">#include &lt;arpa/inet.h&gt;</span></div><div class="line"><a name="l00033"></a><span class="lineno"> 33</span>&#160;<span class="preprocessor">#include &lt;unistd.h&gt;</span></div><div class="line"><a name="l00034"></a><span class="lineno"> 34</span>&#160;<span class="preprocessor">#include &lt;signal.h&gt;</span></div><div class="line"><a name="l00035"></a><span class="lineno"> 35</span>&#160;<span class="preprocessor">#include &lt;stdlib.h&gt;</span></div><div class="line"><a name="l00036"></a><span class="lineno"> 36</span>&#160;<span class="preprocessor">#include &lt;stdio.h&gt;</span></div><div class="line"><a name="l00037"></a><span class="lineno"> 37</span>&#160;<span class="preprocessor">#include &lt;string.h&gt;</span></div><div class="line"><a name="l00038"></a><span class="lineno"> 38</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="image_8h.html">image.h</a>&quot;</span></div><div class="line"><a name="l00039"></a><span class="lineno"> 39</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="definitions_8h.html">definitions.h</a>&quot;</span></div><div class="line"><a name="l00040"></a><span class="lineno"> 40</span>&#160;</div><div class="line"><a name="l00041"></a><span class="lineno"><a class="line" href="monitor_8h.html#ad62b697bd25a71d171db46740aef2830"> 41</a></span>&#160;<span class="preprocessor">#define HEADER_STM_IMAGE &quot;IMG&quot; // Envoi d&#39;une image</span></div><div class="line"><a name="l00042"></a><span class="lineno"><a class="line" href="monitor_8h.html#a0de226ae5af8b83f3b163ff4413eef95"> 42</a></span>&#160;<span class="preprocessor">#define HEADER_STM_BAT &quot;BAT&quot; // Envoi de l&#39;état de la batterie</span></div><div class="line"><a name="l00043"></a><span class="lineno"><a class="line" href="monitor_8h.html#a6a07aae2539981459edc8070a0f019db"> 43</a></span>&#160;<span class="preprocessor">#define HEADER_STM_POS &quot;POS&quot; // Envoi de la position</span></div><div class="line"><a name="l00044"></a><span class="lineno"><a class="line" href="monitor_8h.html#ac2e64478522da4e3b45c139c0c72557f"> 44</a></span>&#160;<span class="preprocessor">#define HEADER_STM_NO_ACK &quot;NAK&quot; // Acquittement d&#39;un échec</span></div><div class="line"><a name="l00045"></a><span class="lineno"><a class="line" href="monitor_8h.html#af2325d19ae9da4310eb608c744149f53"> 45</a></span>&#160;<span class="preprocessor">#define HEADER_STM_ACK &quot;ACK&quot; // Acquittement d&#39;un succès</span></div><div class="line"><a name="l00046"></a><span class="lineno"><a class="line" href="monitor_8h.html#ac1034bccb09918cccd3ba142377a6788"> 46</a></span>&#160;<span class="preprocessor">#define HEADER_STM_MES &quot;MSG&quot; // Message textuel</span></div><div class="line"><a name="l00047"></a><span class="lineno"><a class="line" href="monitor_8h.html#afe29ce74d16751828da8aec7e13ad06b"> 47</a></span>&#160;<span class="preprocessor">#define HEADER_STM_LOST_DMB &quot;LCD&quot; // Perte de la communication avec le robot</span></div><div class="line"><a name="l00048"></a><span class="lineno"> 48</span>&#160;</div><div class="line"><a name="l00049"></a><span class="lineno"><a class="line" href="monitor_8h.html#a980e8f9457e30018fddcd4d997f17a85"> 49</a></span>&#160;<span class="preprocessor">#define HEADER_MTS_MSG &quot;MSG&quot; // Message directe pour Console Dumber</span></div><div class="line"><a name="l00050"></a><span class="lineno"><a class="line" href="monitor_8h.html#a5ccd30e6502bb94eaa13a597edb1f156"> 50</a></span>&#160;<span class="preprocessor">#define HEADER_MTS_DMB_ORDER &quot;DMB&quot; // Message d&#39;ordre pour le robot</span></div><div class="line"><a name="l00051"></a><span class="lineno"><a class="line" href="monitor_8h.html#a0c829d92889c5c9b2d485964ce933fab"> 51</a></span>&#160;<span class="preprocessor">#define HEADER_MTS_COM_DMB &quot;COM&quot; // Message de gestion de la communication avec le robot</span></div><div class="line"><a name="l00052"></a><span class="lineno"><a class="line" href="monitor_8h.html#a91e2658cf20010646211ba748885c180"> 52</a></span>&#160;<span class="preprocessor">#define HEADER_MTS_CAMERA &quot;CAM&quot; // Message de gestion de la camera</span></div><div class="line"><a name="l00053"></a><span class="lineno"><a class="line" href="monitor_8h.html#a2be30c9a3e65eaf5502b8542a6ac6259"> 53</a></span>&#160;<span class="preprocessor">#define HEADER_MTS_STOP &quot;STO&quot; // Message d&#39;arrêt du system</span></div><div class="line"><a name="l00054"></a><span class="lineno"> 54</span>&#160;</div><div class="line"><a name="l00055"></a><span class="lineno"><a class="line" href="monitor_8h.html#a26769957ec1a2beaf223f33b66ee64ab"> 55</a></span>&#160;<span class="preprocessor">#define INVALID_SOCKET -1</span></div><div class="line"><a name="l00056"></a><span class="lineno"><a class="line" href="monitor_8h.html#a633b0396ff93d336a088412a190a5072"> 56</a></span>&#160;<span class="preprocessor">#define SOCKET_ERROR -1</span></div><div class="line"><a name="l00057"></a><span class="lineno"> 57</span>&#160;</div><div class="line"><a name="l00058"></a><span class="lineno"><a class="line" href="monitor_8h.html#a16b710f592bf8f7900666392adc444dc"> 58</a></span>&#160;<span class="preprocessor">#define DEFAULT_PORT 8080</span></div><div class="line"><a name="l00059"></a><span class="lineno"><a class="line" href="monitor_8h.html#a939612a13947b5bb9fc848e3222a231d"> 59</a></span>&#160;<span class="preprocessor">#define DEFAULT_PARITY 0</span></div><div class="line"><a name="l00060"></a><span class="lineno"> 60</span>&#160;</div><div class="line"><a name="l00061"></a><span class="lineno"><a class="line" href="monitor_8h.html#ab3be9ae187e8b98bb000ca0bca68e982"> 61</a></span>&#160;<span class="preprocessor">#define DETECT_ARENA (1)</span></div><div class="line"><a name="l00062"></a><span class="lineno"><a class="line" href="monitor_8h.html#a22d20ac264e03c59d6941cb11386aa89"> 62</a></span>&#160;<span class="preprocessor">#define CHECK_ARENA (2)</span></div><div class="line"><a name="l00063"></a><span class="lineno"><a class="line" href="monitor_8h.html#a1d58e03abc2a587c7f0a0665c94c0e68"> 63</a></span>&#160;<span class="preprocessor">#define NO_ARENA (3)</span></div><div class="line"><a name="l00064"></a><span class="lineno"> 64</span>&#160;</div><div class="line"><a name="l00065"></a><span class="lineno"><a class="line" href="monitor_8h.html#a2c47b710f0858fe41c544517c6b2a2fd"> 65</a></span>&#160;<span class="preprocessor">#define DEFAULT_NODEJS_PATH &quot;/usr/bin/nodejs&quot;</span></div><div class="line"><a name="l00066"></a><span class="lineno"><a class="line" href="monitor_8h.html#af533d8bd7d6a1d9f9efba3b259280e32"> 66</a></span>&#160;<span class="preprocessor">#define DEFAULT_INTERFACE_FILE &quot;./interface.js&quot;</span></div><div class="line"><a name="l00067"></a><span class="lineno"> 67</span>&#160;</div><div class="line"><a name="l00068"></a><span class="lineno"><a class="line" href="monitor_8h.html#ab6b45251e218af8f09c5d627b5262398"> 68</a></span>&#160;<span class="preprocessor">#define closesocket(param) close(param)</span></div><div class="line"><a name="l00069"></a><span class="lineno"> 69</span>&#160;</div><div class="line"><a name="l00070"></a><span class="lineno"><a class="line" href="monitor_8h.html#a8dc8083897335125630f1af5dafd5831"> 70</a></span>&#160;<span class="keyword">typedef</span> <span class="keywordtype">int</span> <a class="code" href="monitor_8h.html#a8dc8083897335125630f1af5dafd5831">SOCKET</a>;</div><div class="line"><a name="l00071"></a><span class="lineno"><a class="line" href="monitor_8h.html#a29046dc0232f0e5c70adbc25090d77b8"> 71</a></span>&#160;<span class="keyword">typedef</span> <span class="keyword">struct </span>sockaddr_in <a class="code" href="monitor_8h.html#a29046dc0232f0e5c70adbc25090d77b8">SOCKADDR_IN</a>;</div><div class="line"><a name="l00072"></a><span class="lineno"><a class="line" href="monitor_8h.html#ae334b73cedf7204187dce3f817576009"> 72</a></span>&#160;<span class="keyword">typedef</span> <span class="keyword">struct </span>sockaddr <a class="code" href="monitor_8h.html#ae334b73cedf7204187dce3f817576009">SOCKADDR</a>;</div><div class="line"><a name="l00073"></a><span class="lineno"> 73</span>&#160;</div><div class="line"><a name="l00074"></a><span class="lineno"><a class="line" href="struct_message_from_mon.html"> 74</a></span>&#160;<span class="keyword">typedef</span> <span class="keyword">struct </span>{</div><div class="line"><a name="l00075"></a><span class="lineno"><a class="line" href="struct_message_from_mon.html#ad46f6e6dd24be5cb2bc5eae5b3cdd095"> 75</a></span>&#160; <span class="keywordtype">char</span> header[4];</div><div class="line"><a name="l00076"></a><span class="lineno"><a class="line" href="struct_message_from_mon.html#a1aea445500b0fa020a1b08eaff791107"> 76</a></span>&#160; <span class="keywordtype">char</span> data[100];</div><div class="line"><a name="l00077"></a><span class="lineno"> 77</span>&#160;} <a class="code" href="struct_message_from_mon.html">MessageFromMon</a>;</div><div class="line"><a name="l00078"></a><span class="lineno"> 78</span>&#160;</div><div class="line"><a name="l00091"></a><span class="lineno"> 91</span>&#160;<span class="keywordtype">int</span> <a class="code" href="monitor_8h.html#ac3d876b96642b6ee46f6a96b7ffcb864">send_message_to_monitor</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* typeMessage, <span class="keyword">const</span> <span class="keywordtype">void</span> * data = NULL);</div><div class="line"><a name="l00092"></a><span class="lineno"> 92</span>&#160;</div><div class="line"><a name="l00105"></a><span class="lineno"> 105</span>&#160;<span class="keywordtype">int</span> <a class="code" href="monitor_8h.html#a61eca0d5b49118350db39583e1bd1032">receive_message_from_monitor</a>(<span class="keywordtype">char</span> *typeMessage, <span class="keywordtype">char</span> *data);</div><div class="line"><a name="l00106"></a><span class="lineno"> 106</span>&#160;</div><div class="line"><a name="l00107"></a><span class="lineno"> 107</span>&#160;</div><div class="line"><a name="l00108"></a><span class="lineno"> 108</span>&#160;<span class="preprocessor">#endif // _MONITOR_H_</span></div><div class="ttc" id="monitor_8h_html_ac3d876b96642b6ee46f6a96b7ffcb864"><div class="ttname"><a href="monitor_8h.html#ac3d876b96642b6ee46f6a96b7ffcb864">send_message_to_monitor</a></div><div class="ttdeci">int send_message_to_monitor(const char *typeMessage, const void *data=NULL)</div><div class="ttdoc">Envoi d&amp;#39;un message vers l&amp;#39;interface graphique. </div></div>
<div class="ttc" id="monitor_8h_html_a8dc8083897335125630f1af5dafd5831"><div class="ttname"><a href="monitor_8h.html#a8dc8083897335125630f1af5dafd5831">SOCKET</a></div><div class="ttdeci">int SOCKET</div><div class="ttdef"><b>Definition:</b> <a href="monitor_8h_source.html#l00070">monitor.h:70</a></div></div>
<div class="ttc" id="monitor_8h_html_ae334b73cedf7204187dce3f817576009"><div class="ttname"><a href="monitor_8h.html#ae334b73cedf7204187dce3f817576009">SOCKADDR</a></div><div class="ttdeci">struct sockaddr SOCKADDR</div><div class="ttdef"><b>Definition:</b> <a href="monitor_8h_source.html#l00072">monitor.h:72</a></div></div>
<div class="ttc" id="image_8h_html"><div class="ttname"><a href="image_8h.html">image.h</a></div><div class="ttdoc">Functions for image treatment. </div></div>
<div class="ttc" id="monitor_8h_html_a61eca0d5b49118350db39583e1bd1032"><div class="ttname"><a href="monitor_8h.html#a61eca0d5b49118350db39583e1bd1032">receive_message_from_monitor</a></div><div class="ttdeci">int receive_message_from_monitor(char *typeMessage, char *data)</div><div class="ttdoc">Réception d&amp;#39;un message. La fonction est bloquante et retourne par référence le type de message reçu (...</div></div>
<div class="ttc" id="definitions_8h_html"><div class="ttname"><a href="definitions_8h.html">definitions.h</a></div><div class="ttdoc">Various constants used in destjil project. </div></div>
<div class="ttc" id="struct_message_from_mon_html"><div class="ttname"><a href="struct_message_from_mon.html">MessageFromMon</a></div><div class="ttdef"><b>Definition:</b> <a href="monitor_8h_source.html#l00074">monitor.h:74</a></div></div>
<div class="ttc" id="monitor_8h_html_a29046dc0232f0e5c70adbc25090d77b8"><div class="ttname"><a href="monitor_8h.html#a29046dc0232f0e5c70adbc25090d77b8">SOCKADDR_IN</a></div><div class="ttdeci">struct sockaddr_in SOCKADDR_IN</div><div class="ttdef"><b>Definition:</b> <a href="monitor_8h_source.html#l00071">monitor.h:71</a></div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="monitor_8h.html">monitor.h</a></li>
<li class="footer">Generated by
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.13 </li>
</ul>
</div>
</body>
</html>