com.scottpreston.javarobot.chapter2
Class WebSerialClient

java.lang.Object
  extended by com.scottpreston.javarobot.chapter2.WebSerialClient
All Implemented Interfaces:
JSerialPort

public class WebSerialClient
extends java.lang.Object
implements JSerialPort


Field Summary
static int MAX_DELAY
           
 
Fields inherited from interface com.scottpreston.javarobot.chapter2.JSerialPort
READ_COMMAND, WRITE_COMMAND, WRITE_READ_COMMAND
 
Constructor Summary
WebSerialClient(java.lang.String server, java.lang.String tcpPort, java.lang.String portId)
           
 
Method Summary
 void close()
           
 int getTimeout()
           
static void main(java.lang.String[] args)
           
 byte[] read()
           
 byte[] read(byte[] b)
           
 java.lang.String readString()
           
 java.lang.String readString(byte[] b)
           
 void setDTR(boolean dtr)
           
 void setTimeout(int timeout)
           
 void write(byte[] b)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAX_DELAY

public static final int MAX_DELAY
See Also:
Constant Field Values
Constructor Detail

WebSerialClient

public WebSerialClient(java.lang.String server,
                       java.lang.String tcpPort,
                       java.lang.String portId)
Method Detail

read

public byte[] read()
Specified by:
read in interface JSerialPort

readString

public java.lang.String readString()
Specified by:
readString in interface JSerialPort

write

public void write(byte[] b)
           throws java.lang.Exception
Specified by:
write in interface JSerialPort
Throws:
java.lang.Exception

read

public byte[] read(byte[] b)
Specified by:
read in interface JSerialPort

readString

public java.lang.String readString(byte[] b)
Specified by:
readString in interface JSerialPort

close

public void close()
Specified by:
close in interface JSerialPort

setDTR

public void setDTR(boolean dtr)
Specified by:
setDTR in interface JSerialPort

getTimeout

public int getTimeout()

setTimeout

public void setTimeout(int timeout)
Specified by:
setTimeout in interface JSerialPort

main

public static void main(java.lang.String[] args)