Revision 1581
editing wireless branch, added error codes and constants
group__xbee.html | ||
---|---|---|
20 | 20 |
<p> |
21 | 21 |
<table border="0" cellpadding="0" cellspacing="0"> |
22 | 22 |
<tr><td></td></tr> |
23 |
<tr><td colspan="2"><br><h2>Modules</h2></td></tr> |
|
24 |
<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__xbee__const.html">xbee constants</a></td></tr> |
|
25 |
|
|
23 | 26 |
<tr><td colspan="2"><br><h2>Functions</h2></td></tr> |
27 |
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__xbee.html#g2fbd69862a11b6bcc5cfdb9f182bcdb9">xbee_send_read_at_command</a> (char *command)</td></tr> |
|
28 |
|
|
24 | 29 |
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__xbee.html#g3d5fbb6aae8dda99240ec38108a645af">xbee_lib_init</a> (void)</td></tr> |
25 | 30 |
|
26 | 31 |
<tr><td class="mdescLeft"> </td><td class="mdescRight">Initialize the XBee library. <a href="#g3d5fbb6aae8dda99240ec38108a645af"></a><br></td></tr> |
27 | 32 |
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__xbee.html#g9334ac71dca1ddd697b1a35a361ade6a">xbee_terminate</a> (void)</td></tr> |
28 | 33 |
|
29 | 34 |
<tr><td class="mdescLeft"> </td><td class="mdescRight">Uninitialize the XBee library. <a href="#g9334ac71dca1ddd697b1a35a361ade6a"></a><br></td></tr> |
35 |
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__xbee.html#g7c44bc25fda954efde574ee8d735073c">xbee_send_packet</a> (char *packet, int len, int dest, char options, char frame)</td></tr> |
|
36 |
|
|
37 |
<tr><td class="mdescLeft"> </td><td class="mdescRight">Send a packet to the XBee. <a href="#g7c44bc25fda954efde574ee8d735073c"></a><br></td></tr> |
|
30 | 38 |
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__xbee.html#g00fbdd9d849171588df736f8b608589d">xbee_get_packet</a> (unsigned char *packet)</td></tr> |
31 | 39 |
|
32 | 40 |
<tr><td class="mdescLeft"> </td><td class="mdescRight">Get a packet from the XBee. <a href="#g00fbdd9d849171588df736f8b608589d"></a><br></td></tr> |
33 |
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__xbee.html#g7c44bc25fda954efde574ee8d735073c">xbee_send_packet</a> (char *packet, int len, int dest, char options, char frame)</td></tr> |
|
34 |
|
|
35 |
<tr><td class="mdescLeft"> </td><td class="mdescRight">Send a packet to the XBee. <a href="#g7c44bc25fda954efde574ee8d735073c"></a><br></td></tr> |
|
36 | 41 |
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__xbee.html#gde50cbefd7ba8d7361ce2654a298748b">xbee_set_pan_id</a> (int id)</td></tr> |
37 | 42 |
|
38 | 43 |
<tr><td class="mdescLeft"> </td><td class="mdescRight">Set the PAN ID for the XBee. <a href="#gde50cbefd7ba8d7361ce2654a298748b"></a><br></td></tr> |
... | ... | |
56 | 61 |
int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__xbee.html#gfcfccfa7323041108202275eba913be7">xbee_reset</a> (void)</td></tr> |
57 | 62 |
|
58 | 63 |
<tr><td class="mdescLeft"> </td><td class="mdescRight">Reset XBee. <br></td></tr> |
64 |
<tr><td colspan="2"><br><h2>Variables</h2></td></tr> |
|
65 |
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g65685824a9cbbc9da05be520d0d80d12"></a><!-- doxytag: member="xbee::arrival_buf" ref="g65685824a9cbbc9da05be520d0d80d12" args="[XBEE_BUFFER_SIZE]" --> |
|
66 |
char </td><td class="memItemRight" valign="bottom"><b>arrival_buf</b> [XBEE_BUFFER_SIZE]</td></tr> |
|
67 |
|
|
68 |
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="gb7ae7d59f0f2dabc258c678996b59b22"></a><!-- doxytag: member="xbee::buffer_last" ref="gb7ae7d59f0f2dabc258c678996b59b22" args="" --> |
|
69 |
volatile int </td><td class="memItemRight" valign="bottom"><b>buffer_last</b> = 0</td></tr> |
|
70 |
|
|
71 |
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ga38080e2a4d6f0497f3c2faf487a0952"></a><!-- doxytag: member="xbee::buffer_first" ref="ga38080e2a4d6f0497f3c2faf487a0952" args="" --> |
|
72 |
volatile int </td><td class="memItemRight" valign="bottom"><b>buffer_first</b> = 0</td></tr> |
|
73 |
|
|
59 | 74 |
</table> |
60 | 75 |
<hr><a name="_details"></a><h2>Detailed Description</h2> |
61 |
Interface with the XBee module. |
|
62 |
<p> |
|
63 | 76 |
Interface with the XBee module. <hr><h2>Function Documentation</h2> |
64 |
<a class="anchor" name="g7c53e8a8492494a61ca306875d633309"></a><!-- doxytag: member="xbee.h::xbee_get_address" ref="g7c53e8a8492494a61ca306875d633309" args="(void)" -->
|
|
77 |
<a class="anchor" name="g7c53e8a8492494a61ca306875d633309"></a><!-- doxytag: member="xbee.c::xbee_get_address" ref="g7c53e8a8492494a61ca306875d633309" args="(void)" -->
|
|
65 | 78 |
<div class="memitem"> |
66 | 79 |
<div class="memproto"> |
67 | 80 |
<table class="memname"> |
68 | 81 |
<tr> |
69 | 82 |
<td class="memname">unsigned int xbee_get_address </td> |
70 | 83 |
<td>(</td> |
71 |
<td class="paramtype">void </td> |
|
72 | 84 |
<td class="paramname"> </td> |
73 | 85 |
<td> ) </td> |
74 | 86 |
<td></td> |
... | ... | |
78 | 90 |
<div class="memdoc"> |
79 | 91 |
|
80 | 92 |
<p> |
81 |
Get the XBee's 16-bit address. |
|
82 |
<p> |
|
83 | 93 |
Get the 16-bit address of the XBee. This is used to specify who to send messages to and who messages are from.<p> |
84 | 94 |
<dl class="return" compact><dt><b>Returns:</b></dt><dd>the 16-bit address of the XBee. </dd></dl> |
85 | 95 |
|
86 | 96 |
</div> |
87 | 97 |
</div><p> |
88 |
<a class="anchor" name="g133706db81f69ba0a3c169b7a3f42d2a"></a><!-- doxytag: member="xbee.h::xbee_get_channel" ref="g133706db81f69ba0a3c169b7a3f42d2a" args="(void)" -->
|
|
98 |
<a class="anchor" name="g133706db81f69ba0a3c169b7a3f42d2a"></a><!-- doxytag: member="xbee.c::xbee_get_channel" ref="g133706db81f69ba0a3c169b7a3f42d2a" args="(void)" -->
|
|
89 | 99 |
<div class="memitem"> |
90 | 100 |
<div class="memproto"> |
91 | 101 |
<table class="memname"> |
... | ... | |
102 | 112 |
<div class="memdoc"> |
103 | 113 |
|
104 | 114 |
<p> |
105 |
Get the channel the XBee is currently using. |
|
106 |
<p> |
|
107 | 115 |
Returns the channel which the XBee is currently using.<p> |
108 | 116 |
<dl class="return" compact><dt><b>Returns:</b></dt><dd>the channel the XBee is using</dd></dl> |
109 | 117 |
<dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="group__xbee.html#gb93170c493c5cdfd43a7b640c6ed1d14" title="Set the channel the XBee is currently using.">xbee_set_channel</a> </dd></dl> |
110 | 118 |
|
111 | 119 |
</div> |
112 | 120 |
</div><p> |
113 |
<a class="anchor" name="g00fbdd9d849171588df736f8b608589d"></a><!-- doxytag: member="xbee.h::xbee_get_packet" ref="g00fbdd9d849171588df736f8b608589d" args="(unsigned char *packet)" -->
|
|
121 |
<a class="anchor" name="g00fbdd9d849171588df736f8b608589d"></a><!-- doxytag: member="xbee.c::xbee_get_packet" ref="g00fbdd9d849171588df736f8b608589d" args="(unsigned char *packet)" -->
|
|
114 | 122 |
<div class="memitem"> |
115 | 123 |
<div class="memproto"> |
116 | 124 |
<table class="memname"> |
... | ... | |
127 | 135 |
<div class="memdoc"> |
128 | 136 |
|
129 | 137 |
<p> |
130 |
Get a packet from the XBee. |
|
131 |
<p> |
|
132 | 138 |
Reads a packet received from the XBee. This function is non-blocking. The resulting packet is stored in dest. Only returns transmission response packets and received packets. The returned packet does not include header information or the checksum. This method also handles special packets dealt with by the XBee library, and so should be called frequently while the XBee is in use.<br> |
133 | 139 |
<br> |
134 | 140 |
<p> |
... | ... | |
157 | 163 |
|
158 | 164 |
</div> |
159 | 165 |
</div><p> |
160 |
<a class="anchor" name="g7755cd8db87703c9e9943153660b8052"></a><!-- doxytag: member="xbee.h::xbee_get_pan_id" ref="g7755cd8db87703c9e9943153660b8052" args="(void)" -->
|
|
166 |
<a class="anchor" name="g7755cd8db87703c9e9943153660b8052"></a><!-- doxytag: member="xbee.c::xbee_get_pan_id" ref="g7755cd8db87703c9e9943153660b8052" args="(void)" -->
|
|
161 | 167 |
<div class="memitem"> |
162 | 168 |
<div class="memproto"> |
163 | 169 |
<table class="memname"> |
164 | 170 |
<tr> |
165 | 171 |
<td class="memname">unsigned int xbee_get_pan_id </td> |
166 | 172 |
<td>(</td> |
167 |
<td class="paramtype">void </td> |
|
168 | 173 |
<td class="paramname"> </td> |
169 | 174 |
<td> ) </td> |
170 | 175 |
<td></td> |
... | ... | |
174 | 179 |
<div class="memdoc"> |
175 | 180 |
|
176 | 181 |
<p> |
177 |
Get the XBee's PAN ID. |
|
178 |
<p> |
|
179 | 182 |
Get the PAN ID for the XBee.<p> |
180 | 183 |
<dl class="return" compact><dt><b>Returns:</b></dt><dd>the personal area network id, or XBEE_PAN_DEFAULT if it has not yet been set. </dd></dl> |
181 | 184 |
|
182 | 185 |
</div> |
183 | 186 |
</div><p> |
184 |
<a class="anchor" name="g3d5fbb6aae8dda99240ec38108a645af"></a><!-- doxytag: member="xbee.h::xbee_lib_init" ref="g3d5fbb6aae8dda99240ec38108a645af" args="(void)" -->
|
|
187 |
<a class="anchor" name="g3d5fbb6aae8dda99240ec38108a645af"></a><!-- doxytag: member="xbee.c::xbee_lib_init" ref="g3d5fbb6aae8dda99240ec38108a645af" args="(void)" -->
|
|
185 | 188 |
<div class="memitem"> |
186 | 189 |
<div class="memproto"> |
187 | 190 |
<table class="memname"> |
188 | 191 |
<tr> |
189 | 192 |
<td class="memname">int xbee_lib_init </td> |
190 | 193 |
<td>(</td> |
191 |
<td class="paramtype">void </td> |
|
192 | 194 |
<td class="paramname"> </td> |
193 | 195 |
<td> ) </td> |
194 | 196 |
<td></td> |
... | ... | |
198 | 200 |
<div class="memdoc"> |
199 | 201 |
|
200 | 202 |
<p> |
201 |
Initialize the XBee library. |
|
202 |
<p> |
|
203 | 203 |
Initializes the XBee library so that other functions may be used. |
204 | 204 |
</div> |
205 | 205 |
</div><p> |
206 |
<a class="anchor" name="g7c44bc25fda954efde574ee8d735073c"></a><!-- doxytag: member="xbee.h::xbee_send_packet" ref="g7c44bc25fda954efde574ee8d735073c" args="(char *packet, int len, int dest, char options, char frame)" -->
|
|
206 |
<a class="anchor" name="g7c44bc25fda954efde574ee8d735073c"></a><!-- doxytag: member="xbee.c::xbee_send_packet" ref="g7c44bc25fda954efde574ee8d735073c" args="(char *packet, int len, int dest, char options, char frame)" -->
|
|
207 | 207 |
<div class="memitem"> |
208 | 208 |
<div class="memproto"> |
209 | 209 |
<table class="memname"> |
... | ... | |
247 | 247 |
<div class="memdoc"> |
248 | 248 |
|
249 | 249 |
<p> |
250 |
Send a packet to the XBee. |
|
251 |
<p> |
|
252 | 250 |
Send the specified packet.<p> |
253 | 251 |
<dl compact><dt><b>Parameters:</b></dt><dd> |
254 | 252 |
<table border="0" cellspacing="2" cellpadding="0"> |
... | ... | |
262 | 260 |
|
263 | 261 |
</div> |
264 | 262 |
</div><p> |
265 |
<a class="anchor" name="gb93170c493c5cdfd43a7b640c6ed1d14"></a><!-- doxytag: member="xbee.h::xbee_set_channel" ref="gb93170c493c5cdfd43a7b640c6ed1d14" args="(int channel)" -->
|
|
263 |
<a class="anchor" name="g2fbd69862a11b6bcc5cfdb9f182bcdb9"></a><!-- doxytag: member="xbee.c::xbee_send_read_at_command" ref="g2fbd69862a11b6bcc5cfdb9f182bcdb9" args="(char *command)" -->
|
|
266 | 264 |
<div class="memitem"> |
267 | 265 |
<div class="memproto"> |
268 | 266 |
<table class="memname"> |
269 | 267 |
<tr> |
268 |
<td class="memname">int xbee_send_read_at_command </td> |
|
269 |
<td>(</td> |
|
270 |
<td class="paramtype">char * </td> |
|
271 |
<td class="paramname"> <em>command</em> </td> |
|
272 |
<td> ) </td> |
|
273 |
<td></td> |
|
274 |
</tr> |
|
275 |
</table> |
|
276 |
</div> |
|
277 |
<div class="memdoc"> |
|
278 |
|
|
279 |
<p> |
|
280 |
Sends an AT command to read a parameter.<p> |
|
281 |
<dl compact><dt><b>Parameters:</b></dt><dd> |
|
282 |
<table border="0" cellspacing="2" cellpadding="0"> |
|
283 |
<tr><td valign="top"></td><td valign="top"><em>command</em> </td><td>the AT command to send. For exmaple, use ID to read the PAN ID and MY to return the XBee ID. See the XBee reference guide for a complete listing. </td></tr> |
|
284 |
</table> |
|
285 |
</dl> |
|
286 |
|
|
287 |
</div> |
|
288 |
</div><p> |
|
289 |
<a class="anchor" name="gb93170c493c5cdfd43a7b640c6ed1d14"></a><!-- doxytag: member="xbee.c::xbee_set_channel" ref="gb93170c493c5cdfd43a7b640c6ed1d14" args="(int channel)" --> |
|
290 |
<div class="memitem"> |
|
291 |
<div class="memproto"> |
|
292 |
<table class="memname"> |
|
293 |
<tr> |
|
270 | 294 |
<td class="memname">int xbee_set_channel </td> |
271 | 295 |
<td>(</td> |
272 | 296 |
<td class="paramtype">int </td> |
... | ... | |
279 | 303 |
<div class="memdoc"> |
280 | 304 |
|
281 | 305 |
<p> |
282 |
Set the channel the XBee is currently using. |
|
283 |
<p> |
|
284 | 306 |
Set the channel the XBee is using.<p> |
285 | 307 |
<dl compact><dt><b>Parameters:</b></dt><dd> |
286 | 308 |
<table border="0" cellspacing="2" cellpadding="0"> |
... | ... | |
291 | 313 |
|
292 | 314 |
</div> |
293 | 315 |
</div><p> |
294 |
<a class="anchor" name="gde50cbefd7ba8d7361ce2654a298748b"></a><!-- doxytag: member="xbee.h::xbee_set_pan_id" ref="gde50cbefd7ba8d7361ce2654a298748b" args="(int id)" -->
|
|
316 |
<a class="anchor" name="gde50cbefd7ba8d7361ce2654a298748b"></a><!-- doxytag: member="xbee.c::xbee_set_pan_id" ref="gde50cbefd7ba8d7361ce2654a298748b" args="(int id)" -->
|
|
295 | 317 |
<div class="memitem"> |
296 | 318 |
<div class="memproto"> |
297 | 319 |
<table class="memname"> |
... | ... | |
308 | 330 |
<div class="memdoc"> |
309 | 331 |
|
310 | 332 |
<p> |
311 |
Set the PAN ID for the XBee. |
|
312 |
<p> |
|
313 | 333 |
Sets the personal area network id.<p> |
314 | 334 |
<dl compact><dt><b>Parameters:</b></dt><dd> |
315 | 335 |
<table border="0" cellspacing="2" cellpadding="0"> |
... | ... | |
319 | 339 |
|
320 | 340 |
</div> |
321 | 341 |
</div><p> |
322 |
<a class="anchor" name="g9334ac71dca1ddd697b1a35a361ade6a"></a><!-- doxytag: member="xbee.h::xbee_terminate" ref="g9334ac71dca1ddd697b1a35a361ade6a" args="(void)" -->
|
|
342 |
<a class="anchor" name="g9334ac71dca1ddd697b1a35a361ade6a"></a><!-- doxytag: member="xbee.c::xbee_terminate" ref="g9334ac71dca1ddd697b1a35a361ade6a" args="(void)" -->
|
|
323 | 343 |
<div class="memitem"> |
324 | 344 |
<div class="memproto"> |
325 | 345 |
<table class="memname"> |
326 | 346 |
<tr> |
327 | 347 |
<td class="memname">void xbee_terminate </td> |
328 | 348 |
<td>(</td> |
329 |
<td class="paramtype">void </td> |
|
330 | 349 |
<td class="paramname"> </td> |
331 | 350 |
<td> ) </td> |
332 | 351 |
<td></td> |
... | ... | |
336 | 355 |
<div class="memdoc"> |
337 | 356 |
|
338 | 357 |
<p> |
339 |
Uninitialize the XBee library. |
|
340 |
<p> |
|
341 | 358 |
Call when finished using the XBee library. This releases all sued resources. |
342 | 359 |
</div> |
343 | 360 |
</div><p> |
344 | 361 |
</div> |
345 |
<hr size="1"><address style="text-align: right;"><small>Generated on Fri Nov 20 21:51:16 2009 for Colony by
|
|
362 |
<hr size="1"><address style="text-align: right;"><small>Generated on Tue Nov 24 12:45:55 2009 for Colony by
|
|
346 | 363 |
<a href="http://www.doxygen.org/index.html"> |
347 | 364 |
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.8 </small></address> |
348 | 365 |
</body> |
Also available in: Unified diff