OSDN Git Service

lejos_NXJ_win32_0_5_0beta.zip
[nxt-jsp/lejos_nxj.git] / nxtOSEK / lejos_nxj / docs / apidocs / lejos / rcxcomm / Serial.html
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2 <!--NewPage-->
3 <HTML>
4 <HEAD>
5 <!-- Generated by javadoc (build 1.5.0_09) on Tue Jan 08 20:46:01 GMT 2008 -->
6 <TITLE>
7 Serial (leJOS NXT API documentation)
8 </TITLE>
9
10 <META NAME="keywords" CONTENT="lejos.rcxcomm.Serial class">
11
12 <LINK REL ="stylesheet" TYPE="text/css" HREF="../../stylesheet.css" TITLE="Style">
13
14 <SCRIPT type="text/javascript">
15 function windowTitle()
16 {
17     parent.document.title="Serial (leJOS NXT API documentation)";
18 }
19 </SCRIPT>
20 <NOSCRIPT>
21 </NOSCRIPT>
22
23 </HEAD>
24
25 <BODY BGCOLOR="white" onload="windowTitle();">
26
27
28 <!-- ========= START OF TOP NAVBAR ======= -->
29 <A NAME="navbar_top"><!-- --></A>
30 <A HREF="#skip-navbar_top" title="Skip navigation links"></A>
31 <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
32 <TR>
33 <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
34 <A NAME="navbar_top_firstrow"><!-- --></A>
35 <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
36   <TR ALIGN="center" VALIGN="top">
37   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
38   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
39   <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
40   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
41   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
42   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
43   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
44   </TR>
45 </TABLE>
46 </TD>
47 <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
48 </EM>
49 </TD>
50 </TR>
51
52 <TR>
53 <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
54 &nbsp;<A HREF="../../lejos/rcxcomm/RCXPort.html" title="class in lejos.rcxcomm"><B>PREV CLASS</B></A>&nbsp;
55 &nbsp;NEXT CLASS</FONT></TD>
56 <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
57   <A HREF="../../index.html?lejos/rcxcomm/Serial.html" target="_top"><B>FRAMES</B></A>  &nbsp;
58 &nbsp;<A HREF="Serial.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
59 &nbsp;<SCRIPT type="text/javascript">
60   <!--
61   if(window==top) {
62     document.writeln('<A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>');
63   }
64   //-->
65 </SCRIPT>
66 <NOSCRIPT>
67   <A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>
68 </NOSCRIPT>
69
70
71 </FONT></TD>
72 </TR>
73 <TR>
74 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
75   SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
76 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
77 DETAIL:&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
78 </TR>
79 </TABLE>
80 <A NAME="skip-navbar_top"></A>
81 <!-- ========= END OF TOP NAVBAR ========= -->
82
83 <HR>
84 <!-- ======== START OF CLASS DATA ======== -->
85 <H2>
86 <FONT SIZE="-1">
87 lejos.rcxcomm</FONT>
88 <BR>
89 Class Serial</H2>
90 <PRE>
91 <A HREF="../../java/lang/Object.html" title="class in java.lang">java.lang.Object</A>
92   <IMG SRC="../../resources/inherit.gif" ALT="extended by "><B>lejos.rcxcomm.Serial</B>
93 </PRE>
94 <HR>
95 <DL>
96 <DT><PRE>public class <B>Serial</B><DT>extends <A HREF="../../java/lang/Object.html" title="class in java.lang">Object</A></DL>
97 </PRE>
98
99 <P>
100 Emulation of the RCX Serial class with mindstorms NRLINK adapter.
101 <P>
102
103 <P>
104 <DL>
105 <DT><B>Author:</B></DT>
106   <DD>Lawrie Griffiths</DD>
107 </DL>
108 <HR>
109
110 <P>
111
112 <!-- ========== METHOD SUMMARY =========== -->
113
114 <A NAME="method_summary"><!-- --></A>
115 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
116 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
117 <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
118 <B>Method Summary</B></FONT></TH>
119 </TR>
120 <TR BGCOLOR="white" CLASS="TableRowColor">
121 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
122 <CODE>static&nbsp;<A HREF="../../lejos/nxt/RCXLink.html" title="class in lejos.nxt">RCXLink</A></CODE></FONT></TD>
123 <TD><CODE><B><A HREF="../../lejos/rcxcomm/Serial.html#getLink()">getLink</A></B>()</CODE>
124
125 <BR>
126 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Get the RCXLink object associated with the Serial class</TD>
127 </TR>
128 <TR BGCOLOR="white" CLASS="TableRowColor">
129 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
130 <CODE>static&nbsp;boolean</CODE></FONT></TD>
131 <TD><CODE><B><A HREF="../../lejos/rcxcomm/Serial.html#isPacketAvailable()">isPacketAvailable</A></B>()</CODE>
132
133 <BR>
134 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Test if a packet is available</TD>
135 </TR>
136 <TR BGCOLOR="white" CLASS="TableRowColor">
137 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
138 <CODE>static&nbsp;int</CODE></FONT></TD>
139 <TD><CODE><B><A HREF="../../lejos/rcxcomm/Serial.html#readPacket(byte[])">readPacket</A></B>(byte[]&nbsp;aBuffer)</CODE>
140
141 <BR>
142 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Read an assembled packet.</TD>
143 </TR>
144 <TR BGCOLOR="white" CLASS="TableRowColor">
145 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
146 <CODE>static&nbsp;void</CODE></FONT></TD>
147 <TD><CODE><B><A HREF="../../lejos/rcxcomm/Serial.html#resetSerial()">resetSerial</A></B>()</CODE>
148
149 <BR>
150 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Reset the link - null</TD>
151 </TR>
152 <TR BGCOLOR="white" CLASS="TableRowColor">
153 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
154 <CODE>static&nbsp;boolean</CODE></FONT></TD>
155 <TD><CODE><B><A HREF="../../lejos/rcxcomm/Serial.html#sendPacket(byte[], int, int)">sendPacket</A></B>(byte[]&nbsp;aBuffer,
156            int&nbsp;aOffset,
157            int&nbsp;aLen)</CODE>
158
159 <BR>
160 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Send a packet</TD>
161 </TR>
162 <TR BGCOLOR="white" CLASS="TableRowColor">
163 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
164 <CODE>static&nbsp;void</CODE></FONT></TD>
165 <TD><CODE><B><A HREF="../../lejos/rcxcomm/Serial.html#setPort(lejos.nxt.SensorPort)">setPort</A></B>(<A HREF="../../lejos/nxt/SensorPort.html" title="class in lejos.nxt">SensorPort</A>&nbsp;port)</CODE>
166
167 <BR>
168 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Set the sensor port</TD>
169 </TR>
170 <TR BGCOLOR="white" CLASS="TableRowColor">
171 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
172 <CODE>static&nbsp;void</CODE></FONT></TD>
173 <TD><CODE><B><A HREF="../../lejos/rcxcomm/Serial.html#setRangeLong()">setRangeLong</A></B>()</CODE>
174
175 <BR>
176 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Set long range</TD>
177 </TR>
178 <TR BGCOLOR="white" CLASS="TableRowColor">
179 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
180 <CODE>static&nbsp;void</CODE></FONT></TD>
181 <TD><CODE><B><A HREF="../../lejos/rcxcomm/Serial.html#setRangeShort()">setRangeShort</A></B>()</CODE>
182
183 <BR>
184 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Set short range</TD>
185 </TR>
186 <TR BGCOLOR="white" CLASS="TableRowColor">
187 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
188 <CODE>static&nbsp;void</CODE></FONT></TD>
189 <TD><CODE><B><A HREF="../../lejos/rcxcomm/Serial.html#waitTillSent()">waitTillSent</A></B>()</CODE>
190
191 <BR>
192 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Wait until the packet is sent - null</TD>
193 </TR>
194 </TABLE>
195 &nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
196 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
197 <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
198 <TH ALIGN="left"><B>Methods inherited from class java.lang.<A HREF="../../java/lang/Object.html" title="class in java.lang">Object</A></B></TH>
199 </TR>
200 <TR BGCOLOR="white" CLASS="TableRowColor">
201 <TD><CODE><A HREF="../../java/lang/Object.html#equals(java.lang.Object)">equals</A>, <A HREF="../../java/lang/Object.html#getClass()">getClass</A>, <A HREF="../../java/lang/Object.html#hashCode()">hashCode</A>, <A HREF="../../java/lang/Object.html#notify()">notify</A>, <A HREF="../../java/lang/Object.html#notifyAll()">notifyAll</A>, <A HREF="../../java/lang/Object.html#toString()">toString</A>, <A HREF="../../java/lang/Object.html#wait()">wait</A>, <A HREF="../../java/lang/Object.html#wait(long)">wait</A></CODE></TD>
202 </TR>
203 </TABLE>
204 &nbsp;
205 <P>
206
207 <!-- ============ METHOD DETAIL ========== -->
208
209 <A NAME="method_detail"><!-- --></A>
210 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
211 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
212 <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
213 <B>Method Detail</B></FONT></TH>
214 </TR>
215 </TABLE>
216
217 <A NAME="setPort(lejos.nxt.SensorPort)"><!-- --></A><H3>
218 setPort</H3>
219 <PRE>
220 public static void <B>setPort</B>(<A HREF="../../lejos/nxt/SensorPort.html" title="class in lejos.nxt">SensorPort</A>&nbsp;port)</PRE>
221 <DL>
222 <DD>Set the sensor port
223 <P>
224 <DD><DL>
225 <DT><B>Parameters:</B><DD><CODE>port</CODE> - the sensor port the link is connected to</DL>
226 </DD>
227 </DL>
228 <HR>
229
230 <A NAME="readPacket(byte[])"><!-- --></A><H3>
231 readPacket</H3>
232 <PRE>
233 public static int <B>readPacket</B>(byte[]&nbsp;aBuffer)</PRE>
234 <DL>
235 <DD>Read an assembled packet. NRLink only seems to read
236  one byte at a time reliably, and does not
237  return zero bytes.
238 <P>
239 <DD><DL>
240 <DT><B>Parameters:</B><DD><CODE>aBuffer</CODE> - the buffer to return the packet into
241 <DT><B>Returns:</B><DD>the number of bytes in the packet</DL>
242 </DD>
243 </DL>
244 <HR>
245
246 <A NAME="isPacketAvailable()"><!-- --></A><H3>
247 isPacketAvailable</H3>
248 <PRE>
249 public static boolean <B>isPacketAvailable</B>()</PRE>
250 <DL>
251 <DD>Test if a packet is available
252 <P>
253 <DD><DL>
254
255 <DT><B>Returns:</B><DD>true iff a packiet is available</DL>
256 </DD>
257 </DL>
258 <HR>
259
260 <A NAME="sendPacket(byte[], int, int)"><!-- --></A><H3>
261 sendPacket</H3>
262 <PRE>
263 public static boolean <B>sendPacket</B>(byte[]&nbsp;aBuffer,
264                                  int&nbsp;aOffset,
265                                  int&nbsp;aLen)</PRE>
266 <DL>
267 <DD>Send a packet
268 <P>
269 <DD><DL>
270 <DT><B>Parameters:</B><DD><CODE>aBuffer</CODE> - the buffer containing the packet<DD><CODE>aOffset</CODE> - the offset in the buffer - must be zero<DD><CODE>aLen</CODE> - the length of the packet
271 <DT><B>Returns:</B><DD>true iff the packet was successfully sent</DL>
272 </DD>
273 </DL>
274 <HR>
275
276 <A NAME="setRangeLong()"><!-- --></A><H3>
277 setRangeLong</H3>
278 <PRE>
279 public static void <B>setRangeLong</B>()</PRE>
280 <DL>
281 <DD>Set long range
282 <P>
283 <DD><DL>
284 </DL>
285 </DD>
286 </DL>
287 <HR>
288
289 <A NAME="setRangeShort()"><!-- --></A><H3>
290 setRangeShort</H3>
291 <PRE>
292 public static void <B>setRangeShort</B>()</PRE>
293 <DL>
294 <DD>Set short range
295 <P>
296 <DD><DL>
297 </DL>
298 </DD>
299 </DL>
300 <HR>
301
302 <A NAME="resetSerial()"><!-- --></A><H3>
303 resetSerial</H3>
304 <PRE>
305 public static void <B>resetSerial</B>()</PRE>
306 <DL>
307 <DD>Reset the link - null
308 <P>
309 <DD><DL>
310 </DL>
311 </DD>
312 </DL>
313 <HR>
314
315 <A NAME="waitTillSent()"><!-- --></A><H3>
316 waitTillSent</H3>
317 <PRE>
318 public static void <B>waitTillSent</B>()</PRE>
319 <DL>
320 <DD>Wait until the packet is sent - null
321 <P>
322 <DD><DL>
323 </DL>
324 </DD>
325 </DL>
326 <HR>
327
328 <A NAME="getLink()"><!-- --></A><H3>
329 getLink</H3>
330 <PRE>
331 public static <A HREF="../../lejos/nxt/RCXLink.html" title="class in lejos.nxt">RCXLink</A> <B>getLink</B>()</PRE>
332 <DL>
333 <DD>Get the RCXLink object associated with the Serial class
334 <P>
335 <DD><DL>
336
337 <DT><B>Returns:</B><DD>the link</DL>
338 </DD>
339 </DL>
340 <!-- ========= END OF CLASS DATA ========= -->
341 <HR>
342
343
344 <!-- ======= START OF BOTTOM NAVBAR ====== -->
345 <A NAME="navbar_bottom"><!-- --></A>
346 <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
347 <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
348 <TR>
349 <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
350 <A NAME="navbar_bottom_firstrow"><!-- --></A>
351 <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
352   <TR ALIGN="center" VALIGN="top">
353   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
354   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
355   <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
356   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
357   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
358   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
359   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
360   </TR>
361 </TABLE>
362 </TD>
363 <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
364 </EM>
365 </TD>
366 </TR>
367
368 <TR>
369 <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
370 &nbsp;<A HREF="../../lejos/rcxcomm/RCXPort.html" title="class in lejos.rcxcomm"><B>PREV CLASS</B></A>&nbsp;
371 &nbsp;NEXT CLASS</FONT></TD>
372 <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
373   <A HREF="../../index.html?lejos/rcxcomm/Serial.html" target="_top"><B>FRAMES</B></A>  &nbsp;
374 &nbsp;<A HREF="Serial.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
375 &nbsp;<SCRIPT type="text/javascript">
376   <!--
377   if(window==top) {
378     document.writeln('<A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>');
379   }
380   //-->
381 </SCRIPT>
382 <NOSCRIPT>
383   <A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>
384 </NOSCRIPT>
385
386
387 </FONT></TD>
388 </TR>
389 <TR>
390 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
391   SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
392 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
393 DETAIL:&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
394 </TR>
395 </TABLE>
396 <A NAME="skip-navbar_bottom"></A>
397 <!-- ======== END OF BOTTOM NAVBAR ======= -->
398
399 <HR>
400
401 </BODY>
402 </HTML>