SunSPOT host API V5.0


com.sun.spot.client
Class SerialPortWrapper

java.lang.Object
  extended by com.sun.spot.client.SerialPortWrapper

public class SerialPortWrapper
extends Object

SerialPortWrapper wraps an RXTX SerialPort to centralise the parameters for opening it, and to provide easy access to its streams. The optional input stream works around a timeout bug in RXTX. The output stream recovers from the weird rxtx error seen from time to time (bug 1146) TODO replace duplicate code in host-agent


Nested Class Summary
static class SerialPortWrapper.NoTimeoutInputStream
           
 
Constructor Summary
SerialPortWrapper(String port, IUI ui)
           
 
Method Summary
 void close()
           
 InputStream getInputStream()
           
 OutputStream getOutputStream()
           
 boolean isInRecovery()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SerialPortWrapper

public SerialPortWrapper(String port,
                         IUI ui)
                  throws IOException
Throws:
IOException
Method Detail

getOutputStream

public OutputStream getOutputStream()

getInputStream

public InputStream getInputStream()

close

public void close()

toString

public String toString()
Overrides:
toString in class Object

isInRecovery

public boolean isInRecovery()

SunSPOT host API V5.0


Copyright © 2006-2008 Sun Microsystems, Inc. All Rights Reserved.