Project

General

Profile

Statistics
| Revision:

root / trunk / docs / libwireless / wireless_8h_source.html @ 1427

History | View | Annotate | Download (9.56 KB)

1
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2
<html xmlns="http://www.w3.org/1999/xhtml">
3
<head>
4
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
5
<title>libwireless: wireless.h Source File</title>
6
<link href="tabs.css" rel="stylesheet" type="text/css"/>
7
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
8
</head>
9
<body>
10
<!-- Generated by Doxygen 1.6.1 -->
11
<div class="navigation" id="top">
12
  <div class="tabs">
13
    <ul>
14
      <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
15
      <li><a href="modules.html"><span>Modules</span></a></li>
16
      <li><a href="annotated.html"><span>Data&nbsp;Structures</span></a></li>
17
      <li class="current"><a href="files.html"><span>Files</span></a></li>
18
    </ul>
19
  </div>
20
  <div class="tabs">
21
    <ul>
22
      <li><a href="files.html"><span>File&nbsp;List</span></a></li>
23
      <li><a href="globals.html"><span>Globals</span></a></li>
24
    </ul>
25
  </div>
26
<h1>wireless.h</h1><a href="wireless_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 
27
<a name="l00035"></a>00035 <span class="preprocessor">#ifndef WIRELESS_H</span>
28
<a name="l00036"></a>00036 <span class="preprocessor"></span><span class="preprocessor">#define WIRELESS_H</span>
29
<a name="l00037"></a>00037 <span class="preprocessor"></span>
30
<a name="l00038"></a>00038 <span class="comment">//Note: If this is raised above 16, we will need to do</span>
31
<a name="l00039"></a>00039 <span class="comment">//something about frame numbers for TX Status packets.</span>
32
<a name="l00043"></a>00043 <span class="comment"></span><span class="comment">//TODO: a PacketGroupHandler is at least 10 bytes (I don&apos;t know if function pointers are 2 bytes</span>
33
<a name="l00044"></a>00044 <span class="comment">// or 4 bytes).  That means that in the c file, your array of packet groups is at least 160 bytes.</span>
34
<a name="l00045"></a>00045 <span class="comment">// Normally that might be fine (the robot&apos;s avr chips have 4k SRAM), but austin&apos;s chip only has</span>
35
<a name="l00046"></a>00046 <span class="comment">// 1k SRAM, so if this number can be reduced or if the size of the struct could be reduced, that would be a plus.</span>
36
<a name="l00047"></a><a class="code" href="wireless_8h.html#af083cc95511287866eeb4337fdc75eeb">00047</a> <span class="preprocessor">#define WL_MAX_PACKET_GROUPS 16</span>
37
<a name="l00048"></a>00048 <span class="preprocessor"></span>
38
<a name="l00079"></a>00079 <span class="comment">//TODO: the order of member variables in this struct should be changed in case the compile packs the struct</span>
39
<a name="l00080"></a>00080 <span class="comment">// In order to achieve the best packing, the variables should be listed in order of decreasing memory size.</span>
40
<a name="l00081"></a>00081 <span class="comment">// Thus, pointers should be first, followed by int, followed by char.</span>
41
<a name="l00082"></a><a class="code" href="structPacketGroupHandler.html">00082</a> <span class="keyword">typedef</span> <span class="keyword">struct</span>
42
<a name="l00083"></a>00083 {
43
<a name="l00089"></a>00089   <span class="comment">//TODO: if this number must be less than or equal to WL_MAX_PACKET_GROUPS, don&apos;t you only need</span>
44
<a name="l00090"></a>00090   <span class="comment">// one byte for it and it can be made an unsigned char?</span>
45
<a name="l00091"></a><a class="code" href="structPacketGroupHandler.html#af0849c643f1b1e257ccfe96110109950">00091</a>         <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> groupCode;
46
<a name="l00092"></a>00092 
47
<a name="l00097"></a>00097         void (*timeout_handler) (void);
48
<a name="l00098"></a>00098 
49
<a name="l00108"></a>00108         void (*handle_response) (<span class="keywordtype">int</span> frame, <span class="keywordtype">int</span> received);
50
<a name="l00109"></a>00109 
51
<a name="l00119"></a>00119         void (*handle_receive) (<span class="keywordtype">char</span> type, <span class="keywordtype">int</span> source, <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span>* packet, <span class="keywordtype">int</span> length);
52
<a name="l00120"></a>00120 
53
<a name="l00124"></a>00124         void (*unregister) (void);
54
<a name="l00125"></a>00125 
55
<a name="l00126"></a>00126 } <a class="code" href="structPacketGroupHandler.html">PacketGroupHandler</a>;
56
<a name="l00127"></a>00127 
57
<a name="l00129"></a>00129 <span class="keywordtype">int</span> <a class="code" href="group__wireless.html#gaedd4562415e273ce6537f9c1a0f2701b" title="Initialize the wireless library.">wl_init</a>(<span class="keywordtype">void</span>);
58
<a name="l00131"></a>00131 <span class="keywordtype">void</span> <a class="code" href="group__wireless.html#ga66075ff87a1c9f2c0d7938a26c7830f2" title="Uninitialize the wireless library.">wl_terminate</a>(<span class="keywordtype">void</span>);
59
<a name="l00133"></a>00133 <span class="keywordtype">void</span> <a class="code" href="group__wireless.html#ga5c1f1a0e20fc718e59edc29246afd703" title="Perform wireless library functionality.">wl_do</a>(<span class="keywordtype">void</span>);
60
<a name="l00135"></a>00135 <span class="keywordtype">void</span> <a class="code" href="group__wireless.html#ga183343ed0594ec1c2b79bb4085d57107" title="Register a packet group with the wireless library.">wl_register_packet_group</a>(<a class="code" href="structPacketGroupHandler.html">PacketGroupHandler</a>* h);
61
<a name="l00137"></a>00137 <span class="keywordtype">void</span> <a class="code" href="group__wireless.html#gacdbedf6465798abc7af3bf5fea3d4dd7" title="Unregister a packet group with the wireless library.">wl_unregister_packet_group</a>(<a class="code" href="structPacketGroupHandler.html">PacketGroupHandler</a>* h);
62
<a name="l00138"></a>00138 
63
<a name="l00140"></a>00140 <span class="keywordtype">int</span> <a class="code" href="group__wireless.html#ga6e841a6ef0504538d8650a0a2f5fa869" title="Send a packet to a specific robot in any PAN.">wl_send_robot_to_robot_global_packet</a>(<span class="keywordtype">char</span> group, <span class="keywordtype">char</span> type, <span class="keywordtype">char</span>* data, <span class="keywordtype">int</span> len, <span class="keywordtype">int</span> dest, <span class="keywordtype">char</span> frame);
64
<a name="l00142"></a>00142 <span class="keywordtype">int</span> <a class="code" href="group__wireless.html#gaf8fbadf62eeb754b98b200328fb7a8be" title="Send a packet to a specific robot in our PAN.">wl_send_robot_to_robot_packet</a>(<span class="keywordtype">char</span> group, <span class="keywordtype">char</span> type, <span class="keywordtype">char</span>* data, <span class="keywordtype">int</span> len, <span class="keywordtype">int</span> dest, <span class="keywordtype">char</span> frame);
65
<a name="l00144"></a>00144 <span class="keywordtype">int</span> <a class="code" href="group__wireless.html#gada6b187ea58cee5aec18725bf7f24b9a" title="Send a packet to all robots.">wl_send_global_packet</a>(<span class="keywordtype">char</span> group, <span class="keywordtype">char</span> type, <span class="keywordtype">char</span>* data, <span class="keywordtype">int</span> len, <span class="keywordtype">char</span> frame);
66
<a name="l00146"></a>00146 <span class="keywordtype">void</span> <a class="code" href="group__wireless.html#ga0a1a0e4d885f0e0dde87160a16daa0aa" title="Send a packet to all robots in our PAN.">wl_send_pan_packet</a>(<span class="keywordtype">char</span> group, <span class="keywordtype">char</span> type, <span class="keywordtype">char</span>* data, <span class="keywordtype">int</span> len, <span class="keywordtype">char</span> frame);
67
<a name="l00147"></a>00147 
68
<a name="l00149"></a>00149 <span class="keywordtype">int</span> <a class="code" href="group__wireless.html#ga754445d2353a70963a489651cff554c1" title="Set the PAN we are using.">wl_set_pan</a>(<span class="keywordtype">int</span> pan);
69
<a name="l00151"></a>00151 <span class="keywordtype">int</span> <a class="code" href="group__wireless.html#ga4e6b5c97d40a8e7557a1b4b90a7d34f7" title="Get the PAN we are using.">wl_get_pan</a>(<span class="keywordtype">void</span>);
70
<a name="l00153"></a>00153 <span class="keywordtype">int</span> <a class="code" href="group__wireless.html#ga51d3fe958d44fd92f0e0830ced13139d" title="Set the channel we are using.">wl_set_channel</a>(<span class="keywordtype">int</span> channel);
71
<a name="l00155"></a>00155 <span class="keywordtype">int</span> <a class="code" href="group__wireless.html#ga2d65d3e35b193da4213755c4bf61ab6b" title="Get the channel we are using.">wl_get_channel</a>(<span class="keywordtype">void</span>);
72
<a name="l00157"></a>00157 <span class="keywordtype">int</span> <a class="code" href="group__wireless.html#ga6c75a84ff5f9a2bdc156aba522d2adf7" title="Get the 16-bit address of the XBee module.">wl_get_xbee_id</a>(<span class="keywordtype">void</span>);
73
<a name="l00159"></a>00159 <span class="keywordtype">void</span> <a class="code" href="group__wireless.html#ga344dead0023100eb40f8670a92c9ce5c" title="Set the com port on a computer, undefined on the robot.">wl_set_com_port</a>(<span class="keywordtype">char</span>* port);
74
<a name="l00160"></a>00160  <span class="comment">// end defgroup</span>
75
<a name="l00162"></a>00162 
76
<a name="l00163"></a>00163 <span class="preprocessor">#endif</span>
77
<a name="l00164"></a>00164 <span class="preprocessor"></span>
78
</pre></div></div>
79
<hr size="1"/><address style="text-align: right;"><small>Generated on Wed Sep 23 12:51:07 2009 for libwireless by&nbsp;
80
<a href="http://www.doxygen.org/index.html">
81
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.1 </small></address>
82
</body>
83
</html>