-
Notifications
You must be signed in to change notification settings - Fork 0
/
_wifi_8h_source.html
120 lines (118 loc) · 16.2 KB
/
_wifi_8h_source.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://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.15"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>myWRIO: C:/Users/jackb/OneDrive - etu.univ-lyon1.fr/TERi/Eclipse/workspace/APIForRIO/src/Wifi.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">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
$(document).ready(initResizable);
/* @license-end */</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="projectalign" style="padding-left: 0.5em;">
<div id="projectname">myWRIO
</div>
<div id="projectbrief">C++ framework for NationalInstruments myRIO</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.15 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
/* @license-end */</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">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('_wifi_8h_source.html','');});
/* @license-end */
</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">Wifi.h</div> </div>
</div><!--header-->
<div class="contents">
<a href="_wifi_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="preprocessor">#ifndef WIFI_H</span></div><div class="line"><a name="l00002"></a><span class="lineno"> 2</span> <span class="preprocessor">#define WIFI_H</span></div><div class="line"><a name="l00003"></a><span class="lineno"> 3</span> </div><div class="line"><a name="l00004"></a><span class="lineno"> 4</span> <span class="preprocessor">#include "<a class="code" href="_my_r_i_o_8h.html">MyRIO.h</a>"</span></div><div class="line"><a name="l00005"></a><span class="lineno"> 5</span> <span class="preprocessor">#include <unistd.h></span> <span class="comment">// read</span></div><div class="line"><a name="l00006"></a><span class="lineno"> 6</span> <span class="preprocessor">#include <sys/socket.h></span> <span class="comment">// bind, connect...</span></div><div class="line"><a name="l00007"></a><span class="lineno"> 7</span> <span class="preprocessor">#include <netinet/in.h></span> <span class="comment">// sockaddr_in</span></div><div class="line"><a name="l00008"></a><span class="lineno"> 8</span> <span class="preprocessor">#include <thread></span></div><div class="line"><a name="l00009"></a><span class="lineno"> 9</span> <span class="preprocessor">#include <iostream></span></div><div class="line"><a name="l00010"></a><span class="lineno"> 10</span> <span class="preprocessor">#include <sys/ioctl.h></span></div><div class="line"><a name="l00011"></a><span class="lineno"> 11</span> <span class="preprocessor">#include <cstdio></span> <span class="comment">// perror</span></div><div class="line"><a name="l00012"></a><span class="lineno"> 12</span> </div><div class="line"><a name="l00013"></a><span class="lineno"> 13</span> <span class="keyword">namespace </span><a class="code" href="namespacemy_r_i_o.html">myRIO</a> {</div><div class="line"><a name="l00014"></a><span class="lineno"> 14</span>  </div><div class="line"><a name="l00018"></a><span class="lineno"><a class="line" href="classmy_r_i_o_1_1_wifi.html"> 18</a></span>  <span class="keyword">class </span><a class="code" href="classmy_r_i_o_1_1_wifi.html">Wifi</a> {</div><div class="line"><a name="l00019"></a><span class="lineno"> 19</span>  <span class="keyword">public</span>:</div><div class="line"><a name="l00020"></a><span class="lineno"> 20</span>  <a class="code" href="classmy_r_i_o_1_1_wifi.html#a0d55054d2eac8e1e94306c9a99f93038">Wifi</a>(std::function<<span class="keywordtype">void</span>(<span class="keywordtype">long</span>)> func);</div><div class="line"><a name="l00021"></a><span class="lineno"> 21</span>  <a class="code" href="classmy_r_i_o_1_1_wifi.html#af9c0bb40082e1b5dd2907be907b94418">~Wifi</a>();</div><div class="line"><a name="l00022"></a><span class="lineno"> 22</span>  </div><div class="line"><a name="l00023"></a><span class="lineno"> 23</span>  <span class="keywordtype">void</span> <a class="code" href="classmy_r_i_o_1_1_wifi.html#a9c8c5b7f171b46f355fd2d9b78e7fcd8">openServer</a>();</div><div class="line"><a name="l00024"></a><span class="lineno"> 24</span>  <span class="keywordtype">bool</span> <a class="code" href="classmy_r_i_o_1_1_wifi.html#a51b2ba0dc0bc3f092daddf3f91981ec1">isConnected</a>();</div><div class="line"><a name="l00025"></a><span class="lineno"> 25</span>  <span class="keywordtype">void</span> <a class="code" href="classmy_r_i_o_1_1_wifi.html#a8b882d9ddaed2bc229cc0083faceb0ff">updateAngle</a>(<span class="keywordtype">short</span> angle);</div><div class="line"><a name="l00026"></a><span class="lineno"> 26</span> </div><div class="line"><a name="l00027"></a><span class="lineno"> 27</span>  <span class="keyword">private</span>:</div><div class="line"><a name="l00028"></a><span class="lineno"><a class="line" href="classmy_r_i_o_1_1_wifi.html#a5adaf0441087239083254b30d4578486"> 28</a></span>  <span class="keywordtype">bool</span> <a class="code" href="classmy_r_i_o_1_1_wifi.html#a5adaf0441087239083254b30d4578486">connected</a>;</div><div class="line"><a name="l00029"></a><span class="lineno"><a class="line" href="classmy_r_i_o_1_1_wifi.html#ad68772f9e9b8f912cbc651a5420e2032"> 29</a></span>  <span class="keywordtype">int</span> <a class="code" href="classmy_r_i_o_1_1_wifi.html#ad68772f9e9b8f912cbc651a5420e2032">_socket</a>;</div><div class="line"><a name="l00030"></a><span class="lineno"><a class="line" href="classmy_r_i_o_1_1_wifi.html#af1d0d5c6f8198756e321a546ed3a9a66"> 30</a></span>  std::thread <a class="code" href="classmy_r_i_o_1_1_wifi.html#af1d0d5c6f8198756e321a546ed3a9a66">_socketThread</a>;</div><div class="line"><a name="l00031"></a><span class="lineno"><a class="line" href="classmy_r_i_o_1_1_wifi.html#aab4d030d3ddadce2a6d51ced68312857"> 31</a></span>  std::function<void(<span class="keywordtype">long</span>)> <a class="code" href="classmy_r_i_o_1_1_wifi.html#aab4d030d3ddadce2a6d51ced68312857">_func</a>; </div><div class="line"><a name="l00033"></a><span class="lineno"> 33</span>  <span class="keywordtype">void</span> <a class="code" href="classmy_r_i_o_1_1_wifi.html#a04a2a03b94991050fb598d4d07125393">writeChar</a>(<span class="keywordtype">char</span> c);</div><div class="line"><a name="l00034"></a><span class="lineno"> 34</span>  <span class="keywordtype">void</span> <a class="code" href="classmy_r_i_o_1_1_wifi.html#ab59ffb5b5559dc559c5824517d8e9695">writeShort</a>(<span class="keywordtype">short</span> s);</div><div class="line"><a name="l00035"></a><span class="lineno"> 35</span>  <span class="keywordtype">void</span> <a class="code" href="classmy_r_i_o_1_1_wifi.html#ab8a5d1351fc452a226d587e6b7799035">writeLong</a>(<span class="keywordtype">long</span> l);</div><div class="line"><a name="l00036"></a><span class="lineno"> 36</span>  };</div><div class="line"><a name="l00037"></a><span class="lineno"> 37</span> }</div><div class="line"><a name="l00038"></a><span class="lineno"> 38</span> </div><div class="line"><a name="l00039"></a><span class="lineno"> 39</span> </div><div class="line"><a name="l00040"></a><span class="lineno"> 40</span> <span class="preprocessor">#endif</span></div><div class="ttc" id="classmy_r_i_o_1_1_wifi_html_aab4d030d3ddadce2a6d51ced68312857"><div class="ttname"><a href="classmy_r_i_o_1_1_wifi.html#aab4d030d3ddadce2a6d51ced68312857">myRIO::Wifi::_func</a></div><div class="ttdeci">std::function< void(long)> _func</div><div class="ttdoc">Function to call when receiving data.</div><div class="ttdef"><b>Definition:</b> <a href="_wifi_8h_source.html#l00031">Wifi.h:31</a></div></div>
<div class="ttc" id="classmy_r_i_o_1_1_wifi_html_a8b882d9ddaed2bc229cc0083faceb0ff"><div class="ttname"><a href="classmy_r_i_o_1_1_wifi.html#a8b882d9ddaed2bc229cc0083faceb0ff">myRIO::Wifi::updateAngle</a></div><div class="ttdeci">void updateAngle(short angle)</div><div class="ttdoc">Send data to the client.</div><div class="ttdef"><b>Definition:</b> <a href="_wifi_8cpp_source.html#l00092">Wifi.cpp:92</a></div></div>
<div class="ttc" id="classmy_r_i_o_1_1_wifi_html_ab59ffb5b5559dc559c5824517d8e9695"><div class="ttname"><a href="classmy_r_i_o_1_1_wifi.html#ab59ffb5b5559dc559c5824517d8e9695">myRIO::Wifi::writeShort</a></div><div class="ttdeci">void writeShort(short s)</div><div class="ttdoc">Write a short to the socket.</div><div class="ttdef"><b>Definition:</b> <a href="_wifi_8cpp_source.html#l00117">Wifi.cpp:117</a></div></div>
<div class="ttc" id="_my_r_i_o_8h_html"><div class="ttname"><a href="_my_r_i_o_8h.html">MyRIO.h</a></div></div>
<div class="ttc" id="classmy_r_i_o_1_1_wifi_html"><div class="ttname"><a href="classmy_r_i_o_1_1_wifi.html">myRIO::Wifi</a></div><div class="ttdoc">Use this class to exchange data via wifi.</div><div class="ttdef"><b>Definition:</b> <a href="_wifi_8h_source.html#l00018">Wifi.h:18</a></div></div>
<div class="ttc" id="classmy_r_i_o_1_1_wifi_html_ab8a5d1351fc452a226d587e6b7799035"><div class="ttname"><a href="classmy_r_i_o_1_1_wifi.html#ab8a5d1351fc452a226d587e6b7799035">myRIO::Wifi::writeLong</a></div><div class="ttdeci">void writeLong(long l)</div><div class="ttdoc">Write a long to the socket.</div><div class="ttdef"><b>Definition:</b> <a href="_wifi_8cpp_source.html#l00125">Wifi.cpp:125</a></div></div>
<div class="ttc" id="classmy_r_i_o_1_1_wifi_html_ad68772f9e9b8f912cbc651a5420e2032"><div class="ttname"><a href="classmy_r_i_o_1_1_wifi.html#ad68772f9e9b8f912cbc651a5420e2032">myRIO::Wifi::_socket</a></div><div class="ttdeci">int _socket</div><div class="ttdef"><b>Definition:</b> <a href="_wifi_8h_source.html#l00029">Wifi.h:29</a></div></div>
<div class="ttc" id="classmy_r_i_o_1_1_wifi_html_a04a2a03b94991050fb598d4d07125393"><div class="ttname"><a href="classmy_r_i_o_1_1_wifi.html#a04a2a03b94991050fb598d4d07125393">myRIO::Wifi::writeChar</a></div><div class="ttdeci">void writeChar(char c)</div><div class="ttdoc">Write a char to the socket.</div><div class="ttdef"><b>Definition:</b> <a href="_wifi_8cpp_source.html#l00109">Wifi.cpp:109</a></div></div>
<div class="ttc" id="classmy_r_i_o_1_1_wifi_html_af9c0bb40082e1b5dd2907be907b94418"><div class="ttname"><a href="classmy_r_i_o_1_1_wifi.html#af9c0bb40082e1b5dd2907be907b94418">myRIO::Wifi::~Wifi</a></div><div class="ttdeci">~Wifi()</div><div class="ttdoc">Close the socket if we are still connected.</div><div class="ttdef"><b>Definition:</b> <a href="_wifi_8cpp_source.html#l00132">Wifi.cpp:132</a></div></div>
<div class="ttc" id="classmy_r_i_o_1_1_wifi_html_a5adaf0441087239083254b30d4578486"><div class="ttname"><a href="classmy_r_i_o_1_1_wifi.html#a5adaf0441087239083254b30d4578486">myRIO::Wifi::connected</a></div><div class="ttdeci">bool connected</div><div class="ttdef"><b>Definition:</b> <a href="_wifi_8h_source.html#l00028">Wifi.h:28</a></div></div>
<div class="ttc" id="classmy_r_i_o_1_1_wifi_html_a51b2ba0dc0bc3f092daddf3f91981ec1"><div class="ttname"><a href="classmy_r_i_o_1_1_wifi.html#a51b2ba0dc0bc3f092daddf3f91981ec1">myRIO::Wifi::isConnected</a></div><div class="ttdeci">bool isConnected()</div><div class="ttdoc">Returns the state of the socket.</div><div class="ttdef"><b>Definition:</b> <a href="_wifi_8cpp_source.html#l00101">Wifi.cpp:101</a></div></div>
<div class="ttc" id="classmy_r_i_o_1_1_wifi_html_af1d0d5c6f8198756e321a546ed3a9a66"><div class="ttname"><a href="classmy_r_i_o_1_1_wifi.html#af1d0d5c6f8198756e321a546ed3a9a66">myRIO::Wifi::_socketThread</a></div><div class="ttdeci">std::thread _socketThread</div><div class="ttdef"><b>Definition:</b> <a href="_wifi_8h_source.html#l00030">Wifi.h:30</a></div></div>
<div class="ttc" id="namespacemy_r_i_o_html"><div class="ttname"><a href="namespacemy_r_i_o.html">myRIO</a></div><div class="ttdef"><b>Definition:</b> <a href="_acc_8h_source.html#l00008">Acc.h:8</a></div></div>
<div class="ttc" id="classmy_r_i_o_1_1_wifi_html_a0d55054d2eac8e1e94306c9a99f93038"><div class="ttname"><a href="classmy_r_i_o_1_1_wifi.html#a0d55054d2eac8e1e94306c9a99f93038">myRIO::Wifi::Wifi</a></div><div class="ttdeci">Wifi(std::function< void(long)> func)</div><div class="ttdoc">Create a Wifi handler.</div><div class="ttdef"><b>Definition:</b> <a href="_wifi_8cpp_source.html#l00012">Wifi.cpp:12</a></div></div>
<div class="ttc" id="classmy_r_i_o_1_1_wifi_html_a9c8c5b7f171b46f355fd2d9b78e7fcd8"><div class="ttname"><a href="classmy_r_i_o_1_1_wifi.html#a9c8c5b7f171b46f355fd2d9b78e7fcd8">myRIO::Wifi::openServer</a></div><div class="ttdeci">void openServer()</div><div class="ttdoc">Create a wifi server.</div><div class="ttdef"><b>Definition:</b> <a href="_wifi_8cpp_source.html#l00026">Wifi.cpp:26</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="dir_98fb12f9c07806436144af22cad486e4.html">Eclipse</a></li><li class="navelem"><a class="el" href="dir_e17da8bc7b823c1f82c904fefd57a078.html">workspace</a></li><li class="navelem"><a class="el" href="dir_814e4b17f8683e03c2431c0e57f58eb6.html">APIForRIO</a></li><li class="navelem"><a class="el" href="dir_c047dd42b8eba02cf6377cb404ab9432.html">src</a></li><li class="navelem"><a class="el" href="_wifi_8h.html">Wifi.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.15 </li>
</ul>
</div>
</body>
</html>