Project

General

Profile

Revision 1425

Added by Chris Mar over 14 years ago

updated wireless basic library code and docs

View differences:

group__tokenring.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: Token Ring</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>
......
16 19
  </div>
17 20
</div>
18 21
<div class="contents">
19
<h1>Token Ring</h1>Wireless library token ring implementation.  
20
<a href="#_details">More...</a>
21
<p>
22
<h1>Token Ring</h1>
23
<p>Wireless library token ring implementation.  
24
<a href="#_details">More...</a></p>
22 25
<table border="0" cellpadding="0" cellspacing="0">
23
<tr><td></td></tr>
24
<tr><td colspan="2"><br><h2>Functions</h2></td></tr>
25
<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__tokenring.html#g00fb5cca21a50d39aa1e82fdc679ca44">wl_token_ring_register</a> (void)</td></tr>
26

  
27
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Register the token ring group with the wireless library.  <a href="#g00fb5cca21a50d39aa1e82fdc679ca44"></a><br></td></tr>
28
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__tokenring.html#gde3dd682b6a757bab6ce4cbc9c518f8e">wl_token_ring_unregister</a> (void)</td></tr>
29

  
30
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Unregister the token ring group with the wirelss library.  <a href="#gde3dd682b6a757bab6ce4cbc9c518f8e"></a><br></td></tr>
31
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__tokenring.html#g0c407d5c215a97d58c67006bcc6e53ce">wl_token_ring_set_bom_functions</a> (void(*on_function)(void), void(*off_function)(void), int(*max_bom_function)(void))</td></tr>
32

  
33
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Set the functions called to turn the bom on and off.  <a href="#g0c407d5c215a97d58c67006bcc6e53ce"></a><br></td></tr>
34
<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__tokenring.html#ge1012b6d6c1c46b26a6c6da7e4ec7c88">wl_token_ring_join</a> (void)</td></tr>
35

  
36
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Join the token ring.  <a href="#ge1012b6d6c1c46b26a6c6da7e4ec7c88"></a><br></td></tr>
37
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__tokenring.html#g6c2dd8742e100f63d4fb002707d1e85a">wl_token_ring_leave</a> (void)</td></tr>
38

  
39
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Leave the token ring.  <a href="#g6c2dd8742e100f63d4fb002707d1e85a"></a><br></td></tr>
40
<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__tokenring.html#g0c61bb8892aa5513706e00cd8ce5ca8b">wl_token_get_robots_in_ring</a> (void)</td></tr>
41

  
42
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Return the number of robots in the token ring.  <a href="#g0c61bb8892aa5513706e00cd8ce5ca8b"></a><br></td></tr>
43
<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__tokenring.html#g14e005f0b9582eca7e3585f247c4cd72">wl_token_is_robot_in_ring</a> (int robot)</td></tr>
44

  
45
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Return whether a given robot is in the token ring.  <a href="#g14e005f0b9582eca7e3585f247c4cd72"></a><br></td></tr>
46
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__tokenring.html#g37ab9fb00e9eef273b4d0fcda81a2620">wl_token_iterator_begin</a> (void)</td></tr>
47

  
48
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Begin iterating through robots in the token ring.  <a href="#g37ab9fb00e9eef273b4d0fcda81a2620"></a><br></td></tr>
49
<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__tokenring.html#gbd7dc40ee796a67e1160b2b2b8e7d02f">wl_token_iterator_has_next</a> (void)</td></tr>
50

  
51
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns whether there are more robots to iterate through.  <a href="#gbd7dc40ee796a67e1160b2b2b8e7d02f"></a><br></td></tr>
52
<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__tokenring.html#gd9196324178877770d8ffc91d40893c3">wl_token_iterator_next</a> (void)</td></tr>
53

  
54
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns the ID of the next robot in the token ring.  <a href="#gd9196324178877770d8ffc91d40893c3"></a><br></td></tr>
55
<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__tokenring.html#gb4afd4b8e034d22d415f3c4a42a652fc">wl_token_get_sensor_reading</a> (int source, int dest)</td></tr>
56

  
57
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Return the latest BOM reading between two robots.  <a href="#gb4afd4b8e034d22d415f3c4a42a652fc"></a><br></td></tr>
58
<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__tokenring.html#g1938c1d79dd9438dcd413d6d26372877">wl_token_get_my_sensor_reading</a> (int dest)</td></tr>
59

  
60
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Return the latest BOM reading between us and another robot.  <a href="#g1938c1d79dd9438dcd413d6d26372877"></a><br></td></tr>
61
<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__tokenring.html#gf0d311d4feae71afc8bcb0b8c8e6ba57">wl_token_get_num_robots</a> (void)</td></tr>
62

  
63
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Return the number of robots in the sensor matrix.  <a href="#gf0d311d4feae71afc8bcb0b8c8e6ba57"></a><br></td></tr>
64
<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__tokenring.html#g5fe1508968d450a970b0d5417a06431d">wl_token_get_matrix_size</a> (void)</td></tr>
65

  
66
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Return the number of non-null elements in the sensor matrix.  <a href="#g5fe1508968d450a970b0d5417a06431d"></a><br></td></tr>
26
<tr><td colspan="2"><h2>Functions</h2></td></tr>
27
<tr><td class="memItemLeft" align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__tokenring.html#ga00fb5cca21a50d39aa1e82fdc679ca44">wl_token_ring_register</a> (void)</td></tr>
28
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Register the token ring group with the wireless library.  <a href="#ga00fb5cca21a50d39aa1e82fdc679ca44"></a><br/></td></tr>
29
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__tokenring.html#gade3dd682b6a757bab6ce4cbc9c518f8e">wl_token_ring_unregister</a> (void)</td></tr>
30
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Unregister the token ring group with the wirelss library.  <a href="#gade3dd682b6a757bab6ce4cbc9c518f8e"></a><br/></td></tr>
31
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__tokenring.html#ga0c407d5c215a97d58c67006bcc6e53ce">wl_token_ring_set_bom_functions</a> (void(*on_function)(void), void(*off_function)(void), int(*max_bom_function)(void))</td></tr>
32
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Set the functions called to turn the bom on and off.  <a href="#ga0c407d5c215a97d58c67006bcc6e53ce"></a><br/></td></tr>
33
<tr><td class="memItemLeft" align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__tokenring.html#gae1012b6d6c1c46b26a6c6da7e4ec7c88">wl_token_ring_join</a> (void)</td></tr>
34
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Join the token ring.  <a href="#gae1012b6d6c1c46b26a6c6da7e4ec7c88"></a><br/></td></tr>
35
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__tokenring.html#ga6c2dd8742e100f63d4fb002707d1e85a">wl_token_ring_leave</a> (void)</td></tr>
36
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Leave the token ring.  <a href="#ga6c2dd8742e100f63d4fb002707d1e85a"></a><br/></td></tr>
37
<tr><td class="memItemLeft" align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__tokenring.html#ga0c61bb8892aa5513706e00cd8ce5ca8b">wl_token_get_robots_in_ring</a> (void)</td></tr>
38
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Return the number of robots in the token ring.  <a href="#ga0c61bb8892aa5513706e00cd8ce5ca8b"></a><br/></td></tr>
39
<tr><td class="memItemLeft" align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__tokenring.html#ga14e005f0b9582eca7e3585f247c4cd72">wl_token_is_robot_in_ring</a> (int robot)</td></tr>
40
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Return whether a given robot is in the token ring.  <a href="#ga14e005f0b9582eca7e3585f247c4cd72"></a><br/></td></tr>
41
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__tokenring.html#ga37ab9fb00e9eef273b4d0fcda81a2620">wl_token_iterator_begin</a> (void)</td></tr>
42
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Begin iterating through robots in the token ring.  <a href="#ga37ab9fb00e9eef273b4d0fcda81a2620"></a><br/></td></tr>
43
<tr><td class="memItemLeft" align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__tokenring.html#gabd7dc40ee796a67e1160b2b2b8e7d02f">wl_token_iterator_has_next</a> (void)</td></tr>
44
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns whether there are more robots to iterate through.  <a href="#gabd7dc40ee796a67e1160b2b2b8e7d02f"></a><br/></td></tr>
45
<tr><td class="memItemLeft" align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__tokenring.html#gad9196324178877770d8ffc91d40893c3">wl_token_iterator_next</a> (void)</td></tr>
46
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns the ID of the next robot in the token ring.  <a href="#gad9196324178877770d8ffc91d40893c3"></a><br/></td></tr>
47
<tr><td class="memItemLeft" align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__tokenring.html#gab4afd4b8e034d22d415f3c4a42a652fc">wl_token_get_sensor_reading</a> (int source, int dest)</td></tr>
48
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Return the latest BOM reading between two robots.  <a href="#gab4afd4b8e034d22d415f3c4a42a652fc"></a><br/></td></tr>
49
<tr><td class="memItemLeft" align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__tokenring.html#ga1938c1d79dd9438dcd413d6d26372877">wl_token_get_my_sensor_reading</a> (int dest)</td></tr>
50
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Return the latest BOM reading between us and another robot.  <a href="#ga1938c1d79dd9438dcd413d6d26372877"></a><br/></td></tr>
51
<tr><td class="memItemLeft" align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__tokenring.html#gaf0d311d4feae71afc8bcb0b8c8e6ba57">wl_token_get_num_robots</a> (void)</td></tr>
52
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Return the number of robots in the sensor matrix.  <a href="#gaf0d311d4feae71afc8bcb0b8c8e6ba57"></a><br/></td></tr>
53
<tr><td class="memItemLeft" align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__tokenring.html#ga5fe1508968d450a970b0d5417a06431d">wl_token_get_matrix_size</a> (void)</td></tr>
54
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Return the number of non-null elements in the sensor matrix.  <a href="#ga5fe1508968d450a970b0d5417a06431d"></a><br/></td></tr>
67 55
</table>
68
<hr><a name="_details"></a><h2>Detailed Description</h2>
69
Wireless library token ring implementation. 
70
<p>
71
This packet group is used to form a token ring, which keeps track of the relative directions of the robots from one another. <hr><h2>Function Documentation</h2>
72
<a class="anchor" name="g5fe1508968d450a970b0d5417a06431d"></a><!-- doxytag: member="wl_token_ring.h::wl_token_get_matrix_size" ref="g5fe1508968d450a970b0d5417a06431d" args="(void)" -->
56
<hr/><a name="_details"></a><h2>Detailed Description</h2>
57
<p>Wireless library token ring implementation. </p>
58
<p>This packet group is used to form a token ring, which keeps track of the relative directions of the robots from one another. </p>
59
<hr/><h2>Function Documentation</h2>
60
<a class="anchor" id="ga5fe1508968d450a970b0d5417a06431d"></a><!-- doxytag: member="wl_token_ring.h::wl_token_get_matrix_size" ref="ga5fe1508968d450a970b0d5417a06431d" args="(void)" -->
73 61
<div class="memitem">
74 62
<div class="memproto">
75 63
      <table class="memname">
