root / branches / wireless / docs / libwireless / html / wireless_8h_source.html @ 1823
History | View | Annotate | Download (12.6 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.3 -->
|
11 |
<div class="navigation" id="top"> |
12 |
<div class="tabs"> |
13 |
<ul>
|
14 |
<li><a href="index.html"><span>Main Page</span></a></li> |
15 |
<li><a href="modules.html"><span>Modules</span></a></li> |
16 |
<li><a href="annotated.html"><span>Data 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 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="l00036"></a>00036 <span class="preprocessor">#ifndef WIRELESS_H</span> |
28 |
<a name="l00037"></a>00037 <span class="preprocessor"></span><span class="preprocessor">#define WIRELESS_H</span> |
29 |
<a name="l00038"></a>00038 <span class="preprocessor"></span> |
30 |
<a name="l00039"></a>00039 <span class="comment">// need this for C99 int types</span> |
31 |
<a name="l00040"></a>00040 <span class="preprocessor">#ifndef STDINT_H</span> |
32 |
<a name="l00041"></a>00041 <span class="preprocessor"></span><span class="preprocessor">#define STDINT_H</span> |
33 |
<a name="l00042"></a>00042 <span class="preprocessor"></span><span class="preprocessor">#include <stdint.h></span> |
34 |
<a name="l00043"></a>00043 <span class="preprocessor">#endif</span> |
35 |
<a name="l00044"></a>00044 <span class="preprocessor"></span> |
36 |
<a name="l00045"></a>00045 |
37 |
<a name="l00059"></a><a class="code" href="group__wl__defines.html#ga07b76b679f20134d56e04819f746fad6">00059</a> <span class="preprocessor">#define BASIC UINT8_C(0)</span> |
38 |
<a name="l00060"></a>00060 <span class="preprocessor"></span> |
39 |
<a name="l00062"></a><a class="code" href="group__wl__defines.html#ga3de33738fd3c7e77bffbcfaefc3e7645">00062</a> <span class="preprocessor">#define GLOBAL UINT8_C(0)</span> |
40 |
<a name="l00063"></a>00063 <span class="preprocessor"></span> |
41 |
<a name="l00065"></a><a class="code" href="group__wl__defines.html#ga11ed0d4e68673af6d575ed529ddf2130">00065</a> <span class="preprocessor">#define PAN UINT8_C(1)</span> |
42 |
<a name="l00066"></a>00066 <span class="preprocessor"></span> |
43 |
<a name="l00068"></a><a class="code" href="group__wl__defines.html#gac286e1243ab6be2c950c277e5e1377f9">00068</a> <span class="preprocessor">#define BROADCAST UINT16_C(0xFFFF)</span> |
44 |
<a name="l00069"></a>00069 <span class="preprocessor"></span> |
45 |
<a name="l00071"></a><a class="code" href="group__wl__defines.html#ga5bda06b0f5767eeca91b1383c0898c19">00071</a> <span class="preprocessor">#define RELIABLE UINT8_C(0)</span> |
46 |
<a name="l00072"></a>00072 <span class="preprocessor"></span> |
47 |
<a name="l00074"></a><a class="code" href="group__wl__defines.html#ga8091c2bcff55cbe0a4a145fd5fb7c22d">00074</a> <span class="preprocessor">#define FAST UINT8_C(1)</span> |
48 |
<a name="l00075"></a>00075 <span class="preprocessor"></span> |
49 |
<a name="l00077"></a><a class="code" href="group__wl__defines.html#gafd4a10e7cb5b56dd8e5ba8e2cff7ffc3">00077</a> <span class="preprocessor">#define NORMAL_PRIORITY UINT8_C(0)</span> |
50 |
<a name="l00078"></a>00078 <span class="preprocessor"></span> |
51 |
<a name="l00080"></a><a class="code" href="group__wl__defines.html#gaed801c122c559efe4677d351d07747b4">00080</a> <span class="preprocessor">#define HIGH_PRIORITY UINT8_C(1)</span> |
52 |
<a name="l00081"></a>00081 <span class="preprocessor"></span> |
53 |
<a name="l00083"></a><a class="code" href="group__wl__defines.html#gab6aaa08c0bfb6feb3e54a78d9211af56">00083</a> <span class="preprocessor">#define SENDING UINT8_C(0)</span> |
54 |
<a name="l00084"></a>00084 <span class="preprocessor"></span> |
55 |
<a name="l00086"></a><a class="code" href="group__wl__defines.html#ga4dc7574681861c30957f3ffc1fe84f41">00086</a> <span class="preprocessor">#define ACK_OK UINT8_C(1)</span> |
56 |
<a name="l00087"></a>00087 <span class="preprocessor"></span> |
57 |
<a name="l00089"></a><a class="code" href="group__wl__defines.html#gab10c348780c46ce9fdd85ff4c8a2ff82">00089</a> <span class="preprocessor">#define ACK_FAILURE UINT8_C(2)</span> |
58 |
<a name="l00090"></a>00090 <span class="preprocessor"></span> |
59 |
<a name="l00092"></a><a class="code" href="group__wl__defines.html#gab3a749bdf48c98c7d307775cfe0210e1">00092</a> <span class="preprocessor">#define CCA_FAILURE UINT8_C(3)</span> |
60 |
<a name="l00093"></a>00093 <span class="preprocessor"></span> |
61 |
<a name="l00095"></a><a class="code" href="group__wl__defines.html#ga587e21dda1f72be700a6206023ad681b">00095</a> <span class="preprocessor">#define FUNC func</span> |
62 |
<a name="l00096"></a>00096 <span class="preprocessor"></span> |
63 |
<a name="l00098"></a><a class="code" href="group__wl__defines.html#ga8b522c0ddd1f87732ac08225fcc89b58">00098</a> <span class="preprocessor">#define FNPTR void (*FUNC)(uint8_t* data,uint8_t length,uint8_t source)</span> |
64 |
<a name="l00099"></a>00099 <span class="preprocessor"></span> |
65 |
<a name="l00100"></a>00100 <span class="comment">// TODO: this max may be too big b/c the packet handler array stores 3*MAX_PACKET_GROUPS bytes </span> |
66 |
<a name="l00102"></a><a class="code" href="group__wl__defines.html#ga78906957fa456cdea5f330c8a7b119da">00102</a> <span class="comment"></span><span class="preprocessor">#define MAX_PACKET_GROUPS UINT8_C(16)</span> |
67 |
<a name="l00103"></a>00103 <span class="preprocessor"></span> |
68 |
<a name="l00105"></a><a class="code" href="group__wl__defines.html#ga8b043ee766380d099be83d92dc145878">00105</a> <span class="preprocessor">#define INIT_NO UINT8_C(0)</span> |
69 |
<a name="l00106"></a>00106 <span class="preprocessor"></span> |
70 |
<a name="l00108"></a><a class="code" href="group__wl__defines.html#ga0c8854a00a3ee4fb44960b651ffc62b3">00108</a> <span class="preprocessor">#define INIT_YES UINT8_C(1)</span> |
71 |
<a name="l00109"></a>00109 <span class="preprocessor"></span> |
72 |
<a name="l00111"></a><a class="code" href="group__wl__defines.html#ga17d416bf86e0b1b9adcdb92450abca63">00111</a> <span class="preprocessor">#define NUM_RETRIES UINT8_C(3)</span> |
73 |
<a name="l00112"></a>00112 <span class="preprocessor"></span> <span class="comment">// end defines group</span> |
74 |
<a name="l00114"></a>00114 |
75 |
<a name="l00122"></a><a class="code" href="structPacketGroupHandler.html">00122</a> <span class="keyword">typedef</span> <span class="keyword">struct </span>{ |
76 |
<a name="l00123"></a>00123 |
77 |
<a name="l00124"></a>00124 <span class="comment">// function pointer of handler for this packet group</span> |
78 |
<a name="l00125"></a>00125 <a class="code" href="group__wl__defines.html#ga8b522c0ddd1f87732ac08225fcc89b58" title="packet handler function pointer type">FNPTR</a>; |
79 |
<a name="l00126"></a>00126 |
80 |
<a name="l00127"></a>00127 <span class="comment">// priority for this packet group</span> |
81 |
<a name="l00128"></a>00128 uint8_t priority; |
82 |
<a name="l00129"></a>00129 |
83 |
<a name="l00130"></a>00130 } <a class="code" href="structPacketGroupHandler.html">PacketGroupHandler</a>; |
84 |
<a name="l00131"></a>00131 |
85 |
<a name="l00132"></a>00132 |
86 |
<a name="l00136"></a>00136 <span class="comment">// the init function</span> |
87 |
<a name="l00137"></a>00137 |
88 |
<a name="l00139"></a>00139 int8_t <a class="code" href="group__wireless.html#ga6a8d6179b1fe27f762937f0b47af2009" title="Initialize wireless.">wl_init</a>(<span class="keywordtype">void</span>); |
89 |
<a name="l00140"></a>00140 |
90 |
<a name="l00142"></a>00142 int8_t <a class="code" href="group__wireless.html#ga223f437c2bc8ab8a3ac2e0e06841120f" title="Terminate wireless.">wl_terminate</a>(<span class="keywordtype">void</span>); |
91 |
<a name="l00143"></a>00143 |
92 |
<a name="l00144"></a>00144 |
93 |
<a name="l00145"></a>00145 <span class="comment">// the send functions</span> |
94 |
<a name="l00146"></a>00146 |
95 |
<a name="l00148"></a>00148 int16_t <a class="code" href="group__wl__functions.html#gaf713b6ecbf2de78139990a40fe864d5e" title="The core send function. This will take all possible arguments and send all types...">wl_send</a>(uint8_t *data, uint8_t length, uint8_t group, uint8_t scope, uint16_t dest, uint8_t mode); |
96 |
<a name="l00149"></a>00149 |
97 |
<a name="l00151"></a>00151 int16_t <a class="code" href="group__wl__functions.html#gab0af7308304aed74eb281188b712e132" title="Wrapper for core send function that will send a global packet across the current...">wl_send_global</a>(uint8_t *data, uint8_t length, uint8_t group); |
98 |
<a name="l00152"></a>00152 |
99 |
<a name="l00154"></a>00154 int16_t <a class="code" href="group__wl__functions.html#ga85cd4090dd284a4747dc8a56c1b215ad" title="Wrapper for core send function that will send a packet across the current channel...">wl_send_pan</a>(uint8_t *data, uint8_t length, uint8_t group); |
100 |
<a name="l00155"></a>00155 |
101 |
<a name="l00157"></a>00157 int16_t <a class="code" href="group__wl__functions.html#ga49160840045fda872a5e38432cc26988" title="Wrapper for core send function that will send a packet across the current channel...">wl_send_robot</a>(uint8_t *data, uint8_t length, uint8_t group, uint16_t dest, uint8_t mode); |
102 |
<a name="l00158"></a>00158 |
103 |
<a name="l00160"></a>00160 int16_t <a class="code" href="group__wl__functions.html#ga226d89acb4f77a982a2167eb1773eff2" title="Default (i.e. basic) send wrapper.">wl_send_basic</a>(uint8_t *data, uint8_t length); |
104 |
<a name="l00161"></a>00161 |
105 |
<a name="l00162"></a>00162 |
106 |
<a name="l00163"></a>00163 <span class="comment">// the ack function</span> |
107 |
<a name="l00164"></a>00164 |
108 |
<a name="l00166"></a>00166 uint8_t <a class="code" href="group__wl__functions.html#ga15c9a01839696beb05d1e4f161d968b7" title="Returns the number of acknowledgment errors.">wl_ack_error</a>(<span class="keywordtype">void</span>); |
109 |
<a name="l00167"></a>00167 |
110 |
<a name="l00169"></a>00169 int8_t <a class="code" href="group__wl__functions.html#gaa364aa4d9cc8c789f05401e8adf44785" title="Checks a specific packet for the acknowledgement status.">wl_ack_check</a>(uint8_t packet); |
111 |
<a name="l00170"></a>00170 |
112 |
<a name="l00172"></a>00172 <span class="keywordtype">void</span> <a class="code" href="group__wl__functions.html#ga62e126abfcd382ec02524dd2f45a8a7b" title="Resets acknowledgement statistics back to zero.">wl_ack_reset</a>(<span class="keywordtype">void</span>); |
113 |
<a name="l00173"></a>00173 |
114 |
<a name="l00174"></a>00174 |
115 |
<a name="l00175"></a>00175 <span class="comment">// the receive functions</span> |
116 |
<a name="l00176"></a>00176 |
117 |
<a name="l00178"></a>00178 int8_t <a class="code" href="group__wl__functions.html#gaa5a965e3443e4b2b60243225c50ecca7" title="The main receive function. Dispatches packets for registered handlers and returns...">wl_get</a>(<span class="keywordtype">char</span> *data, uint8_t length); |
118 |
<a name="l00179"></a>00179 |
119 |
<a name="l00181"></a>00181 int8_t <a class="code" href="group__wl__functions.html#gae2509e2b6bc61faa26d87b1d87881817" title="Returns the next basic packet if available.">wl_get_basic</a>(<span class="keywordtype">char</span> *data, uint8_t length); |
120 |
<a name="l00182"></a>00182 |
121 |
<a name="l00184"></a>00184 int8_t <a class="code" href="group__wl__functions.html#gae91c1e1940dfbbd063fdcfb86049c64a" title="Dispatches packets for registered handlers.">wl_dispatch</a>(<span class="keywordtype">void</span>); |
122 |
<a name="l00185"></a>00185 |
123 |
<a name="l00186"></a>00186 |
124 |
<a name="l00187"></a>00187 <span class="comment">// the group register function</span> |
125 |
<a name="l00188"></a>00188 |
126 |
<a name="l00190"></a>00190 int8_t <a class="code" href="group__wireless.html#ga7aa57c04f65ff3c8fec591248ab82f86" title="Function to register new packet handlers (for non-default groups only).">wl_register_handler</a>(uint8_t group, <a class="code" href="group__wl__defines.html#ga8b522c0ddd1f87732ac08225fcc89b58" title="packet handler function pointer type">FNPTR</a>, uint8_t priority); |
127 |
<a name="l00191"></a>00191 |
128 |
<a name="l00193"></a>00193 int8_t <a class="code" href="group__wireless.html#ga376508d5682b1b8c88ef8b5f911a3367" title="Function to unregister existing packet handlers (for non-default groups only).">wl_unregister_handler</a>(uint8_t group); |
129 |
<a name="l00194"></a>00194 <span class="comment">//end functions group</span> |
130 |
<a name="l00196"></a>00196 <span class="comment">//end wireless group</span> |
131 |
<a name="l00198"></a>00198 |
132 |
<a name="l00199"></a>00199 <span class="preprocessor">#endif</span> |
133 |
</pre></div></div> |
134 |
<hr class="footer"/><address style="text-align: right;"><small>Generated on Thu May 6 13:17:00 2010 for libwireless by |
135 |
<a href="http://www.doxygen.org/index.html"> |
136 |
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.3 </small></address> |
137 |
</body>
|
138 |
</html>
|