Project

General

Profile

Statistics
| Revision:

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

History | View | Annotate | Download (9.43 KB)

1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2
<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
3
<title>libwireless: wireless.h Source File</title>
4
<link href="tabs.css" rel="stylesheet" type="text/css">
5
<link href="doxygen.css" rel="stylesheet" type="text/css">
6
</head><body>
7
<!-- Generated by Doxygen 1.5.9 -->
8
<div class="navigation" id="top">
9
  <div class="tabs">
10
    <ul>
11
      <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
12
      <li><a href="modules.html"><span>Modules</span></a></li>
13
      <li><a href="annotated.html"><span>Data&nbsp;Structures</span></a></li>
14
      <li class="current"><a href="files.html"><span>Files</span></a></li>
15
    </ul>
16
  </div>
17
  <div class="tabs">
18
    <ul>
19
      <li><a href="files.html"><span>File&nbsp;List</span></a></li>
20
      <li><a href="globals.html"><span>Globals</span></a></li>
21
    </ul>
22
  </div>
23
<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 
24
<a name="l00035"></a>00035 <span class="preprocessor">#ifndef WIRELESS_H</span>
25
<a name="l00036"></a>00036 <span class="preprocessor"></span><span class="preprocessor">#define WIRELESS_H</span>
26
<a name="l00037"></a>00037 <span class="preprocessor"></span>
27
<a name="l00038"></a>00038 <span class="comment">//Note: If this is raised above 16, we will need to do</span>
28
<a name="l00039"></a>00039 <span class="comment">//something about frame numbers for TX Status packets.</span>
29
<a name="l00043"></a>00043 <span class="comment"></span><span class="comment">//TODO: a PacketGroupHandler is at least 10 bytes (I don't know if function pointers are 2 bytes</span>
30
<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>
31
<a name="l00045"></a>00045 <span class="comment">// Normally that might be fine (the robot's avr chips have 4k SRAM), but austin's chip only has</span>
32
<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>
33
<a name="l00047"></a><a class="code" href="wireless_8h.html#f083cc95511287866eeb4337fdc75eeb">00047</a> <span class="preprocessor">#define WL_MAX_PACKET_GROUPS 16</span>
34
<a name="l00048"></a>00048 <span class="preprocessor"></span>
35
<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>
36
<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>
37
<a name="l00081"></a>00081 <span class="comment">// Thus, pointers should be first, followed by int, followed by char.</span>
38
<a name="l00082"></a><a class="code" href="structPacketGroupHandler.html">00082</a> <span class="keyword">typedef</span> <span class="keyword">struct</span>
39
<a name="l00083"></a>00083 {
40
<a name="l00089"></a>00089   <span class="comment">//TODO: if this number must be less than or equal to WL_MAX_PACKET_GROUPS, don't you only need</span>
41
<a name="l00090"></a>00090   <span class="comment">// one byte for it and it can be made an unsigned char?</span>
42
<a name="l00091"></a><a class="code" href="structPacketGroupHandler.html#f0849c643f1b1e257ccfe96110109950">00091</a>         <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> groupCode;
43
<a name="l00092"></a>00092 
44
<a name="l00097"></a>00097         void (*timeout_handler) (void);
45
<a name="l00098"></a>00098 
46
<a name="l00108"></a>00108         void (*handle_response) (<span class="keywordtype">int</span> frame, <span class="keywordtype">int</span> received);
47
<a name="l00109"></a>00109 
48
<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);
49
<a name="l00120"></a>00120 
50
<a name="l00124"></a>00124         void (*unregister) (void);
51
<a name="l00125"></a>00125 
52
<a name="l00126"></a>00126 } <a class="code" href="structPacketGroupHandler.html">PacketGroupHandler</a>;
53
<a name="l00127"></a>00127 
54
<a name="l00129"></a>00129 <span class="keywordtype">int</span> <a class="code" href="group__wireless.html#gedd4562415e273ce6537f9c1a0f2701b" title="Initialize the wireless library.">wl_init</a>(<span class="keywordtype">void</span>);
55
<a name="l00131"></a>00131 <span class="keywordtype">void</span> <a class="code" href="group__wireless.html#g66075ff87a1c9f2c0d7938a26c7830f2" title="Uninitialize the wireless library.">wl_terminate</a>(<span class="keywordtype">void</span>);
56
<a name="l00133"></a>00133 <span class="keywordtype">void</span> <a class="code" href="group__wireless.html#g5c1f1a0e20fc718e59edc29246afd703" title="Perform wireless library functionality.">wl_do</a>(<span class="keywordtype">void</span>);
57
<a name="l00135"></a>00135 <span class="keywordtype">void</span> <a class="code" href="group__wireless.html#g183343ed0594ec1c2b79bb4085d57107" title="Register a packet group with the wireless library.">wl_register_packet_group</a>(<a class="code" href="structPacketGroupHandler.html">PacketGroupHandler</a>* h);
58
<a name="l00137"></a>00137 <span class="keywordtype">void</span> <a class="code" href="group__wireless.html#gcdbedf6465798abc7af3bf5fea3d4dd7" title="Unregister a packet group with the wireless library.">wl_unregister_packet_group</a>(<a class="code" href="structPacketGroupHandler.html">PacketGroupHandler</a>* h);
59
<a name="l00138"></a>00138 
60
<a name="l00140"></a>00140 <span class="keywordtype">int</span> <a class="code" href="group__wireless.html#g6e841a6ef0504538d8650a0a2f5fa869" 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);
61
<a name="l00142"></a>00142 <span class="keywordtype">int</span> <a class="code" href="group__wireless.html#gf8fbadf62eeb754b98b200328fb7a8be" 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);
62
<a name="l00144"></a>00144 <span class="keywordtype">int</span> <a class="code" href="group__wireless.html#gda6b187ea58cee5aec18725bf7f24b9a" 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);
63
<a name="l00146"></a>00146 <span class="keywordtype">void</span> <a class="code" href="group__wireless.html#g0a1a0e4d885f0e0dde87160a16daa0aa" 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);
64
<a name="l00147"></a>00147 
65
<a name="l00149"></a>00149 <span class="keywordtype">int</span> <a class="code" href="group__wireless.html#g754445d2353a70963a489651cff554c1" title="Set the PAN we are using.">wl_set_pan</a>(<span class="keywordtype">int</span> pan);
66
<a name="l00151"></a>00151 <span class="keywordtype">int</span> <a class="code" href="group__wireless.html#g4e6b5c97d40a8e7557a1b4b90a7d34f7" title="Get the PAN we are using.">wl_get_pan</a>(<span class="keywordtype">void</span>);
67
<a name="l00153"></a>00153 <span class="keywordtype">int</span> <a class="code" href="group__wireless.html#g51d3fe958d44fd92f0e0830ced13139d" title="Set the channel we are using.">wl_set_channel</a>(<span class="keywordtype">int</span> channel);
68
<a name="l00155"></a>00155 <span class="keywordtype">int</span> <a class="code" href="group__wireless.html#g2d65d3e35b193da4213755c4bf61ab6b" title="Get the channel we are using.">wl_get_channel</a>(<span class="keywordtype">void</span>);
69
<a name="l00157"></a>00157 <span class="keywordtype">int</span> <a class="code" href="group__wireless.html#g6c75a84ff5f9a2bdc156aba522d2adf7" title="Get the 16-bit address of the XBee module.">wl_get_xbee_id</a>(<span class="keywordtype">void</span>);
70
<a name="l00159"></a>00159 <span class="keywordtype">void</span> <a class="code" href="group__wireless.html#g344dead0023100eb40f8670a92c9ce5c" title="Set the com port on a computer, undefined on the robot.">wl_set_com_port</a>(<span class="keywordtype">char</span>* port);
71
<a name="l00160"></a>00160  <span class="comment">// end defgroup</span>
72
<a name="l00162"></a>00162 
73
<a name="l00163"></a>00163 <span class="preprocessor">#endif</span>
74
<a name="l00164"></a>00164 <span class="preprocessor"></span>
75
</pre></div></div>
76
<hr size="1"><address style="text-align: right;"><small>Generated on Tue Sep 8 19:59:17 2009 for libwireless by&nbsp;
77
<a href="http://www.doxygen.org/index.html">
78
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.9 </small></address>
79
</body>
80
</html>