Project

General

Profile

Statistics
| Revision:

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

History | View | Annotate | Download (12.4 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: xbee.c File Reference</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
</div>
27
<div class="contents">
28
<h1>xbee.c File Reference</h1>
29
<p>XBee Interface.  
30
<a href="#_details">More...</a></p>
31
<code>#include &quot;<a class="el" href="xbee_8h_source.html">xbee.h</a>&quot;</code><br/>
32
<code>#include &quot;<a class="el" href="wl__defs_8h_source.html">wl_defs.h</a>&quot;</code><br/>
33
<code>#include &lt;fcntl.h&gt;</code><br/>
34
<code>#include &lt;unistd.h&gt;</code><br/>
35
<code>#include &lt;pthread.h&gt;</code><br/>
36
<code>#include &lt;errno.h&gt;</code><br/>
37
<code>#include &lt;termios.h&gt;</code><br/>
38
<code>#include &lt;stdio.h&gt;</code><br/>
39
<code>#include &lt;stdlib.h&gt;</code><br/>
40
<code>#include &lt;string.h&gt;</code><br/>
41
<table border="0" cellpadding="0" cellspacing="0">
42
<tr><td colspan="2"><h2>Defines</h2></td></tr>
43
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a72aa42b35714e06ac26df31b06a8bf39"></a><!-- doxytag: member="xbee.c::XBEE_FRAME_START" ref="a72aa42b35714e06ac26df31b06a8bf39" args="" -->
44
#define&nbsp;</td><td class="memItemRight" valign="bottom"><b>XBEE_FRAME_START</b>&nbsp;&nbsp;&nbsp;0x7E</td></tr>
45
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="abe7468473089e3cdd2ed85cac2244d49"></a><!-- doxytag: member="xbee.c::XBEE_GET_PACKET_TIMEOUT" ref="abe7468473089e3cdd2ed85cac2244d49" args="" -->
46
#define&nbsp;</td><td class="memItemRight" valign="bottom"><b>XBEE_GET_PACKET_TIMEOUT</b>&nbsp;&nbsp;&nbsp;1000</td></tr>
47
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ae0fc9d7b1078703227c91e1352b708c5"></a><!-- doxytag: member="xbee.c::XBEE_FRAME_STATUS" ref="ae0fc9d7b1078703227c91e1352b708c5" args="" -->
48
#define&nbsp;</td><td class="memItemRight" valign="bottom"><b>XBEE_FRAME_STATUS</b>&nbsp;&nbsp;&nbsp;0x8A</td></tr>
49
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a106780ab66c38464e90af25ae3cc73de"></a><!-- doxytag: member="xbee.c::XBEE_FRAME_AT_COMMAND" ref="a106780ab66c38464e90af25ae3cc73de" args="" -->
50
#define&nbsp;</td><td class="memItemRight" valign="bottom"><b>XBEE_FRAME_AT_COMMAND</b>&nbsp;&nbsp;&nbsp;0x08</td></tr>
51
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aac9e8cc2d9fdda49b77aed7d9380bfde"></a><!-- doxytag: member="xbee.c::XBEE_FRAME_AT_COMMAND_RESPONSE" ref="aac9e8cc2d9fdda49b77aed7d9380bfde" args="" -->
52
#define&nbsp;</td><td class="memItemRight" valign="bottom"><b>XBEE_FRAME_AT_COMMAND_RESPONSE</b>&nbsp;&nbsp;&nbsp;0x88</td></tr>
53
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a31af21123fe9b33803cdf96626776d32"></a><!-- doxytag: member="xbee.c::XBEE_FRAME_TX_REQUEST_64" ref="a31af21123fe9b33803cdf96626776d32" args="" -->
54
#define&nbsp;</td><td class="memItemRight" valign="bottom"><b>XBEE_FRAME_TX_REQUEST_64</b>&nbsp;&nbsp;&nbsp;0x00</td></tr>
55
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a30aa14f9ad880c0bdcd15d7b6dfe4e84"></a><!-- doxytag: member="xbee.c::XBEE_FRAME_TX_REQUEST_16" ref="a30aa14f9ad880c0bdcd15d7b6dfe4e84" args="" -->
56
#define&nbsp;</td><td class="memItemRight" valign="bottom"><b>XBEE_FRAME_TX_REQUEST_16</b>&nbsp;&nbsp;&nbsp;0x01</td></tr>
57
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a301ee4ce1fc94e5c6ccd160a0bfa83a7"></a><!-- doxytag: member="xbee.c::XBEE_FRAME_TX_STATUS" ref="a301ee4ce1fc94e5c6ccd160a0bfa83a7" args="" -->
58
#define&nbsp;</td><td class="memItemRight" valign="bottom"><b>XBEE_FRAME_TX_STATUS</b>&nbsp;&nbsp;&nbsp;XBEE_TX_STATUS</td></tr>
59
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aba621d0a00f41acc7e059b5abf4802ad"></a><!-- doxytag: member="xbee.c::XBEE_FRAME_RX_64" ref="aba621d0a00f41acc7e059b5abf4802ad" args="" -->
60
#define&nbsp;</td><td class="memItemRight" valign="bottom"><b>XBEE_FRAME_RX_64</b>&nbsp;&nbsp;&nbsp;0x80</td></tr>
61
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a5b80e57bcad9ccaa20022e8d4968ec66"></a><!-- doxytag: member="xbee.c::XBEE_FRAME_RX_16" ref="a5b80e57bcad9ccaa20022e8d4968ec66" args="" -->
62
#define&nbsp;</td><td class="memItemRight" valign="bottom"><b>XBEE_FRAME_RX_16</b>&nbsp;&nbsp;&nbsp;XBEE_RX</td></tr>
63
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a63d0ecb125d464ea34524e090648f70f"></a><!-- doxytag: member="xbee.c::XBEE_BUFFER_SIZE" ref="a63d0ecb125d464ea34524e090648f70f" args="" -->
64
#define&nbsp;</td><td class="memItemRight" valign="bottom"><b>XBEE_BUFFER_SIZE</b>&nbsp;&nbsp;&nbsp;128</td></tr>
65
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ab30af815d6e9494361629440f14e3716"></a><!-- doxytag: member="xbee.c::PACKET_BUFFER_SIZE" ref="ab30af815d6e9494361629440f14e3716" args="" -->
66
#define&nbsp;</td><td class="memItemRight" valign="bottom"><b>PACKET_BUFFER_SIZE</b>&nbsp;&nbsp;&nbsp;108</td></tr>
67
<tr><td colspan="2"><h2>Functions</h2></td></tr>
68
<tr><td class="memItemLeft" align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__xbee.html#ga3d5fbb6aae8dda99240ec38108a645af">xbee_lib_init</a> ()</td></tr>
69
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Initialize the XBee library.  <a href="group__xbee.html#ga3d5fbb6aae8dda99240ec38108a645af"></a><br/></td></tr>
70
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__xbee.html#ga9334ac71dca1ddd697b1a35a361ade6a">xbee_terminate</a> ()</td></tr>
71
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Uninitialize the XBee library.  <a href="group__xbee.html#ga9334ac71dca1ddd697b1a35a361ade6a"></a><br/></td></tr>
72
<tr><td class="memItemLeft" align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__xbee.html#ga7c44bc25fda954efde574ee8d735073c">xbee_send_packet</a> (char *packet, int len, int dest, char options, char frame)</td></tr>
73
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Send a packet to the XBee.  <a href="group__xbee.html#ga7c44bc25fda954efde574ee8d735073c"></a><br/></td></tr>
74
<tr><td class="memItemLeft" align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__xbee.html#ga00fbdd9d849171588df736f8b608589d">xbee_get_packet</a> (unsigned char *dest)</td></tr>
75
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Get a packet from the XBee.  <a href="group__xbee.html#ga00fbdd9d849171588df736f8b608589d"></a><br/></td></tr>
76
<tr><td class="memItemLeft" align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__xbee.html#gade50cbefd7ba8d7361ce2654a298748b">xbee_set_pan_id</a> (int id)</td></tr>
77
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Set the PAN ID for the XBee.  <a href="group__xbee.html#gade50cbefd7ba8d7361ce2654a298748b"></a><br/></td></tr>
78
<tr><td class="memItemLeft" align="right" valign="top">unsigned int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__xbee.html#ga7755cd8db87703c9e9943153660b8052">xbee_get_pan_id</a> ()</td></tr>
79
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Get the XBee's PAN ID.  <a href="group__xbee.html#ga7755cd8db87703c9e9943153660b8052"></a><br/></td></tr>
80
<tr><td class="memItemLeft" align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__xbee.html#gab93170c493c5cdfd43a7b640c6ed1d14">xbee_set_channel</a> (int channel)</td></tr>
81
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Set the channel the XBee is currently using.  <a href="group__xbee.html#gab93170c493c5cdfd43a7b640c6ed1d14"></a><br/></td></tr>
82
<tr><td class="memItemLeft" align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__xbee.html#ga133706db81f69ba0a3c169b7a3f42d2a">xbee_get_channel</a> (void)</td></tr>
83
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Get the channel the XBee is currently using.  <a href="group__xbee.html#ga133706db81f69ba0a3c169b7a3f42d2a"></a><br/></td></tr>
84
<tr><td class="memItemLeft" align="right" valign="top">unsigned int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__xbee.html#ga7c53e8a8492494a61ca306875d633309">xbee_get_address</a> ()</td></tr>
85
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Get the XBee's 16-bit address.  <a href="group__xbee.html#ga7c53e8a8492494a61ca306875d633309"></a><br/></td></tr>
86
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga1e9e3c2abf0ff683ca8e591c3851cf0a"></a><!-- doxytag: member="xbee.c::xbee_set_com_port" ref="ga1e9e3c2abf0ff683ca8e591c3851cf0a" args="(char *port)" -->
87
void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__xbee.html#ga1e9e3c2abf0ff683ca8e591c3851cf0a">xbee_set_com_port</a> (char *port)</td></tr>
88
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Set the com port on a computer, undefined on the robot. <br/></td></tr>
89
<tr><td colspan="2"><h2>Variables</h2></td></tr>
90
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a65685824a9cbbc9da05be520d0d80d12"></a><!-- doxytag: member="xbee.c::arrival_buf" ref="a65685824a9cbbc9da05be520d0d80d12" args="[XBEE_BUFFER_SIZE]" -->
91
char&nbsp;</td><td class="memItemRight" valign="bottom"><b>arrival_buf</b> [XBEE_BUFFER_SIZE]</td></tr>
92
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ab7ae7d59f0f2dabc258c678996b59b22"></a><!-- doxytag: member="xbee.c::buffer_last" ref="ab7ae7d59f0f2dabc258c678996b59b22" args="" -->
93
volatile int&nbsp;</td><td class="memItemRight" valign="bottom"><b>buffer_last</b> = 0</td></tr>
94
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aa38080e2a4d6f0497f3c2faf487a0952"></a><!-- doxytag: member="xbee.c::buffer_first" ref="aa38080e2a4d6f0497f3c2faf487a0952" args="" -->
95
volatile int&nbsp;</td><td class="memItemRight" valign="bottom"><b>buffer_first</b> = 0</td></tr>
96
</table>
97
<hr/><a name="_details"></a><h2>Detailed Description</h2>
98
<p>XBee Interface. </p>
99
<p>Copyright (c) 2007 Colony Project</p>
100
<p>Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:</p>
101
<p>The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.</p>
102
<p>THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</p>
103
<p>Implementation of low level communication with the XBee in API mode.</p>
104
<dl class="author"><dt><b>Author:</b></dt><dd>Brian Coltin, Colony Project, CMU Robotics Club </dd></dl>
105
</div>
106
<hr size="1"/><address style="text-align: right;"><small>Generated on Wed Sep 23 12:51:07 2009 for libwireless by&nbsp;
107
<a href="http://www.doxygen.org/index.html">
108
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.1 </small></address>
109
</body>
110
</html>