Project

General

Profile

Revision 1425

Added by Chris Mar almost 10 years ago

updated wireless basic library code and docs

View differences:

wireless_8c.html
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">
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"/>
3 5
<title>libwireless: wireless.c File Reference</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 -->
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 -->
8 11
<div class="navigation" id="top">
9 12
  <div class="tabs">
10 13
    <ul>
......
22 25
  </div>
23 26
</div>
24 27
<div class="contents">
25
<h1>wireless.c File Reference</h1>Wireless Library Implementation.  
26
<a href="#_details">More...</a>
27
<p>
28
<code>#include &quot;<a class="el" href="wireless_8h_source.html">wireless.h</a>&quot;</code><br>
29
<code>#include &quot;<a class="el" href="xbee_8h_source.html">xbee.h</a>&quot;</code><br>
30
<code>#include &lt;stdlib.h&gt;</code><br>
31
<code>#include &lt;stdio.h&gt;</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;sys/time.h&gt;</code><br>
34
<code>#include &lt;signal.h&gt;</code><br>
28
<h1>wireless.c File Reference</h1>
29
<p>Wireless Library Implementation.  
30
<a href="#_details">More...</a></p>
31
<code>#include &quot;<a class="el" href="wireless_8h_source.html">wireless.h</a>&quot;</code><br/>
32
<code>#include &quot;<a class="el" href="xbee_8h_source.html">xbee.h</a>&quot;</code><br/>
33
<code>#include &lt;stdlib.h&gt;</code><br/>
34
<code>#include &lt;stdio.h&gt;</code><br/>
35
<code>#include &quot;<a class="el" href="wl__defs_8h_source.html">wl_defs.h</a>&quot;</code><br/>
36
<code>#include &lt;sys/time.h&gt;</code><br/>
37
<code>#include &lt;signal.h&gt;</code><br/>
35 38
<table border="0" cellpadding="0" cellspacing="0">
36
<tr><td></td></tr>
37
<tr><td colspan="2"><br><h2>Functions</h2></td></tr>
38
<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wireless.html#gedd4562415e273ce6537f9c1a0f2701b">wl_init</a> ()</td></tr>
39

  
40
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Initialize the wireless library.  <a href="group__wireless.html#gedd4562415e273ce6537f9c1a0f2701b"></a><br></td></tr>
41
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wireless.html#g66075ff87a1c9f2c0d7938a26c7830f2">wl_terminate</a> ()</td></tr>
42

  
43
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Uninitialize the wireless library.  <a href="group__wireless.html#g66075ff87a1c9f2c0d7938a26c7830f2"></a><br></td></tr>
44
<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wireless.html#g754445d2353a70963a489651cff554c1">wl_set_pan</a> (int pan)</td></tr>
45

  
46
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Set the PAN we are using.  <a href="group__wireless.html#g754445d2353a70963a489651cff554c1"></a><br></td></tr>
47
<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wireless.html#g4e6b5c97d40a8e7557a1b4b90a7d34f7">wl_get_pan</a> (void)</td></tr>
48

  
49
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Get the PAN we are using.  <a href="group__wireless.html#g4e6b5c97d40a8e7557a1b4b90a7d34f7"></a><br></td></tr>
50
<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wireless.html#g51d3fe958d44fd92f0e0830ced13139d">wl_set_channel</a> (int channel)</td></tr>
51

  
52
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Set the channel we are using.  <a href="group__wireless.html#g51d3fe958d44fd92f0e0830ced13139d"></a><br></td></tr>
53
<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wireless.html#g2d65d3e35b193da4213755c4bf61ab6b">wl_get_channel</a> (void)</td></tr>
54

  
55
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Get the channel we are using.  <a href="group__wireless.html#g2d65d3e35b193da4213755c4bf61ab6b"></a><br></td></tr>
56
<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wireless.html#g6c75a84ff5f9a2bdc156aba522d2adf7">wl_get_xbee_id</a> ()</td></tr>
57

  
58
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Get the 16-bit address of the XBee module.  <a href="group__wireless.html#g6c75a84ff5f9a2bdc156aba522d2adf7"></a><br></td></tr>
59
<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wireless.html#g6e841a6ef0504538d8650a0a2f5fa869">wl_send_robot_to_robot_global_packet</a> (char group, char type, char *data, int len, int dest, char frame)</td></tr>
60

  
61
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Send a packet to a specific robot in any PAN.  <a href="group__wireless.html#g6e841a6ef0504538d8650a0a2f5fa869"></a><br></td></tr>
62
<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wireless.html#gf8fbadf62eeb754b98b200328fb7a8be">wl_send_robot_to_robot_packet</a> (char group, char type, char *data, int len, int dest, char frame)</td></tr>
63

  
64
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Send a packet to a specific robot in our PAN.  <a href="group__wireless.html#gf8fbadf62eeb754b98b200328fb7a8be"></a><br></td></tr>
65
<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wireless.html#gda6b187ea58cee5aec18725bf7f24b9a">wl_send_global_packet</a> (char group, char type, char *data, int len, char frame)</td></tr>
66

  
67
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Send a packet to all robots.  <a href="group__wireless.html#gda6b187ea58cee5aec18725bf7f24b9a"></a><br></td></tr>
68
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wireless.html#g0a1a0e4d885f0e0dde87160a16daa0aa">wl_send_pan_packet</a> (char group, char type, char *data, int len, char frame)</td></tr>
69

  
70
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Send a packet to all robots in our PAN.  <a href="group__wireless.html#g0a1a0e4d885f0e0dde87160a16daa0aa"></a><br></td></tr>
71
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wireless.html#g183343ed0594ec1c2b79bb4085d57107">wl_register_packet_group</a> (<a class="el" href="structPacketGroupHandler.html">PacketGroupHandler</a> *h)</td></tr>
72

  
73
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Register a packet group with the wireless library.  <a href="group__wireless.html#g183343ed0594ec1c2b79bb4085d57107"></a><br></td></tr>
74
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wireless.html#gcdbedf6465798abc7af3bf5fea3d4dd7">wl_unregister_packet_group</a> (<a class="el" href="structPacketGroupHandler.html">PacketGroupHandler</a> *h)</td></tr>
75

  
76
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Unregister a packet group with the wireless library.  <a href="group__wireless.html#gcdbedf6465798abc7af3bf5fea3d4dd7"></a><br></td></tr>
77
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wireless.html#g5c1f1a0e20fc718e59edc29246afd703">wl_do</a> ()</td></tr>
78

  
79
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Perform wireless library functionality.  <a href="group__wireless.html#g5c1f1a0e20fc718e59edc29246afd703"></a><br></td></tr>
80
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g344dead0023100eb40f8670a92c9ce5c"></a><!-- doxytag: member="wireless.c::wl_set_com_port" ref="g344dead0023100eb40f8670a92c9ce5c" args="(char *port)" -->
81
void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wireless.html#g344dead0023100eb40f8670a92c9ce5c">wl_set_com_port</a> (char *port)</td></tr>
82

  
83
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Set the com port on a computer, undefined on the robot. <br></td></tr>
39
<tr><td colspan="2"><h2>Functions</h2></td></tr>
40
<tr><td class="memItemLeft" align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wireless.html#gaedd4562415e273ce6537f9c1a0f2701b">wl_init</a> ()</td></tr>
41
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Initialize the wireless library.  <a href="group__wireless.html#gaedd4562415e273ce6537f9c1a0f2701b"></a><br/></td></tr>
42
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wireless.html#ga66075ff87a1c9f2c0d7938a26c7830f2">wl_terminate</a> ()</td></tr>
43
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Uninitialize the wireless library.  <a href="group__wireless.html#ga66075ff87a1c9f2c0d7938a26c7830f2"></a><br/></td></tr>
44
<tr><td class="memItemLeft" align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wireless.html#ga754445d2353a70963a489651cff554c1">wl_set_pan</a> (int pan)</td></tr>
45
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Set the PAN we are using.  <a href="group__wireless.html#ga754445d2353a70963a489651cff554c1"></a><br/></td></tr>
46
<tr><td class="memItemLeft" align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wireless.html#ga4e6b5c97d40a8e7557a1b4b90a7d34f7">wl_get_pan</a> (void)</td></tr>
47
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Get the PAN we are using.  <a href="group__wireless.html#ga4e6b5c97d40a8e7557a1b4b90a7d34f7"></a><br/></td></tr>
48
<tr><td class="memItemLeft" align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wireless.html#ga51d3fe958d44fd92f0e0830ced13139d">wl_set_channel</a> (int channel)</td></tr>
49
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Set the channel we are using.  <a href="group__wireless.html#ga51d3fe958d44fd92f0e0830ced13139d"></a><br/></td></tr>
50
<tr><td class="memItemLeft" align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wireless.html#ga2d65d3e35b193da4213755c4bf61ab6b">wl_get_channel</a> (void)</td></tr>
51
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Get the channel we are using.  <a href="group__wireless.html#ga2d65d3e35b193da4213755c4bf61ab6b"></a><br/></td></tr>
52
<tr><td class="memItemLeft" align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wireless.html#ga6c75a84ff5f9a2bdc156aba522d2adf7">wl_get_xbee_id</a> ()</td></tr>
53
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Get the 16-bit address of the XBee module.  <a href="group__wireless.html#ga6c75a84ff5f9a2bdc156aba522d2adf7"></a><br/></td></tr>
54
<tr><td class="memItemLeft" align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wireless.html#ga6e841a6ef0504538d8650a0a2f5fa869">wl_send_robot_to_robot_global_packet</a> (char group, char type, char *data, int len, int dest, char frame)</td></tr>
55
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Send a packet to a specific robot in any PAN.  <a href="group__wireless.html#ga6e841a6ef0504538d8650a0a2f5fa869"></a><br/></td></tr>
56
<tr><td class="memItemLeft" align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wireless.html#gaf8fbadf62eeb754b98b200328fb7a8be">wl_send_robot_to_robot_packet</a> (char group, char type, char *data, int len, int dest, char frame)</td></tr>
57
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Send a packet to a specific robot in our PAN.  <a href="group__wireless.html#gaf8fbadf62eeb754b98b200328fb7a8be"></a><br/></td></tr>
58
<tr><td class="memItemLeft" align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wireless.html#gada6b187ea58cee5aec18725bf7f24b9a">wl_send_global_packet</a> (char group, char type, char *data, int len, char frame)</td></tr>
59
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Send a packet to all robots.  <a href="group__wireless.html#gada6b187ea58cee5aec18725bf7f24b9a"></a><br/></td></tr>
60
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wireless.html#ga0a1a0e4d885f0e0dde87160a16daa0aa">wl_send_pan_packet</a> (char group, char type, char *data, int len, char frame)</td></tr>
61
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Send a packet to all robots in our PAN.  <a href="group__wireless.html#ga0a1a0e4d885f0e0dde87160a16daa0aa"></a><br/></td></tr>
62
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wireless.html#ga183343ed0594ec1c2b79bb4085d57107">wl_register_packet_group</a> (<a class="el" href="structPacketGroupHandler.html">PacketGroupHandler</a> *h)</td></tr>
63
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Register a packet group with the wireless library.  <a href="group__wireless.html#ga183343ed0594ec1c2b79bb4085d57107"></a><br/></td></tr>
64
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wireless.html#gacdbedf6465798abc7af3bf5fea3d4dd7">wl_unregister_packet_group</a> (<a class="el" href="structPacketGroupHandler.html">PacketGroupHandler</a> *h)</td></tr>
65
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Unregister a packet group with the wireless library.  <a href="group__wireless.html#gacdbedf6465798abc7af3bf5fea3d4dd7"></a><br/></td></tr>
66
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wireless.html#ga5c1f1a0e20fc718e59edc29246afd703">wl_do</a> ()</td></tr>
67
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Perform wireless library functionality.  <a href="group__wireless.html#ga5c1f1a0e20fc718e59edc29246afd703"></a><br/></td></tr>
68
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga344dead0023100eb40f8670a92c9ce5c"></a><!-- doxytag: member="wireless.c::wl_set_com_port" ref="ga344dead0023100eb40f8670a92c9ce5c" args="(char *port)" -->
69
void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wireless.html#ga344dead0023100eb40f8670a92c9ce5c">wl_set_com_port</a> (char *port)</td></tr>
70
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Set the com port on a computer, undefined on the robot. <br/></td></tr>
84 71
</table>
85
<hr><h2>Detailed Description</h2>
86
Wireless Library Implementation. 
87
<p>
88
Copyright (c) 2007 Colony Project<p>
89
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>
90
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.<p>
91
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>
92
Implementation of the wireless library.<p>
93
<dl class="author" compact><dt><b>Author:</b></dt><dd>Brian Coltin, Colony Project, CMU Robotics Club </dd></dl>
72
<hr/><a name="_details"></a><h2>Detailed Description</h2>
73
<p>Wireless Library Implementation. </p>
74
<p>Copyright (c) 2007 Colony Project</p>
75
<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>
76
<p>The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.</p>
77
<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>
78
<p>Implementation of the wireless library.</p>
79
<dl class="author"><dt><b>Author:</b></dt><dd>Brian Coltin, Colony Project, CMU Robotics Club </dd></dl>
94 80
</div>
95
<hr size="1"><address style="text-align: right;"><small>Generated on Tue Sep 8 19:59:17 2009 for libwireless by&nbsp;
81
<hr size="1"/><address style="text-align: right;"><small>Generated on Sun Sep 20 12:12:02 2009 for libwireless by&nbsp;
96 82
<a href="http://www.doxygen.org/index.html">
97
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.9 </small></address>
83
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.1 </small></address>
98 84
</body>
99 85
</html>

Also available in: Unified diff