76 64
        <tr>
77
          <td class="memname">int wl_token_get_matrix_size           </td>
65
          <td class="memname">int wl_token_get_matrix_size </td>
78 66
          <td>(</td>
79 67
          <td class="paramtype">void&nbsp;</td>
80
          <td class="paramname">          </td>
68
          <td class="paramname"></td>
81 69
          <td>&nbsp;)&nbsp;</td>
82 70
          <td></td>
83 71
        </tr>
......
85 73
</div>
86 74
<div class="memdoc">
87 75

  
88
<p>
89
Return the number of non-null elements in the sensor matrix. 
90
<p>
91
Returns the number of robots in the sensor matrix.<p>
92
<dl class="return" compact><dt><b>Returns:</b></dt><dd>the number of robots in the sensor matrix </dd></dl>
76
<p>Return the number of non-null elements in the sensor matrix. </p>
77
<p>Returns the number of robots in the sensor matrix.</p>
78
<dl class="return"><dt><b>Returns:</b></dt><dd>the number of robots in the sensor matrix </dd></dl>
93 79

  
94 80
<p>References <a class="el" href="sensor__matrix_8c_source.html#l00159">sensor_matrix_get_size()</a>.</p>
95 81

  
96 82
</div>
97
</div><p>
98
<a class="anchor" name="g1938c1d79dd9438dcd413d6d26372877"></a><!-- doxytag: member="wl_token_ring.h::wl_token_get_my_sensor_reading" ref="g1938c1d79dd9438dcd413d6d26372877" args="(int dest)" -->
83
</div>
84
<a class="anchor" id="ga1938c1d79dd9438dcd413d6d26372877"></a><!-- doxytag: member="wl_token_ring.h::wl_token_get_my_sensor_reading" ref="ga1938c1d79dd9438dcd413d6d26372877" args="(int dest)" -->
99 85
<div class="memitem">
100 86
<div class="memproto">
101 87
      <table class="memname">
