com.scottpreston.javarobot.chapter2
Class StandardSerialPort
java.lang.Object
com.scottpreston.javarobot.chapter2.StandardSerialPort
- All Implemented Interfaces:
- JSerialPort, java.util.EventListener, SerialPortEventListener
public class StandardSerialPort
- extends java.lang.Object
- implements SerialPortEventListener, JSerialPort
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
StandardSerialPort
public StandardSerialPort(int id)
throws java.lang.Exception
- Throws:
java.lang.Exception
StandardSerialPort
public StandardSerialPort(int id,
int baud)
throws java.lang.Exception
- Throws:
java.lang.Exception
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
close
public void close()
- Specified by:
close
in interface JSerialPort
read
public byte[] read(byte[] b)
throws java.lang.Exception
- Specified by:
read
in interface JSerialPort
- Throws:
java.lang.Exception
readString
public java.lang.String readString(byte[] b)
throws java.lang.Exception
- Specified by:
readString
in interface JSerialPort
- Throws:
java.lang.Exception
serialEvent
public void serialEvent(SerialPortEvent event)
- Description copied from interface:
SerialPortEventListener
- Notifies this listener of a serial port event.
- Specified by:
serialEvent
in interface SerialPortEventListener
- Parameters:
event
- the event
setTimeout
public void setTimeout(int timeout)
- Specified by:
setTimeout
in interface JSerialPort
setDTR
public void setDTR(boolean dtr)
- Specified by:
setDTR
in interface JSerialPort
getName
public java.lang.String getName()