Statistics
| Revision:

root / branches / wireless / docs / libwireless / html / group__xbee.html @ 1823

History | View | Annotate | Download (35.3 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</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&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><a href="files.html"><span>Files</span></a></li>
18
    </ul>
19
  </div>
20
</div>
21
<div class="contents">
22
<h1>XBee</h1>
23
<p>Interface with the XBee module.  
24
<a href="#_details">More...</a></p>
25
<table border="0" cellpadding="0" cellspacing="0">
26
<tr><td colspan="2"><h2>Modules</h2></td></tr>
27
<tr><td class="memItemLeft" align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__xbee__const.html">xbee constants</a></td></tr>
28

    
29
<p><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight"><p>These are constants used for the xbee module. </p>
30
<br/></td></tr>
31
</p>
32
<tr><td class="memItemLeft" align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__xbee__funcs.html">Xbee Functions</a></td></tr>
33

    
34
<p><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight"><p>These are the public xbee functions. </p>
35
<br/></td></tr>
36
</p>
37
<tr><td colspan="2"><h2>Defines</h2></td></tr>
38
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__xbee.html#ga614217d263be1fb1a5f76e2ff7be19a2">PORT</a>&nbsp;&nbsp;&nbsp;UDR1</td></tr>
39
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gaf8bfae90c5d6853fcfb487e05b9f50c8"></a><!-- doxytag: member="xbee::FLAG" ref="gaf8bfae90c5d6853fcfb487e05b9f50c8" args="" -->
40
#define&nbsp;</td><td class="memItemRight" valign="bottom"><b>FLAG</b>&nbsp;&nbsp;&nbsp;(UCSR1A &amp; (1&lt;&lt;RXC1))</td></tr>
41
<tr><td colspan="2"><h2>Functions</h2></td></tr>
42
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gae6e8a8009a9ae0c59f25a496d1cf5a84"></a><!-- doxytag: member="xbee::ISR" ref="gae6e8a8009a9ae0c59f25a496d1cf5a84" args="(USART1_RX_vect)" -->
43
&nbsp;</td><td class="memItemRight" valign="bottom"><b>ISR</b> (USART1_RX_vect)</td></tr>
44
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gafe6b2efc8b84d41b224b65fe9a9b0f70"></a><!-- doxytag: member="xbee::xbee_basic_buf_add" ref="gafe6b2efc8b84d41b224b65fe9a9b0f70" args="(uint8_t *ptr, uint8_t byte)" -->
45
int8_t&nbsp;</td><td class="memItemRight" valign="bottom"><b>xbee_basic_buf_add</b> (uint8_t *ptr, uint8_t byte)</td></tr>
46
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga3aa01c87cec1f5836297de808c82a405"></a><!-- doxytag: member="xbee::xbee_basic_buf_get" ref="ga3aa01c87cec1f5836297de808c82a405" args="(uint8_t *ptr)" -->
47
uint8_t&nbsp;</td><td class="memItemRight" valign="bottom"><b>xbee_basic_buf_get</b> (uint8_t *ptr)</td></tr>
48
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga344c1c7c8bbd9bdb4903d3e9443edbbd"></a><!-- doxytag: member="xbee::xbee_other_buf_add" ref="ga344c1c7c8bbd9bdb4903d3e9443edbbd" args="(uint8_t *ptr, uint8_t byte)" -->
49
int8_t&nbsp;</td><td class="memItemRight" valign="bottom"><b>xbee_other_buf_add</b> (uint8_t *ptr, uint8_t byte)</td></tr>
50
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gac4c5f6ba46371313200945e6456a9942"></a><!-- doxytag: member="xbee::xbee_other_buf_get" ref="gac4c5f6ba46371313200945e6456a9942" args="(uint8_t *ptr)" -->
51
uint8_t&nbsp;</td><td class="memItemRight" valign="bottom"><b>xbee_other_buf_get</b> (uint8_t *ptr)</td></tr>
52
<tr><td class="memItemLeft" align="right" valign="top">int8_t&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__xbee.html#ga335b40b15f89a8a0d26db9226812914e">check_last_receive</a> (uint16_t source, uint8_t framenum)</td></tr>
53
<tr><td class="memItemLeft" align="right" valign="top">uint8_t&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__xbee.html#ga8a4c7ae8201a7ca230fdb47bfa13d044">getStatus</a> (uint8_t mask)</td></tr>
54
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gaff39fc829e5307a35a062bcc6fac616f"></a><!-- doxytag: member="xbee::setStatus" ref="gaff39fc829e5307a35a062bcc6fac616f" args="(uint8_t mask, uint8_t value)" -->
55
void&nbsp;</td><td class="memItemRight" valign="bottom"><b>setStatus</b> (uint8_t mask, uint8_t value)</td></tr>
56
<tr><td class="memItemLeft" align="right" valign="top">int8_t&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__xbee.html#ga31a4df97d6865a40123337045109b9f1">xbee_init</a> ()</td></tr>
57
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Initialize the XBee library.  <a href="#ga31a4df97d6865a40123337045109b9f1"></a><br/></td></tr>
58
<tr><td class="memItemLeft" align="right" valign="top">int8_t&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__xbee.html#ga3fe446135ba896e6438a4fcd67154119">xbee_terminate</a> ()</td></tr>
59
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Uninitialize the XBee library.  <a href="#ga3fe446135ba896e6438a4fcd67154119"></a><br/></td></tr>
60
<tr><td class="memItemLeft" align="right" valign="top">int8_t&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__xbee.html#gaf29617dd4988f4b056f9476004ae5cbf">xbee_putc</a> (uint8_t c)</td></tr>
61
<tr><td class="memItemLeft" align="right" valign="top">int16_t&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__xbee.html#ga409ff62ddd9e22eaf745a50f688263fd">xbee_getc</a> (void)</td></tr>
62
<tr><td class="memItemLeft" align="right" valign="top">int8_t&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__xbee.html#gae564a6f5453934b0234a054fbc238fd3">xbee_getc_nb</a> (uint8_t *c)</td></tr>
63
<tr><td class="memItemLeft" align="right" valign="top">int8_t&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__xbee.html#gae75ee9a54a5811b8bc302dc2d70f0215">xbee_sendc</a> (uint8_t byte)</td></tr>
64
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Send byte to the xbee in API mode.  <a href="#gae75ee9a54a5811b8bc302dc2d70f0215"></a><br/></td></tr>
65
<tr><td class="memItemLeft" align="right" valign="top">int8_t&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__xbee.html#ga5805e267e3b6f4b7bdad7aa6dc65ee04">xbee_send</a> (uint8_t *buf, uint16_t size)</td></tr>
66
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Send an array of bytes to the xbee in API mode.  <a href="#ga5805e267e3b6f4b7bdad7aa6dc65ee04"></a><br/></td></tr>
67
<tr><td class="memItemLeft" align="right" valign="top">int8_t&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__xbee.html#ga2eb96c49811a1d9f2ccd1e1186915077">xbee_checksum_add</a> (uint8_t *buf, uint8_t len, uint8_t *sum)</td></tr>
68
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Add a buffer to the checksum value.  <a href="#ga2eb96c49811a1d9f2ccd1e1186915077"></a><br/></td></tr>
69
<tr><td class="memItemLeft" align="right" valign="top">int8_t&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__xbee.html#ga2a39ffce83d65d22aeefb41dfce2112f">xbee_send_header</a> (uint16_t len)</td></tr>
70
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Send a frame header to the xbee.  <a href="#ga2a39ffce83d65d22aeefb41dfce2112f"></a><br/></td></tr>
71
<tr><td class="memItemLeft" align="right" valign="top">int8_t&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__xbee.html#ga2694f3530e4cf256ff9e96600aea753c">xbee_send_read_at_command</a> (uint8_t *command)</td></tr>
72
<tr><td class="memItemLeft" align="right" valign="top">int8_t&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__xbee.html#gaae54f7208cfa786cb56d4d78ab3ceffe">xbee_send_packet</a> (uint8_t *packet, uint8_t len, uint16_t dest, uint8_t options, uint8_t frame)</td></tr>
73
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Send a packet to the XBee.  <a href="#gaae54f7208cfa786cb56d4d78ab3ceffe"></a><br/></td></tr>
74
<tr><td class="memItemLeft" align="right" valign="top">int8_t&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__xbee.html#gadbcb9cc8cf6afa28e6de8defb33f8196">xbee_set_pan</a> (uint16_t id)</td></tr>
75
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Set the PAN ID for the XBee.  <a href="#gadbcb9cc8cf6afa28e6de8defb33f8196"></a><br/></td></tr>
76
<tr><td class="memItemLeft" align="right" valign="top">uint16_t&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__xbee.html#gaa740c59073c6db9e00a2a2de10a95091">xbee_get_pan</a> ()</td></tr>
77
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Get the XBee's PAN ID.  <a href="#gaa740c59073c6db9e00a2a2de10a95091"></a><br/></td></tr>
78
<tr><td class="memItemLeft" align="right" valign="top">int8_t&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__xbee.html#ga4f67630ca81e5eae064bb58c3818d3fd">xbee_set_channel</a> (uint8_t channel)</td></tr>
79
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Set the channel the XBee is currently using.  <a href="#ga4f67630ca81e5eae064bb58c3818d3fd"></a><br/></td></tr>
80
<tr><td class="memItemLeft" align="right" valign="top">int8_t&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__xbee.html#ga319d4bccd5e6b09d2f377d2170104817">xbee_get_channel</a> (void)</td></tr>
81
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Get the channel the XBee is currently using.  <a href="#ga319d4bccd5e6b09d2f377d2170104817"></a><br/></td></tr>
82
<tr><td class="memItemLeft" align="right" valign="top">uint16_t&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__xbee.html#ga24d751120f5cded06a70d156c29261fc">xbee_get_address</a> (void)</td></tr>
83
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Get the XBee's 16-bit address.  <a href="#ga24d751120f5cded06a70d156c29261fc"></a><br/></td></tr>
84
</table>
85
<hr/><a name="_details"></a><h2>Detailed Description</h2>
86
<p>Interface with the XBee module. </p>
87
<hr/><h2>Define Documentation</h2>
88
<a class="anchor" id="ga614217d263be1fb1a5f76e2ff7be19a2"></a><!-- doxytag: member="xbee.c::PORT" ref="ga614217d263be1fb1a5f76e2ff7be19a2" args="" -->
89
<div class="memitem">
90
<div class="memproto">
91
      <table class="memname">
92
        <tr>
93
          <td class="memname">#define PORT&nbsp;&nbsp;&nbsp;UDR1</td>
94
        </tr>
95
      </table>
96
</div>
97
<div class="memdoc">
98
<p>Interrupt for the robot. Adds bytes received from the xbee to the buffer. </p>
99

    
100
</div>
101
</div>
102
<hr/><h2>Function Documentation</h2>
103
<a class="anchor" id="ga335b40b15f89a8a0d26db9226812914e"></a><!-- doxytag: member="xbee.c::check_last_receive" ref="ga335b40b15f89a8a0d26db9226812914e" args="(uint16_t source, uint8_t framenum)" -->
104
<div class="memitem">
105
<div class="memproto">
106
      <table class="memname">
107
        <tr>
108
          <td class="memname">int8_t check_last_receive </td>
109
          <td>(</td>
110
          <td class="paramtype">uint16_t&nbsp;</td>
111
          <td class="paramname"> <em>source</em>, </td>
112
        </tr>
113
        <tr>
114
          <td class="paramkey"></td>
115
          <td></td>
116
          <td class="paramtype">uint8_t&nbsp;</td>
117
          <td class="paramname"> <em>framenum</em></td><td>&nbsp;</td>
118
        </tr>
119
        <tr>
120
          <td></td>
121
          <td>)</td>
122
          <td></td><td></td><td></td>
123
        </tr>
124
      </table>
125
</div>
126
<div class="memdoc">
127
<p>Checks if packet is a duplicate </p>
128

    
129
<p>References <a class="el" href="xbee_8c_source.html#l00722">getStatus()</a>, and <a class="el" href="wl__defs_8h_source.html#l00069">WL_SUCCESS</a>.</p>
130

    
131
</div>
132
</div>
133
<a class="anchor" id="ga8a4c7ae8201a7ca230fdb47bfa13d044"></a><!-- doxytag: member="xbee.c::getStatus" ref="ga8a4c7ae8201a7ca230fdb47bfa13d044" args="(uint8_t mask)" -->
134
<div class="memitem">
135
<div class="memproto">
136
      <table class="memname">
137
        <tr>
138
          <td class="memname">uint8_t getStatus </td>
139
          <td>(</td>
140
          <td class="paramtype">uint8_t&nbsp;</td>
141
          <td class="paramname"> <em>mask</em></td>
142
          <td>&nbsp;)&nbsp;</td>
143
          <td><code> [inline]</code></td>
144
        </tr>
145
      </table>
146
</div>
147
<div class="memdoc">
148
<p>status functions </p>
149

    
150
<p>Referenced by <a class="el" href="xbee_8c_source.html#l00685">check_last_receive()</a>, <a class="el" href="xbee_8c_source.html#l01725">xbee_get_address()</a>, <a class="el" href="xbee_8c_source.html#l01693">xbee_get_channel()</a>, <a class="el" href="xbee_8c_source.html#l01621">xbee_get_pan()</a>, <a class="el" href="xbee_8c_source.html#l00729">xbee_init()</a>, <a class="el" href="xbee_8c_source.html#l01015">xbee_sendc()</a>, <a class="el" href="xbee_8c_source.html#l01655">xbee_set_channel()</a>, and <a class="el" href="xbee_8c_source.html#l01586">xbee_set_pan()</a>.</p>
151

    
152
</div>
153
</div>
154
<a class="anchor" id="ga2eb96c49811a1d9f2ccd1e1186915077"></a><!-- doxytag: member="xbee.c::xbee_checksum_add" ref="ga2eb96c49811a1d9f2ccd1e1186915077" args="(uint8_t *buf, uint8_t len, uint8_t *sum)" -->
155
<div class="memitem">
156
<div class="memproto">
157
      <table class="memname">
158
        <tr>
159
          <td class="memname">int8_t xbee_checksum_add </td>
160
          <td>(</td>
161
          <td class="paramtype">uint8_t *&nbsp;</td>
162
          <td class="paramname"> <em>buf</em>, </td>
163
        </tr>
164
        <tr>
165
          <td class="paramkey"></td>
166
          <td></td>
167
          <td class="paramtype">uint8_t&nbsp;</td>
168
          <td class="paramname"> <em>len</em>, </td>
169
        </tr>
170
        <tr>
171
          <td class="paramkey"></td>
172
          <td></td>
173
          <td class="paramtype">uint8_t *&nbsp;</td>
174
          <td class="paramname"> <em>sum</em></td><td>&nbsp;</td>
175
        </tr>
176
        <tr>
177
          <td></td>
178
          <td>)</td>
179
          <td></td><td></td><td></td>
180
        </tr>
181
      </table>
182
</div>
183
<div class="memdoc">
184

    
185
<p>Add a buffer to the checksum value. </p>
186
<p>Adds buf to the previous checksum total</p>
187
<dl><dt><b>Parameters:</b></dt><dd>
188
  <table border="0" cellspacing="2" cellpadding="0">
189
    <tr><td valign="top"></td><td valign="top"><em>buf</em>&nbsp;</td><td>a byte buffer to add to the checksum </td></tr>
190
    <tr><td valign="top"></td><td valign="top"><em>len</em>&nbsp;</td><td>the length of the buffer </td></tr>
191
    <tr><td valign="top"></td><td valign="top"><em>sum</em>&nbsp;</td><td>the previous sum</td></tr>
192
  </table>
193
  </dd>
194
</dl>
195
<dl class="return"><dt><b>Returns:</b></dt><dd>error code </dd></dl>
196

    
197
<p>References <a class="el" href="wl__defs_8h_source.html#l00090">WL_ERROR_ARGUMENT</a>, and <a class="el" href="wl__defs_8h_source.html#l00069">WL_SUCCESS</a>.</p>
198

    
199
<p>Referenced by <a class="el" href="wireless__send_8c_source.html#l00091">wl_send()</a>.</p>
200

    
201
</div>
202
</div>
203
<a class="anchor" id="ga24d751120f5cded06a70d156c29261fc"></a><!-- doxytag: member="xbee.c::xbee_get_address" ref="ga24d751120f5cded06a70d156c29261fc" args="(void)" -->
204
<div class="memitem">
205
<div class="memproto">
206
      <table class="memname">
207
        <tr>
208
          <td class="memname">uint16_t xbee_get_address </td>
209
          <td>(</td>
210
          <td class="paramtype">void&nbsp;</td>
211
          <td class="paramname"></td>
212
          <td>&nbsp;)&nbsp;</td>
213
          <td></td>
214
        </tr>
215
      </table>
216
</div>
217
<div class="memdoc">
218

    
219
<p>Get the XBee's 16-bit address. </p>
220
<p>Get the 16-bit address of the XBee. This is used to specify who to send messages to and who messages are from.</p>
221
<dl class="return"><dt><b>Returns:</b></dt><dd>the 16-bit address of the XBee. </dd></dl>
222

    
223
<p>References <a class="el" href="xbee_8c_source.html#l00722">getStatus()</a>, <a class="el" href="wl__defs_8h_source.html#l00117">WL_ERROR_XBEE_COMMAND_16BIT</a>, and <a class="el" href="xbee_8c_source.html#l01380">xbee_send_read_at_command()</a>.</p>
224

    
225
<p>Referenced by <a class="el" href="xbee_8c_source.html#l00729">xbee_init()</a>.</p>
226

    
227
</div>
228
</div>
229
<a class="anchor" id="ga319d4bccd5e6b09d2f377d2170104817"></a><!-- doxytag: member="xbee.c::xbee_get_channel" ref="ga319d4bccd5e6b09d2f377d2170104817" args="(void)" -->
230
<div class="memitem">
231
<div class="memproto">
232
      <table class="memname">
233
        <tr>
234
          <td class="memname">int8_t xbee_get_channel </td>
235
          <td>(</td>
236
          <td class="paramtype">void&nbsp;</td>
237
          <td class="paramname"></td>
238
          <td>&nbsp;)&nbsp;</td>
239
          <td></td>
240
        </tr>
241
      </table>
242
</div>
243
<div class="memdoc">
244

    
245
<p>Get the channel the XBee is currently using. </p>
246
<p>Returns the channel which the XBee is currently using.</p>
247
<dl class="return"><dt><b>Returns:</b></dt><dd>the channel the XBee is using</dd></dl>
248
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="group__xbee__funcs.html#ga4f67630ca81e5eae064bb58c3818d3fd" title="Set the channel the XBee is currently using.">xbee_set_channel</a> </dd></dl>
249

    
250
<p>References <a class="el" href="xbee_8c_source.html#l00722">getStatus()</a>, <a class="el" href="wl__defs_8h_source.html#l00114">WL_ERROR_XBEE_COMMAND</a>, and <a class="el" href="xbee_8c_source.html#l01380">xbee_send_read_at_command()</a>.</p>
251

    
252
</div>
253
</div>
254
<a class="anchor" id="gaa740c59073c6db9e00a2a2de10a95091"></a><!-- doxytag: member="xbee.c::xbee_get_pan" ref="gaa740c59073c6db9e00a2a2de10a95091" args="()" -->
255
<div class="memitem">
256
<div class="memproto">
257
      <table class="memname">
258
        <tr>
259
          <td class="memname">uint16_t xbee_get_pan </td>
260
          <td>(</td>
261
          <td class="paramtype">void&nbsp;</td>
262
          <td class="paramname"></td>
263
          <td>&nbsp;)&nbsp;</td>
264
          <td></td>
265
        </tr>
266
      </table>
267
</div>
268
<div class="memdoc">
269

    
270
<p>Get the XBee's PAN ID. </p>
271
<p>Get the PAN ID for the XBee.</p>
272
<dl class="return"><dt><b>Returns:</b></dt><dd>the personal area network id, or XBEE_PAN_DEFAULT if it has not yet been set. </dd></dl>
273

    
274
<p>References <a class="el" href="xbee_8c_source.html#l00722">getStatus()</a>, <a class="el" href="wl__defs_8h_source.html#l00117">WL_ERROR_XBEE_COMMAND_16BIT</a>, and <a class="el" href="xbee_8c_source.html#l01380">xbee_send_read_at_command()</a>.</p>
275

    
276
</div>
277
</div>
278
<a class="anchor" id="ga409ff62ddd9e22eaf745a50f688263fd"></a><!-- doxytag: member="xbee.c::xbee_getc" ref="ga409ff62ddd9e22eaf745a50f688263fd" args="(void)" -->
279
<div class="memitem">
280
<div class="memproto">
281
      <table class="memname">
282
        <tr>
283
          <td class="memname">int16_t xbee_getc </td>
284
          <td>(</td>
285
          <td class="paramtype">void&nbsp;</td>
286
          <td class="paramname"></td>
287
          <td>&nbsp;)&nbsp;</td>
288
          <td></td>
289
        </tr>
290
      </table>
291
</div>
292
<div class="memdoc">
293
<p>Returns the first byte in the buffer received from xbee. This function blocks execution until a character has been received. xbee_init must be called before this function may be used.</p>
294
<dl class="return"><dt><b>Returns:</b></dt><dd>the first character in the xbee buffer, -1 on error</dd></dl>
295
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="group__xbee__funcs.html#ga35f6f209aee59fad0490a961587e014a" title="Initialize the XBee library.">xbee_init</a>, <a class="el" href="group__xbee.html#gae564a6f5453934b0234a054fbc238fd3">xbee_getc_nb</a> </dd></dl>
296

    
297
</div>
298
</div>
299
<a class="anchor" id="gae564a6f5453934b0234a054fbc238fd3"></a><!-- doxytag: member="xbee.c::xbee_getc_nb" ref="gae564a6f5453934b0234a054fbc238fd3" args="(uint8_t *c)" -->
300
<div class="memitem">
301
<div class="memproto">
302
      <table class="memname">
303
        <tr>
304
          <td class="memname">int8_t xbee_getc_nb </td>
305
          <td>(</td>
306
          <td class="paramtype">uint8_t *&nbsp;</td>
307
          <td class="paramname"> <em>c</em></td>
308
          <td>&nbsp;)&nbsp;</td>
309
          <td></td>
310
        </tr>
311
      </table>
312
</div>
313
<div class="memdoc">
314
<p>Non blocking version of xbee_getc. If a byte is present in the buffer, it is returned, otherwise -1 is returned immediately. xbee_init must be called before this function can be used.</p>
315
<dl><dt><b>Parameters:</b></dt><dd>
316
  <table border="0" cellspacing="2" cellpadding="0">
317
    <tr><td valign="top"></td><td valign="top"><em>c</em>&nbsp;</td><td>The received byte. This will be set if a byte has been received.</td></tr>
318
  </table>
319
  </dd>
320
</dl>
321
<dl class="return"><dt><b>Returns:</b></dt><dd>-1 If no byte is available, 0 otherwise, positive for error</dd></dl>
322
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="group__xbee.html#ga409ff62ddd9e22eaf745a50f688263fd">xbee_getc</a> </dd></dl>
323

    
324
<p>References <a class="el" href="wl__defs_8h_source.html#l00069">WL_SUCCESS</a>.</p>
325

    
326
</div>
327
</div>
328
<a class="anchor" id="ga31a4df97d6865a40123337045109b9f1"></a><!-- doxytag: member="xbee.c::xbee_init" ref="ga31a4df97d6865a40123337045109b9f1" args="()" -->
329
<div class="memitem">
330
<div class="memproto">
331
      <table class="memname">
332
        <tr>
333
          <td class="memname">int8_t xbee_init </td>
334
          <td>(</td>
335
          <td class="paramtype">void&nbsp;</td>
336
          <td class="paramname"></td>
337
          <td>&nbsp;)&nbsp;</td>
338
          <td></td>
339
        </tr>
340
      </table>
341
</div>
342
<div class="memdoc">
343

    
344
<p>Initialize the XBee library. </p>
345
<p>Initializes the XBee library so that other functions may be used. </p>
346

    
347
<p>References <a class="el" href="xbee_8c_source.html#l00722">getStatus()</a>, <a class="el" href="wl__defs_8h_source.html#l00120">WL_ERROR_BAUD</a>, <a class="el" href="wl__defs_8h_source.html#l00075">WL_ERROR_INIT_ALREADY_INITD</a>, <a class="el" href="wl__defs_8h_source.html#l00117">WL_ERROR_XBEE_COMMAND_16BIT</a>, <a class="el" href="wl__defs_8h_source.html#l00069">WL_SUCCESS</a>, <a class="el" href="xbee_8c_source.html#l00087">xbee_basic_buf</a>, <a class="el" href="xbee_8c_source.html#l01725">xbee_get_address()</a>, and <a class="el" href="xbee_8c_source.html#l01586">xbee_set_pan()</a>.</p>
348

    
349
<p>Referenced by <a class="el" href="wireless_8c_source.html#l00057">wl_init()</a>.</p>
350

    
351
</div>
352
</div>
353
<a class="anchor" id="gaf29617dd4988f4b056f9476004ae5cbf"></a><!-- doxytag: member="xbee.c::xbee_putc" ref="gaf29617dd4988f4b056f9476004ae5cbf" args="(uint8_t c)" -->
354
<div class="memitem">
355
<div class="memproto">
356
      <table class="memname">
357
        <tr>
358
          <td class="memname">int8_t xbee_putc </td>
359
          <td>(</td>
360
          <td class="paramtype">uint8_t&nbsp;</td>
361
          <td class="paramname"> <em>c</em></td>
362
          <td>&nbsp;)&nbsp;</td>
363
          <td></td>
364
        </tr>
365
      </table>
366
</div>
367
<div class="memdoc">
368
<p>Sends a character to the XBee.</p>
369
<dl><dt><b>Parameters:</b></dt><dd>
370
  <table border="0" cellspacing="2" cellpadding="0">
371
    <tr><td valign="top"></td><td valign="top"><em>c</em>&nbsp;</td><td>the byte to send </td></tr>
372
  </table>
373
  </dd>
374
</dl>
375
<dl class="return"><dt><b>Returns:</b></dt><dd>0 for success, nonzero for failure </dd></dl>
376

    
377
<p>References <a class="el" href="wl__defs_8h_source.html#l00069">WL_SUCCESS</a>.</p>
378

    
379
<p>Referenced by <a class="el" href="xbee_8c_source.html#l01332">xbee_send_header()</a>, and <a class="el" href="xbee_8c_source.html#l01432">xbee_send_packet()</a>.</p>
380

    
381
</div>
382
</div>
383
<a class="anchor" id="ga5805e267e3b6f4b7bdad7aa6dc65ee04"></a><!-- doxytag: member="xbee.c::xbee_send" ref="ga5805e267e3b6f4b7bdad7aa6dc65ee04" args="(uint8_t *buf, uint16_t size)" -->
384
<div class="memitem">
385
<div class="memproto">
386
      <table class="memname">
387
        <tr>
388
          <td class="memname">int8_t xbee_send </td>
389
          <td>(</td>
390
          <td class="paramtype">uint8_t *&nbsp;</td>
391
          <td class="paramname"> <em>buf</em>, </td>
392
        </tr>
393
        <tr>
394
          <td class="paramkey"></td>
395
          <td></td>
396
          <td class="paramtype">uint16_t&nbsp;</td>
397
          <td class="paramname"> <em>size</em></td><td>&nbsp;</td>
398
        </tr>
399
        <tr>
400
          <td></td>
401
          <td>)</td>
402
          <td></td><td></td><td></td>
403
        </tr>
404
      </table>
405
</div>
406
<div class="memdoc">
407

    
408
<p>Send an array of bytes to the xbee in API mode. </p>
409
<p>Send a buffer buf of size bytes to the XBee in API mode</p>
410
<dl><dt><b>Parameters:</b></dt><dd>
411
  <table border="0" cellspacing="2" cellpadding="0">
412
    <tr><td valign="top"></td><td valign="top"><em>buf</em>&nbsp;</td><td>the buffer of data to send </td></tr>
413
    <tr><td valign="top"></td><td valign="top"><em>size</em>&nbsp;</td><td>the number of bytes to send </td></tr>
414
  </table>
415
  </dd>
416
</dl>
417

    
418
<p>References <a class="el" href="wl__defs_8h_source.html#l00093">WL_ERROR_SEND</a>, <a class="el" href="wl__defs_8h_source.html#l00069">WL_SUCCESS</a>, and <a class="el" href="xbee_8c_source.html#l01015">xbee_sendc()</a>.</p>
419

    
420
<p>Referenced by <a class="el" href="wireless__send_8c_source.html#l00091">wl_send()</a>, and <a class="el" href="xbee_8c_source.html#l01432">xbee_send_packet()</a>.</p>
421

    
422
</div>
423
</div>
424
<a class="anchor" id="ga2a39ffce83d65d22aeefb41dfce2112f"></a><!-- doxytag: member="xbee.c::xbee_send_header" ref="ga2a39ffce83d65d22aeefb41dfce2112f" args="(uint16_t len)" -->
425
<div class="memitem">
426
<div class="memproto">
427
      <table class="memname">
428
        <tr>
429
          <td class="memname">int8_t xbee_send_header </td>
430
          <td>(</td>
431
          <td class="paramtype">uint16_t&nbsp;</td>
432
          <td class="paramname"> <em>len</em></td>
433
          <td>&nbsp;)&nbsp;</td>
434
          <td></td>
435
        </tr>
436
      </table>
437
</div>
438
<div class="memdoc">
439

    
440
<p>Send a frame header to the xbee. </p>
441
<p>Sends header information. Header information includes XBEE_FRAME_START and the packet length, as two bytes.</p>
442
<dl><dt><b>Parameters:</b></dt><dd>
443
  <table border="0" cellspacing="2" cellpadding="0">
444
    <tr><td valign="top"></td><td valign="top"><em>type</em>&nbsp;</td><td>the packet type </td></tr>
445
    <tr><td valign="top"></td><td valign="top"><em>len</em>&nbsp;</td><td>the size in bytes of the packet data </td></tr>
446
  </table>
447
  </dd>
448
</dl>
449

    
450
<p>References <a class="el" href="wl__defs_8h_source.html#l00093">WL_ERROR_SEND</a>, <a class="el" href="wl__defs_8h_source.html#l00069">WL_SUCCESS</a>, <a class="el" href="xbee_8c_source.html#l00945">xbee_putc()</a>, and <a class="el" href="xbee_8c_source.html#l01015">xbee_sendc()</a>.</p>
451

    
452
<p>Referenced by <a class="el" href="wireless__send_8c_source.html#l00091">wl_send()</a>.</p>
453

    
454
</div>
455
</div>
456
<a class="anchor" id="gaae54f7208cfa786cb56d4d78ab3ceffe"></a><!-- doxytag: member="xbee.c::xbee_send_packet" ref="gaae54f7208cfa786cb56d4d78ab3ceffe" args="(uint8_t *packet, uint8_t len, uint16_t dest, uint8_t options, uint8_t frame)" -->
457
<div class="memitem">
458
<div class="memproto">
459
      <table class="memname">
460
        <tr>
461
          <td class="memname">int8_t xbee_send_packet </td>
462
          <td>(</td>
463
          <td class="paramtype">uint8_t *&nbsp;</td>
464
          <td class="paramname"> <em>packet</em>, </td>
465
        </tr>
466
        <tr>
467
          <td class="paramkey"></td>
468
          <td></td>
469
          <td class="paramtype">uint8_t&nbsp;</td>
470
          <td class="paramname"> <em>len</em>, </td>
471
        </tr>
472
        <tr>
473
          <td class="paramkey"></td>
474
          <td></td>
475
          <td class="paramtype">uint16_t&nbsp;</td>
476
          <td class="paramname"> <em>dest</em>, </td>
477
        </tr>
478
        <tr>
479
          <td class="paramkey"></td>
480
          <td></td>
481
          <td class="paramtype">uint8_t&nbsp;</td>
482
          <td class="paramname"> <em>options</em>, </td>
483
        </tr>
484
        <tr>
485
          <td class="paramkey"></td>
486
          <td></td>
487
          <td class="paramtype">uint8_t&nbsp;</td>
488
          <td class="paramname"> <em>frame</em></td><td>&nbsp;</td>
489
        </tr>
490
        <tr>
491
          <td></td>
492
          <td>)</td>
493
          <td></td><td></td><td></td>
494
        </tr>
495
      </table>
496
</div>
497
<div class="memdoc">
498

    
499
<p>Send a packet to the XBee. </p>
500
<p>Send the specified packet.</p>
501
<dl><dt><b>Parameters:</b></dt><dd>
502
  <table border="0" cellspacing="2" cellpadding="0">
503
    <tr><td valign="top"></td><td valign="top"><em>packet</em>&nbsp;</td><td>the packet data to send </td></tr>
504
    <tr><td valign="top"></td><td valign="top"><em>len</em>&nbsp;</td><td>the number of bytes in the packet</td></tr>
505
    <tr><td valign="top"></td><td valign="top"><em>dest</em>&nbsp;</td><td>the ID of the XBee to send the packet to, or XBEE_BROADCAST to send the message to all robots in the PAN.</td></tr>
506
    <tr><td valign="top"></td><td valign="top"><em>options</em>&nbsp;</td><td>a combination of the flags XBEE_OPTIONS_NONE, XBEE_OPTIONS_DISABLE_RESPONSE and XBEE_OPTIONS_BROADCAST_ALL_PANS</td></tr>
507
    <tr><td valign="top"></td><td valign="top"><em>frame</em>&nbsp;</td><td>the frame number to associate this packet with. This will be used to identify the response when the XBee alerts us as to whether or not our message was received. </td></tr>
508
  </table>
509
  </dd>
510
</dl>
511

    
512
<p>References <a class="el" href="wl__defs_8h_source.html#l00090">WL_ERROR_ARGUMENT</a>, <a class="el" href="wl__defs_8h_source.html#l00093">WL_ERROR_SEND</a>, <a class="el" href="wl__defs_8h_source.html#l00069">WL_SUCCESS</a>, <a class="el" href="xbee_8c_source.html#l00945">xbee_putc()</a>, <a class="el" href="xbee_8c_source.html#l01038">xbee_send()</a>, and <a class="el" href="xbee_8c_source.html#l01015">xbee_sendc()</a>.</p>
513

    
514
</div>
515
</div>
516
<a class="anchor" id="ga2694f3530e4cf256ff9e96600aea753c"></a><!-- doxytag: member="xbee.c::xbee_send_read_at_command" ref="ga2694f3530e4cf256ff9e96600aea753c" args="(uint8_t *command)" -->
517
<div class="memitem">
518
<div class="memproto">
519
      <table class="memname">
520
        <tr>
521
          <td class="memname">int8_t xbee_send_read_at_command </td>
522
          <td>(</td>
523
          <td class="paramtype">uint8_t *&nbsp;</td>
524
          <td class="paramname"> <em>command</em></td>
525
          <td>&nbsp;)&nbsp;</td>
526
          <td></td>
527
        </tr>
528
      </table>
529
</div>
530
<div class="memdoc">
531
<p>Sends an AT command to read a parameter.</p>
532
<dl><dt><b>Parameters:</b></dt><dd>
533
  <table border="0" cellspacing="2" cellpadding="0">
534
    <tr><td valign="top"></td><td valign="top"><em>command</em>&nbsp;</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>
535
  </table>
536
  </dd>
537
</dl>
538

    
539
<p>Referenced by <a class="el" href="xbee_8c_source.html#l01725">xbee_get_address()</a>, <a class="el" href="xbee_8c_source.html#l01693">xbee_get_channel()</a>, and <a class="el" href="xbee_8c_source.html#l01621">xbee_get_pan()</a>.</p>
540

    
541
</div>
542
</div>
543
<a class="anchor" id="gae75ee9a54a5811b8bc302dc2d70f0215"></a><!-- doxytag: member="xbee.c::xbee_sendc" ref="gae75ee9a54a5811b8bc302dc2d70f0215" args="(uint8_t byte)" -->
544
<div class="memitem">
545
<div class="memproto">
546
      <table class="memname">
547
        <tr>
548
          <td class="memname">int8_t xbee_sendc </td>
549
          <td>(</td>
550
          <td class="paramtype">uint8_t&nbsp;</td>
551
          <td class="paramname"> <em>byte</em></td>
552
          <td>&nbsp;)&nbsp;</td>
553
          <td></td>
554
        </tr>
555
      </table>
556
</div>
557
<div class="memdoc">
558

    
559
<p>Send byte to the xbee in API mode. </p>
560
<p>Send byte to the xbee in API mode.</p>
561
<dl><dt><b>Parameters:</b></dt><dd>
562
  <table border="0" cellspacing="2" cellpadding="0">
563
    <tr><td valign="top"></td><td valign="top"><em>byte</em>&nbsp;</td><td>the byte to be sent </td></tr>
564
  </table>
565
  </dd>
566
</dl>
567

    
568
<p>References <a class="el" href="xbee_8c_source.html#l00722">getStatus()</a>, and <a class="el" href="wl__defs_8h_source.html#l00069">WL_SUCCESS</a>.</p>
569

    
570
<p>Referenced by <a class="el" href="wireless__send_8c_source.html#l00091">wl_send()</a>, <a class="el" href="xbee_8c_source.html#l01038">xbee_send()</a>, <a class="el" href="xbee_8c_source.html#l01332">xbee_send_header()</a>, and <a class="el" href="xbee_8c_source.html#l01432">xbee_send_packet()</a>.</p>
571

    
572
</div>
573
</div>
574
<a class="anchor" id="ga4f67630ca81e5eae064bb58c3818d3fd"></a><!-- doxytag: member="xbee.c::xbee_set_channel" ref="ga4f67630ca81e5eae064bb58c3818d3fd" args="(uint8_t channel)" -->
575
<div class="memitem">
576
<div class="memproto">
577
      <table class="memname">
578
        <tr>
579
          <td class="memname">int8_t xbee_set_channel </td>
580
          <td>(</td>
581
          <td class="paramtype">uint8_t&nbsp;</td>
582
          <td class="paramname"> <em>channel</em></td>
583
          <td>&nbsp;)&nbsp;</td>
584
          <td></td>
585
        </tr>
586
      </table>
587
</div>
588
<div class="memdoc">
589

    
590
<p>Set the channel the XBee is currently using. </p>
591
<p>Set the channel the XBee is using.</p>
592
<dl><dt><b>Parameters:</b></dt><dd>
593
  <table border="0" cellspacing="2" cellpadding="0">
594
    <tr><td valign="top"></td><td valign="top"><em>channel</em>&nbsp;</td><td>the channel the XBee will not use, between 0x0B and 0x1A</td></tr>
595
  </table>
596
  </dd>
597
</dl>
598
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="group__xbee__funcs.html#ga319d4bccd5e6b09d2f377d2170104817" title="Get the channel the XBee is currently using.">xbee_get_channel</a> </dd></dl>
599

    
600
<p>References <a class="el" href="xbee_8c_source.html#l00722">getStatus()</a>, <a class="el" href="wl__defs_8h_source.html#l00090">WL_ERROR_ARGUMENT</a>, <a class="el" href="wl__defs_8h_source.html#l00114">WL_ERROR_XBEE_COMMAND</a>, and <a class="el" href="wl__defs_8h_source.html#l00069">WL_SUCCESS</a>.</p>
601

    
602
</div>
603
</div>
604
<a class="anchor" id="gadbcb9cc8cf6afa28e6de8defb33f8196"></a><!-- doxytag: member="xbee.c::xbee_set_pan" ref="gadbcb9cc8cf6afa28e6de8defb33f8196" args="(uint16_t id)" -->
605
<div class="memitem">
606
<div class="memproto">
607
      <table class="memname">
608
        <tr>
609
          <td class="memname">int8_t xbee_set_pan </td>
610
          <td>(</td>
611
          <td class="paramtype">uint16_t&nbsp;</td>
612
          <td class="paramname"> <em>id</em></td>
613
          <td>&nbsp;)&nbsp;</td>
614
          <td></td>
615
        </tr>
616
      </table>
617
</div>
618
<div class="memdoc">
619

    
620
<p>Set the PAN ID for the XBee. </p>
621
<p>Sets the personal area network id.</p>
622
<dl><dt><b>Parameters:</b></dt><dd>
623
  <table border="0" cellspacing="2" cellpadding="0">
624
    <tr><td valign="top"></td><td valign="top"><em>id</em>&nbsp;</td><td>the new personal area network (PAN) id </td></tr>
625
  </table>
626
  </dd>
627
</dl>
628

    
629
<p>References <a class="el" href="xbee_8c_source.html#l00722">getStatus()</a>, <a class="el" href="wl__defs_8h_source.html#l00114">WL_ERROR_XBEE_COMMAND</a>, and <a class="el" href="wl__defs_8h_source.html#l00069">WL_SUCCESS</a>.</p>
630

    
631
<p>Referenced by <a class="el" href="xbee_8c_source.html#l00729">xbee_init()</a>.</p>
632

    
633
</div>
634
</div>
635
<a class="anchor" id="ga3fe446135ba896e6438a4fcd67154119"></a><!-- doxytag: member="xbee.c::xbee_terminate" ref="ga3fe446135ba896e6438a4fcd67154119" args="()" -->
636
<div class="memitem">
637
<div class="memproto">
638
      <table class="memname">
639
        <tr>
640
          <td class="memname">int8_t xbee_terminate </td>
641
          <td>(</td>
642
          <td class="paramtype">void&nbsp;</td>
643
          <td class="paramname"></td>
644
          <td>&nbsp;)&nbsp;</td>
645
          <td></td>
646
        </tr>
647
      </table>
648
</div>
649
<div class="memdoc">
650

    
651
<p>Uninitialize the XBee library. </p>
652
<p>Call when finished using the XBee library. </p>
653

    
654
<p>References <a class="el" href="wl__defs_8h_source.html#l00081">WL_ERROR_TERMINATION_FAILED</a>, and <a class="el" href="wl__defs_8h_source.html#l00069">WL_SUCCESS</a>.</p>
655

    
656
<p>Referenced by <a class="el" href="wireless_8c_source.html#l00087">wl_terminate()</a>.</p>
657

    
658
</div>
659
</div>
660
</div>
661
<hr class="footer"/><address style="text-align: right;"><small>Generated on Thu May 6 13:17:00 2010 for libwireless by&nbsp;
662
<a href="http://www.doxygen.org/index.html">
663
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.3 </small></address>
664
</body>
665
</html>