102 88
        <tr>
103
          <td class="memname">int wl_token_get_my_sensor_reading           </td>
89
          <td class="memname">int wl_token_get_my_sensor_reading </td>
104 90
          <td>(</td>
105 91
          <td class="paramtype">int&nbsp;</td>
106
          <td class="paramname"> <em>dest</em>          </td>
92
          <td class="paramname"> <em>dest</em></td>
107 93
          <td>&nbsp;)&nbsp;</td>
108 94
          <td></td>
109 95
        </tr>
......
111 97
</div>
112 98
<div class="memdoc">
113 99

  
114
<p>
115
Return the latest BOM reading between us and another robot. 
116
<p>
117
Returns the BOM reading we have for robot dest.<p>
118
<dl compact><dt><b>Parameters:</b></dt><dd>
100
<p>Return the latest BOM reading between us and another robot. </p>
101
<p>Returns the BOM reading we have for robot dest.</p>
102
<dl><dt><b>Parameters:</b></dt><dd>
119 103
  <table border="0" cellspacing="2" cellpadding="0">
120 104
    <tr><td valign="top"></td><td valign="top"><em>dest</em>&nbsp;</td><td>the robot whose relative location is returned</td></tr>
121 105
  </table>
106
  </dd>
122 107
</dl>
123
<dl class="return" compact><dt><b>Returns:</b></dt><dd>a BOM reading from us to robot dest, in the range 0-15, or -1 if it is unkown </dd></dl>
108
<dl class="return"><dt><b>Returns:</b></dt><dd>a BOM reading from us to robot dest, in the range 0-15, or -1 if it is unkown </dd></dl>
124 109

  
125 110
<p>References <a class="el" href="wireless_8c_source.html#l00235">wl_get_xbee_id()</a>, and <a class="el" href="wl__token__ring_8c_source.html#l00347">wl_token_get_sensor_reading()</a>.</p>
126 111

  
127 112
</div>
128
</div><p>
129
<a class="anchor" name="gf0d311d4feae71afc8bcb0b8c8e6ba57"></a><!-- doxytag: member="wl_token_ring.h::wl_token_get_num_robots" ref="gf0d311d4feae71afc8bcb0b8c8e6ba57" args="(void)" -->
113
</div>
114
<a class="anchor" id="gaf0d311d4feae71afc8bcb0b8c8e6ba57"></a><!-- doxytag: member="wl_token_ring.h::wl_token_get_num_robots" ref="gaf0d311d4feae71afc8bcb0b8c8e6ba57" args="(void)" -->
130 115
<div class="memitem">
131 116
<div class="memproto">
132 117
      <table class="memname">
133 118
        <tr>
134
          <td class="memname">int wl_token_get_num_robots           </td>
119
          <td class="memname">int wl_token_get_num_robots </td>
