109 lines
20 KiB
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
|
|
 <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> <span class="comment">/*</span></div><div class="line"><a name="l00002"></a><span class="lineno"> 2</span> <span class="comment"> * Copyright (C) 2018 dimercur</span></div><div class="line"><a name="l00003"></a><span class="lineno"> 3</span> <span class="comment"> *</span></div><div class="line"><a name="l00004"></a><span class="lineno"> 4</span> <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> <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> <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> <span class="comment"> * (at your option) any later version.</span></div><div class="line"><a name="l00008"></a><span class="lineno"> 8</span> <span class="comment"> *</span></div><div class="line"><a name="l00009"></a><span class="lineno"> 9</span> <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> <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> <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> <span class="comment"> * GNU General Public License for more details.</span></div><div class="line"><a name="l00013"></a><span class="lineno"> 13</span> <span class="comment"> *</span></div><div class="line"><a name="l00014"></a><span class="lineno"> 14</span> <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> <span class="comment"> * along with this program. If not, see <http://www.gnu.org/licenses/>.</span></div><div class="line"><a name="l00016"></a><span class="lineno"> 16</span> <span class="comment"> */</span></div><div class="line"><a name="l00017"></a><span class="lineno"> 17</span> </div><div class="line"><a name="l00026"></a><span class="lineno"> 26</span> <span class="preprocessor">#ifndef _MONITOR_H_</span></div><div class="line"><a name="l00027"></a><span class="lineno"> 27</span> <span class="preprocessor">#define _MONITOR_H_</span></div><div class="line"><a name="l00028"></a><span class="lineno"> 28</span> </div><div class="line"><a name="l00029"></a><span class="lineno"> 29</span> <span class="preprocessor">#include <sys/types.h></span></div><div class="line"><a name="l00030"></a><span class="lineno"> 30</span> <span class="preprocessor">#include <sys/socket.h></span></div><div class="line"><a name="l00031"></a><span class="lineno"> 31</span> <span class="preprocessor">#include <netinet/in.h></span></div><div class="line"><a name="l00032"></a><span class="lineno"> 32</span> <span class="preprocessor">#include <arpa/inet.h></span></div><div class="line"><a name="l00033"></a><span class="lineno"> 33</span> <span class="preprocessor">#include <unistd.h></span></div><div class="line"><a name="l00034"></a><span class="lineno"> 34</span> <span class="preprocessor">#include <signal.h></span></div><div class="line"><a name="l00035"></a><span class="lineno"> 35</span> <span class="preprocessor">#include <stdlib.h></span></div><div class="line"><a name="l00036"></a><span class="lineno"> 36</span> <span class="preprocessor">#include <stdio.h></span></div><div class="line"><a name="l00037"></a><span class="lineno"> 37</span> <span class="preprocessor">#include <string.h></span></div><div class="line"><a name="l00038"></a><span class="lineno"> 38</span> <span class="preprocessor">#include "<a class="code" href="image_8h.html">image.h</a>"</span></div><div class="line"><a name="l00039"></a><span class="lineno"> 39</span> <span class="preprocessor">#include "<a class="code" href="definitions_8h.html">definitions.h</a>"</span></div><div class="line"><a name="l00040"></a><span class="lineno"> 40</span> </div><div class="line"><a name="l00041"></a><span class="lineno"><a class="line" href="monitor_8h.html#ad62b697bd25a71d171db46740aef2830"> 41</a></span> <span class="preprocessor">#define HEADER_STM_IMAGE "IMG" // Envoi d'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> <span class="preprocessor">#define HEADER_STM_BAT "BAT" // Envoi de l'é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> <span class="preprocessor">#define HEADER_STM_POS "POS" // 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> <span class="preprocessor">#define HEADER_STM_NO_ACK "NAK" // Acquittement d'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> <span class="preprocessor">#define HEADER_STM_ACK "ACK" // Acquittement d'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> <span class="preprocessor">#define HEADER_STM_MES "MSG" // 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> <span class="preprocessor">#define HEADER_STM_LOST_DMB "LCD" // Perte de la communication avec le robot</span></div><div class="line"><a name="l00048"></a><span class="lineno"> 48</span> </div><div class="line"><a name="l00049"></a><span class="lineno"><a class="line" href="monitor_8h.html#a980e8f9457e30018fddcd4d997f17a85"> 49</a></span> <span class="preprocessor">#define HEADER_MTS_MSG "MSG" // 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> <span class="preprocessor">#define HEADER_MTS_DMB_ORDER "DMB" // Message d'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> <span class="preprocessor">#define HEADER_MTS_COM_DMB "COM" // 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> <span class="preprocessor">#define HEADER_MTS_CAMERA "CAM" // 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> <span class="preprocessor">#define HEADER_MTS_STOP "STO" // Message d'arrêt du system</span></div><div class="line"><a name="l00054"></a><span class="lineno"> 54</span> </div><div class="line"><a name="l00055"></a><span class="lineno"><a class="line" href="monitor_8h.html#a26769957ec1a2beaf223f33b66ee64ab"> 55</a></span> <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> <span class="preprocessor">#define SOCKET_ERROR -1</span></div><div class="line"><a name="l00057"></a><span class="lineno"> 57</span> </div><div class="line"><a name="l00058"></a><span class="lineno"><a class="line" href="monitor_8h.html#a16b710f592bf8f7900666392adc444dc"> 58</a></span> <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> <span class="preprocessor">#define DEFAULT_PARITY 0</span></div><div class="line"><a name="l00060"></a><span class="lineno"> 60</span> </div><div class="line"><a name="l00061"></a><span class="lineno"><a class="line" href="monitor_8h.html#ab3be9ae187e8b98bb000ca0bca68e982"> 61</a></span> <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> <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> <span class="preprocessor">#define NO_ARENA (3)</span></div><div class="line"><a name="l00064"></a><span class="lineno"> 64</span> </div><div class="line"><a name="l00065"></a><span class="lineno"><a class="line" href="monitor_8h.html#a2c47b710f0858fe41c544517c6b2a2fd"> 65</a></span> <span class="preprocessor">#define DEFAULT_NODEJS_PATH "/usr/bin/nodejs"</span></div><div class="line"><a name="l00066"></a><span class="lineno"><a class="line" href="monitor_8h.html#af533d8bd7d6a1d9f9efba3b259280e32"> 66</a></span> <span class="preprocessor">#define DEFAULT_INTERFACE_FILE "./interface.js"</span></div><div class="line"><a name="l00067"></a><span class="lineno"> 67</span> </div><div class="line"><a name="l00068"></a><span class="lineno"><a class="line" href="monitor_8h.html#ab6b45251e218af8f09c5d627b5262398"> 68</a></span> <span class="preprocessor">#define closesocket(param) close(param)</span></div><div class="line"><a name="l00069"></a><span class="lineno"> 69</span> </div><div class="line"><a name="l00070"></a><span class="lineno"><a class="line" href="monitor_8h.html#a8dc8083897335125630f1af5dafd5831"> 70</a></span> <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> <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> <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> </div><div class="line"><a name="l00074"></a><span class="lineno"><a class="line" href="struct_message_from_mon.html"> 74</a></span> <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>  <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>  <span class="keywordtype">char</span> data[100];</div><div class="line"><a name="l00077"></a><span class="lineno"> 77</span> } <a class="code" href="struct_message_from_mon.html">MessageFromMon</a>;</div><div class="line"><a name="l00078"></a><span class="lineno"> 78</span> </div><div class="line"><a name="l00091"></a><span class="lineno"> 91</span> <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> </div><div class="line"><a name="l00105"></a><span class="lineno"> 105</span> <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> </div><div class="line"><a name="l00107"></a><span class="lineno"> 107</span> </div><div class="line"><a name="l00108"></a><span class="lineno"> 108</span> <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&#39;un message vers l&#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&#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>
|