135 120
          <td>(</td>
136 121
          <td class="paramtype">void&nbsp;</td>
137
          <td class="paramname">          </td>
122
          <td class="paramname"></td>
138 123
          <td>&nbsp;)&nbsp;</td>
139 124
          <td></td>
140 125
        </tr>
......
142 127
</div>
143 128
<div class="memdoc">
144 129

  
145
<p>
146
Return the number of robots in the sensor matrix. 
147
<p>
148
Returns the number of robots currently in the token ring.<p>
149
<dl class="return" compact><dt><b>Returns:</b></dt><dd>the number of robots in the token ring </dd></dl>
130
<p>Return the number of robots in the sensor matrix. </p>
131
<p>Returns the number of robots currently in the token ring.</p>
132
<dl class="return"><dt><b>Returns:</b></dt><dd>the number of robots in the token ring </dd></dl>
150 133

  
151 134
<p>References <a class="el" href="sensor__matrix_8c_source.html#l00148">sensor_matrix_get_joined()</a>.</p>
152 135

  
153 136
</div>
154
</div><p>
155
<a class="anchor" name="g0c61bb8892aa5513706e00cd8ce5ca8b"></a><!-- doxytag: member="wl_token_ring.h::wl_token_get_robots_in_ring" ref="g0c61bb8892aa5513706e00cd8ce5ca8b" args="(void)" -->
137
</div>
138
<a class="anchor" id="ga0c61bb8892aa5513706e00cd8ce5ca8b"></a><!-- doxytag: member="wl_token_ring.h::wl_token_get_robots_in_ring" ref="ga0c61bb8892aa5513706e00cd8ce5ca8b" args="(void)" -->
156 139
<div class="memitem">
157 140
<div class="memproto">
158 141
      <table class="memname">
159 142
        <tr>
160
          <td class="memname">int wl_token_get_robots_in_ring           </td>
143
          <td class="memname">int wl_token_get_robots_in_ring </td>
161 144
          <td>(</td>
162 145
          <td class="paramtype">void&nbsp;</td>
163
          <td class="paramname">          </td>
146
          <td class="paramname"></td>
164 147
          <td>&nbsp;)&nbsp;</td>
165 148
          <td></td>
166 149
        </tr>
......
168 151
</div>
169 152
<div class="memdoc">
170 153

  
171
<p>
172
Return the number of robots in the token ring. 
173
<p>
174
Returns the number of robots in the token ring.<p>
175
<dl class="return" compact><dt><b>Returns:</b></dt><dd>the number of robots in the token ring </dd></dl>
154
<p>Return the number of robots in the token ring. </p>
155
<p>Returns the number of robots in the token ring.</p>
156
<dl class="return"><dt><b>Returns:</b></dt><dd>the number of robots in the token ring </dd></dl>
176 157

  
177 158
<p>References <a class="el" href="sensor__matrix_8c_source.html#l00148">sensor_matrix_get_joined()</a>.</p>
178 159

  
179 160
</div>
180
</div><p>
181
<a class="anchor" name="gb4afd4b8e034d22d415f3c4a42a652fc"></a><!-- doxytag: member="wl_token_ring.h::wl_token_get_sensor_reading" ref="gb4afd4b8e034d22d415f3c4a42a652fc" args="(int source, int dest)" -->
161
</div>
162
<a class="anchor" id="gab4afd4b8e034d22d415f3c4a42a652fc"></a><!-- doxytag: member="wl_token_ring.h::wl_token_get_sensor_reading" ref="gab4afd4b8e034d22d415f3c4a42a652fc" args="(int source, int dest)" -->
182 163
<div class="memitem">
183 164
<div class="memproto">
184 165
      <table class="memname">
185 166
        <tr>
186
          <td class="memname">int wl_token_get_sensor_reading           </td>
167
          <td class="memname">int wl_token_get_sensor_reading </td>
187 168
          <td>(</td>
188 169
          <td class="paramtype">int&nbsp;</td>
189 170
          <td class="paramname"> <em>source</em>, </td>
......
203 184
</div>
204 185
<div class="memdoc">
205 186

  
206
<p>
207
Return the latest BOM reading between two robots. 
208
<p>
209
Returns the BOM reading robot source has for robot dest.<p>
210
<dl compact><dt><b>Parameters:</b></dt><dd>
187
<p>Return the latest BOM reading between two robots. </p>
188
<p>Returns the BOM reading robot source has for robot dest.</p>
189
<dl><dt><b>Parameters:</b></dt><dd>
211 190
  <table border="0" cellspacing="2" cellpadding="0">
212 191
    <tr><td valign="top"></td><td valign="top"><em>source</em>&nbsp;</td><td>the robot that made the BOM reading </td></tr>
213 192
    <tr><td valign="top"></td><td valign="top"><em>dest</em>&nbsp;</td><td>the robot whose relative location is returned</td></tr>
214 193
  </table>
194
  </dd>
215 195
</dl>
216
<dl class="return" compact><dt><b>Returns:</b></dt><dd>a BOM reading from robot source to robot dest, in the range 0-15, or -1 if it is unknown </dd></dl>
196
<dl class="return"><dt><b>Returns:</b></dt><dd>a BOM reading from robot source to robot dest, in the range 0-15, or -1 if it is unknown </dd></dl>
217 197

  
218 198
<p>References <a class="el" href="sensor__matrix_8c_source.html#l00093">sensor_matrix_get_reading()</a>, <a class="el" href="wireless_8c_source.html#l00235">wl_get_xbee_id()</a>, and <a class="el" href="wl__token__ring_8c_source.html#l00394">wl_token_is_robot_in_ring()</a>.</p>
219 199

  
220 200
<p>Referenced by <a class="el" href="wl__token__ring_8c_source.html#l00367">wl_token_get_my_sensor_reading()</a>.</p>
221 201

  
222 202
</div>
223
</div><p>
224
<a class="anchor" name="g14e005f0b9582eca7e3585f247c4cd72"></a><!-- doxytag: member="wl_token_ring.h::wl_token_is_robot_in_ring" ref="g14e005f0b9582eca7e3585f247c4cd72" args="(int robot)" -->
203
</div>
204
<a class="anchor" id="ga14e005f0b9582eca7e3585f247c4cd72"></a><!-- doxytag: member="wl_token_ring.h::wl_token_is_robot_in_ring" ref="ga14e005f0b9582eca7e3585f247c4cd72" args="(int robot)" -->
225 205
<div class="memitem">
226 206
<div class="memproto">
227 207
      <table class="memname">
228 208
        <tr>
229
          <td class="memname">int wl_token_is_robot_in_ring           </td>
209
          <td class="memname">int wl_token_is_robot_in_ring </td>
230 210
          <td>(</td>
231 211
          <td class="paramtype">int&nbsp;</td>
232
          <td class="paramname"> <em>robot</em>          </td>
212
          <td class="paramname"> <em>robot</em></td>
233 213
          <td>&nbsp;)&nbsp;</td>
234 214
          <td></td>
235 215
        </tr>
......
237 217
</div>
238 218
<div class="memdoc">
239 219

  
240
<p>
241
Return whether a given robot is in the token ring. 
242
<p>
243
Returns true if the specified robot is in the token ring, false otherwise.<p>
244
<dl compact><dt><b>Parameters:</b></dt><dd>
220
<p>Return whether a given robot is in the token ring. </p>
221
<p>Returns true if the specified robot is in the token ring, false otherwise.</p>
222
<dl><dt><b>Parameters:</b></dt><dd>
245 223
  <table border="0" cellspacing="2" cellpadding="0">
246 224
    <tr><td valign="top"></td><td valign="top"><em>robot</em>&nbsp;</td><td>the robot to check for whether it is in the token ring </td></tr>
247 225
  </table>
226
  </dd>
248 227
</dl>
249
<dl class="return" compact><dt><b>Returns:</b></dt><dd>nonzero if the robot is in the token ring, zero otherwise </dd></dl>
228
<dl class="return"><dt><b>Returns:</b></dt><dd>nonzero if the robot is in the token ring, zero otherwise </dd></dl>
250 229

  
251 230
<p>References <a class="el" href="sensor__matrix_8c_source.html#l00134">sensor_matrix_get_in_ring()</a>.</p>
252 231

  
253 232
<p>Referenced by <a class="el" href="wl__token__ring_8c_source.html#l00347">wl_token_get_sensor_reading()</a>.</p>
254 233

  
255 234
</div>
256
</div><p>
257
<a class="anchor" name="g37ab9fb00e9eef273b4d0fcda81a2620"></a><!-- doxytag: member="wl_token_ring.h::wl_token_iterator_begin" ref="g37ab9fb00e9eef273b4d0fcda81a2620" args="(void)" -->
235
</div>
236
<a class="anchor" id="ga37ab9fb00e9eef273b4d0fcda81a2620"></a><!-- doxytag: member="wl_token_ring.h::wl_token_iterator_begin" ref="ga37ab9fb00e9eef273b4d0fcda81a2620" args="(void)" -->
258 237
<div class="memitem">
259 238
<div class="memproto">
260 239
      <table class="memname">
261 240
        <tr>
262
          <td class="memname">void wl_token_iterator_begin           </td>
241
          <td class="memname">void wl_token_iterator_begin </td>
263 242
          <td>(</td>
264 243
          <td class="paramtype">void&nbsp;</td>
265
          <td class="paramname">          </td>
244
          <td class="paramname"></td>
266 245
          <td>&nbsp;)&nbsp;</td>
267 246
          <td></td>
268 247
        </tr>
......
270 249
</div>
271 250
<div class="memdoc">
272 251

  
273
<p>
274
Begin iterating through robots in the token ring. 
275
<p>
276
Begins iterating through the robots in the token ring.<p>
277
<dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="group__tokenring.html#gbd7dc40ee796a67e1160b2b2b8e7d02f" title="Returns whether there are more robots to iterate through.">wl_token_iterator_has_next</a>, <a class="el" href="group__tokenring.html#gd9196324178877770d8ffc91d40893c3" title="Returns the ID of the next robot in the token ring.">wl_token_iterator_next</a> </dd></dl>
252
<p>Begin iterating through robots in the token ring. </p>
253
<p>Begins iterating through the robots in the token ring.</p>
254
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="group__tokenring.html#gabd7dc40ee796a67e1160b2b2b8e7d02f" title="Returns whether there are more robots to iterate through.">wl_token_iterator_has_next</a>, <a class="el" href="group__tokenring.html#gad9196324178877770d8ffc91d40893c3" title="Returns the ID of the next robot in the token ring.">wl_token_iterator_next</a> </dd></dl>
278 255

  
279 256
<p>References <a class="el" href="sensor__matrix_8c_source.html#l00134">sensor_matrix_get_in_ring()</a>, and <a class="el" href="sensor__matrix_8c_source.html#l00159">sensor_matrix_get_size()</a>.</p>
280 257

  
281 258
</div>
282
</div><p>
283
<a class="anchor" name="gbd7dc40ee796a67e1160b2b2b8e7d02f"></a><!-- doxytag: member="wl_token_ring.h::wl_token_iterator_has_next" ref="gbd7dc40ee796a67e1160b2b2b8e7d02f" args="(void)" -->
259
</div>
260
<a class="anchor" id="gabd7dc40ee796a67e1160b2b2b8e7d02f"></a><!-- doxytag: member="wl_token_ring.h::wl_token_iterator_has_next" ref="gabd7dc40ee796a67e1160b2b2b8e7d02f" args="(void)" -->
284 261
<div class="memitem">
285 262
<div class="memproto">
286 263
      <table class="memname">
287 264
        <tr>
288
          <td class="memname">int wl_token_iterator_has_next           </td>
265
          <td class="memname">int wl_token_iterator_has_next </td>
289 266
          <td>(</td>
290 267
          <td class="paramtype">void&nbsp;</td>
291
          <td class="paramname">          </td>
268
          <td class="paramname"></td>
292 269
          <td>&nbsp;)&nbsp;</td>
293 270
          <td></td>
294 271
        </tr>
......
296 273
</div>
297 274
<div class="memdoc">
298 275

  
299
<p>
300
Returns whether there are more robots to iterate through. 
301
<p>
302
Returns true if there are more robots in the token ring to iterate through, and false otherwise.<p>
303
<dl class="return" compact><dt><b>Returns:</b></dt><dd>nonzero if there are more robots to iterate through, zero otherwise</dd></dl>
304
<dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="group__tokenring.html#g37ab9fb00e9eef273b4d0fcda81a2620" title="Begin iterating through robots in the token ring.">wl_token_iterator_begin</a>, <a class="el" href="group__tokenring.html#gd9196324178877770d8ffc91d40893c3" title="Returns the ID of the next robot in the token ring.">wl_token_iterator_next</a> </dd></dl>
276
<p>Returns whether there are more robots to iterate through. </p>
277
<p>Returns true if there are more robots in the token ring to iterate through, and false otherwise.</p>
278
<dl class="return"><dt><b>Returns:</b></dt><dd>nonzero if there are more robots to iterate through, zero otherwise</dd></dl>
279
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="group__tokenring.html#ga37ab9fb00e9eef273b4d0fcda81a2620" title="Begin iterating through robots in the token ring.">wl_token_iterator_begin</a>, <a class="el" href="group__tokenring.html#gad9196324178877770d8ffc91d40893c3" title="Returns the ID of the next robot in the token ring.">wl_token_iterator_next</a> </dd></dl>
305 280

  
306 281
</div>
307
</div><p>
308
<a class="anchor" name="gd9196324178877770d8ffc91d40893c3"></a><!-- doxytag: member="wl_token_ring.h::wl_token_iterator_next" ref="gd9196324178877770d8ffc91d40893c3" args="(void)" -->
282
</div>
283
<a class="anchor" id="gad9196324178877770d8ffc91d40893c3"></a><!-- doxytag: member="wl_token_ring.h::wl_token_iterator_next" ref="gad9196324178877770d8ffc91d40893c3" args="(void)" -->
309 284
<div class="memitem">
310 285
<div class="memproto">
311 286
      <table class="memname">
312 287
        <tr>
313
          <td class="memname">int wl_token_iterator_next           </td>
288
          <td class="memname">int wl_token_iterator_next </td>
314 289
          <td>(</td>
315 290
          <td class="paramtype">void&nbsp;</td>
316
          <td class="paramname">          </td>
291
          <td class="paramname"></td>
317 292
          <td>&nbsp;)&nbsp;</td>
318 293
          <td></td>
319 294
        </tr>
......
321 296
</div>
322 297
<div class="memdoc">
323 298

  
324
<p>
325
Returns the ID of the next robot in the token ring. 
326
<p>
327
Returns the next robot ID in the token ring.<p>
328
<dl class="return" compact><dt><b>Returns:</b></dt><dd>the next robot ID in the token ring, or -1 if none exists</dd></dl>
329
<dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="group__tokenring.html#g37ab9fb00e9eef273b4d0fcda81a2620" title="Begin iterating through robots in the token ring.">wl_token_iterator_begin</a>, <a class="el" href="group__tokenring.html#gbd7dc40ee796a67e1160b2b2b8e7d02f" title="Returns whether there are more robots to iterate through.">wl_token_iterator_has_next</a> </dd></dl>
299
<p>Returns the ID of the next robot in the token ring. </p>
300
<p>Returns the next robot ID in the token ring.</p>
301
<dl class="return"><dt><b>Returns:</b></dt><dd>the next robot ID in the token ring, or -1 if none exists</dd></dl>
302
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="group__tokenring.html#ga37ab9fb00e9eef273b4d0fcda81a2620" title="Begin iterating through robots in the token ring.">wl_token_iterator_begin</a>, <a class="el" href="group__tokenring.html#gabd7dc40ee796a67e1160b2b2b8e7d02f" title="Returns whether there are more robots to iterate through.">wl_token_iterator_has_next</a> </dd></dl>
330 303

  
331 304
<p>References <a class="el" href="sensor__matrix_8c_source.html#l00134">sensor_matrix_get_in_ring()</a>, and <a class="el" href="sensor__matrix_8c_source.html#l00159">sensor_matrix_get_size()</a>.</p>
332 305

  
333 306
</div>
334
</div><p>
335
<a class="anchor" name="ge1012b6d6c1c46b26a6c6da7e4ec7c88"></a><!-- doxytag: member="wl_token_ring.h::wl_token_ring_join" ref="ge1012b6d6c1c46b26a6c6da7e4ec7c88" args="(void)" -->
307
</div>
308
<a class="anchor" id="gae1012b6d6c1c46b26a6c6da7e4ec7c88"></a><!-- doxytag: member="wl_token_ring.h::wl_token_ring_join" ref="gae1012b6d6c1c46b26a6c6da7e4ec7c88" args="(void)" -->
336 309
<div class="memitem">
337 310
<div class="memproto">
338 311
      <table class="memname">
339 312
        <tr>
340
          <td class="memname">int wl_token_ring_join           </td>
313
          <td class="memname">int wl_token_ring_join </td>
341 314
          <td>(</td>
342 315
          <td class="paramtype">void&nbsp;</td>
343
          <td class="paramname">          </td>
316
          <td class="paramname"></td>
344 317
          <td>&nbsp;)&nbsp;</td>
345 318
          <td></td>
346 319
        </tr>
......
348 321
</div>
349 322
<div class="memdoc">
350 323

  
351
<p>
352
Join the token ring. 
353
<p>
354
Causes the robot to join an existing token ring, or create one if no token ring exists. The token ring uses global and robot to robot packets, and does not rely on any PAN. 
324
<p>Join the token ring. </p>
325
<p>Causes the robot to join an existing token ring, or create one if no token ring exists. The token ring uses global and robot to robot packets, and does not rely on any PAN. </p>
326

  
355 327
<p>References <a class="el" href="wireless_8c_source.html#l00285">wl_send_global_packet()</a>.</p>
356 328

  
357 329
</div>
358
</div><p>
359
<a class="anchor" name="g6c2dd8742e100f63d4fb002707d1e85a"></a><!-- doxytag: member="wl_token_ring.h::wl_token_ring_leave" ref="g6c2dd8742e100f63d4fb002707d1e85a" args="(void)" -->
330
</div>
331
<a class="anchor" id="ga6c2dd8742e100f63d4fb002707d1e85a"></a><!-- doxytag: member="wl_token_ring.h::wl_token_ring_leave" ref="ga6c2dd8742e100f63d4fb002707d1e85a" args="(void)" -->
360 332
<div class="memitem">
361 333
<div class="memproto">
362 334
      <table class="memname">
363 335
        <tr>
364
          <td class="memname">void wl_token_ring_leave           </td>
336
          <td class="memname">void wl_token_ring_leave </td>
365 337
          <td>(</td>
366 338
          <td class="paramtype">void&nbsp;</td>
367
          <td class="paramname">          </td>
339
          <td class="paramname"></td>
368 340
          <td>&nbsp;)&nbsp;</td>
369 341
          <td></td>
370 342
        </tr>
......
372 344
</div>
373 345
<div class="memdoc">
374 346

  
375
<p>
376
Leave the token ring. 
377
<p>
378
Causes the robot to leave the token ring. The robot stops alerting others of its location, but continues storing the locations of other robots. 
347
<p>Leave the token ring. </p>
348
<p>Causes the robot to leave the token ring. The robot stops alerting others of its location, but continues storing the locations of other robots. </p>
349

  
379 350
</div>
380
</div><p>
381
<a class="anchor" name="g00fb5cca21a50d39aa1e82fdc679ca44"></a><!-- doxytag: member="wl_token_ring.h::wl_token_ring_register" ref="g00fb5cca21a50d39aa1e82fdc679ca44" args="(void)" -->
351
</div>
352
<a class="anchor" id="ga00fb5cca21a50d39aa1e82fdc679ca44"></a><!-- doxytag: member="wl_token_ring.h::wl_token_ring_register" ref="ga00fb5cca21a50d39aa1e82fdc679ca44" args="(void)" -->
382 353
<div class="memitem">
383 354
<div class="memproto">
384 355
      <table class="memname">
385 356
        <tr>
386
          <td class="memname">int wl_token_ring_register           </td>
357
          <td class="memname">int wl_token_ring_register </td>
387 358
          <td>(</td>
388 359
          <td class="paramtype">void&nbsp;</td>
389
          <td class="paramname">          </td>
360
          <td class="paramname"></td>
390 361
          <td>&nbsp;)&nbsp;</td>
391 362
          <td></td>
392 363
        </tr>
......
394 365
</div>
395 366
<div class="memdoc">
396 367

  
397
<p>
398
Register the token ring group with the wireless library. 
399
<p>
400
Initialize the token ring packet group and register it with the wireless library. The robot will not join a token ring. 
368
<p>Register the token ring group with the wireless library. </p>
369
<p>Initialize the token ring packet group and register it with the wireless library. The robot will not join a token ring. </p>
370

  
401 371
<p>References <a class="el" href="sensor__matrix_8c_source.html#l00049">sensor_matrix_create()</a>, <a class="el" href="sensor__matrix_8c_source.html#l00111">sensor_matrix_set_in_ring()</a>, <a class="el" href="wireless_8c_source.html#l00235">wl_get_xbee_id()</a>, and <a class="el" href="wireless_8c_source.html#l00342">wl_register_packet_group()</a>.</p>
402 372

  
403 373
</div>
404
</div><p>
405
<a class="anchor" name="g0c407d5c215a97d58c67006bcc6e53ce"></a><!-- doxytag: member="wl_token_ring.h::wl_token_ring_set_bom_functions" ref="g0c407d5c215a97d58c67006bcc6e53ce" args="(void(*on_function)(void), void(*off_function)(void), int(*max_bom_function)(void))" -->
374
</div>
375
<a class="anchor" id="ga0c407d5c215a97d58c67006bcc6e53ce"></a><!-- doxytag: member="wl_token_ring.h::wl_token_ring_set_bom_functions" ref="ga0c407d5c215a97d58c67006bcc6e53ce" args="(void(*on_function)(void), void(*off_function)(void), int(*max_bom_function)(void))" -->
406 376
<div class="memitem">
407 377
<div class="memproto">
408 378
      <table class="memname">
409 379
        <tr>
410
          <td class="memname">void wl_token_ring_set_bom_functions           </td>
380
          <td class="memname">void wl_token_ring_set_bom_functions </td>
411 381
          <td>(</td>
412 382
          <td class="paramtype">void(*)(void)&nbsp;</td>
413 383
          <td class="paramname"> <em>on_function</em>, </td>
......
433 403
</div>
434 404
<div class="memdoc">
435 405

  
436
<p>
437
Set the functions called to turn the bom on and off. 
438
<p>
439
Sets the functions that are called when the BOM ought to be turned on or off. This could be used for things such as charging stations, which have multiple BOMs.<p>
440
<dl compact><dt><b>Parameters:</b></dt><dd>
406
<p>Set the functions called to turn the bom on and off. </p>
407
<p>Sets the functions that are called when the BOM ought to be turned on or off. This could be used for things such as charging stations, which have multiple BOMs.</p>
408
<dl><dt><b>Parameters:</b></dt><dd>
441 409
  <table border="0" cellspacing="2" cellpadding="0">
442 410
    <tr><td valign="top"></td><td valign="top"><em>on_function</em>&nbsp;</td><td>the function to be called when the BOM should be turned on </td></tr>
443 411
    <tr><td valign="top"></td><td valign="top"><em>off_function</em>&nbsp;</td><td>the function to be called when the BOM should be turned off </td></tr>
444 412
    <tr><td valign="top"></td><td valign="top"><em>max_bom_function</em>&nbsp;</td><td>the function to be called when a measurement of the maximum BOM reading is needed. </td></tr>
445 413
  </table>
414
  </dd>
446 415
</dl>
447 416

  
448 417
</div>
449
</div><p>
450
<a class="anchor" name="gde3dd682b6a757bab6ce4cbc9c518f8e"></a><!-- doxytag: member="wl_token_ring.h::wl_token_ring_unregister" ref="gde3dd682b6a757bab6ce4cbc9c518f8e" args="(void)" -->
418
</div>
419
<a class="anchor" id="gade3dd682b6a757bab6ce4cbc9c518f8e"></a><!-- doxytag: member="wl_token_ring.h::wl_token_ring_unregister" ref="gade3dd682b6a757bab6ce4cbc9c518f8e" args="(void)" -->
451 420
<div class="memitem">
452 421
<div class="memproto">
453 422
      <table class="memname">
454 423
        <tr>
455
          <td class="memname">void wl_token_ring_unregister           </td>
424
          <td class="memname">void wl_token_ring_unregister </td>
456 425
          <td>(</td>
457 426
          <td class="paramtype">void&nbsp;</td>
458
          <td class="paramname">          </td>
427
          <td class="paramname"></td>
459 428
          <td>&nbsp;)&nbsp;</td>
460 429
          <td></td>
461 430
        </tr>
......
463 432
</div>
464 433
<div class="memdoc">
465 434

  
466
<p>
467
Unregister the token ring group with the wirelss library. 
468
<p>
469
Removes the packet group from the wireless library. 
435
<p>Unregister the token ring group with the wirelss library. </p>
436
<p>Removes the packet group from the wireless library. </p>
437

  
470 438
<p>References <a class="el" href="wireless_8c_source.html#l00362">wl_unregister_packet_group()</a>.</p>
471 439

  
472 440
</div>
473
</div><p>
474 441
</div>
475
<hr size="1"><address style="text-align: right;"><small>Generated on Tue Sep 8 19:59:17 2009 for libwireless by&nbsp;
442
</div>
443
<hr size="1"/><address style="text-align: right;"><small>Generated on Sun Sep 20 12:12:02 2009 for libwireless by&nbsp;
476 444
<a href="http://www.doxygen.org/index.html">
477
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.9 </small></address>
445
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.1 </small></address>
478 446
</body>
479 447
</html>

Also available in: Unified diff