jAER project on SourceForge

ch.unizh.ini.jaer.projects.pencilbalancer
Class HWPort

java.lang.Object
  extended by ch.unizh.ini.jaer.projects.pencilbalancer.HWPort
Direct Known Subclasses:
HWP_RS232

public abstract class HWPort
extends java.lang.Object


Nested Class Summary
 class HWPort.PortAttribute
           
 class HWPort.PortIdentifier
           
 
Field Summary
protected  int bytesInBuffer
           
protected  byte[] inputBuffer
           
protected  int inputBufferMask
           
protected  int inputBufferReadPointer
           
protected  int inputBufferSize
           
protected  int inputBufferWritePointer
           
protected  java.io.InputStream inputStream
           
protected  java.io.OutputStream outputStream
           
 
Constructor Summary
HWPort()
           
 
Method Summary
 int byteCountAvailable()
           
 boolean bytesAvailable()
           
abstract  int close()
           
 int flushOutput()
           
abstract  java.util.List<HWPort.PortAttribute> getPortAttributeList()
           
abstract  java.util.List<HWPort.PortIdentifier> getPortIdentifierList()
           
abstract  boolean isOpen()
           
abstract  int open(java.lang.String portName, HWPort.PortAttribute pa)
           
 int purgeInput()
           
 byte[] readByteLine()
           
 byte[] readByteLine(int timeOutMS)
           
 byte[] readBytes(int maxBytes)
           
 byte[] readExactBytes(int byteCount)
           
 java.lang.String readLine()
           
 java.lang.String readLine(int timeOutMS)
           
 java.lang.String readLineFraction(int timeOutMS)
           
 boolean sendCommand(java.lang.String command)
           
 boolean sendCommand(java.lang.String command, java.lang.String expectedReturn)
           
 boolean sendCommand(java.lang.String command, java.lang.String expectedReturn, int timeOut)
           
abstract  int setAttribute(HWPort.PortAttribute pa)
           
protected abstract  int updateBuffer()
           
abstract  int write(byte[] b)
           
 int write(java.lang.String messageString)
           
 int writeChar(char c)
           
 int writeLn(java.lang.String messageString)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

outputStream

protected java.io.OutputStream outputStream

inputStream

protected java.io.InputStream inputStream

inputBufferSize

protected final int inputBufferSize
See Also:
Constant Field Values

inputBufferMask

protected final int inputBufferMask
See Also:
Constant Field Values

inputBufferReadPointer

protected int inputBufferReadPointer

inputBufferWritePointer

protected int inputBufferWritePointer

bytesInBuffer

protected int bytesInBuffer

inputBuffer

protected byte[] inputBuffer
Constructor Detail

HWPort

public HWPort()
Method Detail

getPortIdentifierList

public abstract java.util.List<HWPort.PortIdentifier> getPortIdentifierList()

getPortAttributeList

public abstract java.util.List<HWPort.PortAttribute> getPortAttributeList()

open

public abstract int open(java.lang.String portName,
                         HWPort.PortAttribute pa)

isOpen

public abstract boolean isOpen()

close

public abstract int close()

setAttribute

public abstract int setAttribute(HWPort.PortAttribute pa)

purgeInput

public int purgeInput()

flushOutput

public int flushOutput()

write

public abstract int write(byte[] b)

writeChar

public int writeChar(char c)

write

public int write(java.lang.String messageString)

writeLn

public int writeLn(java.lang.String messageString)

updateBuffer

protected abstract int updateBuffer()

bytesAvailable

public boolean bytesAvailable()

byteCountAvailable

public int byteCountAvailable()

readExactBytes

public byte[] readExactBytes(int byteCount)

readBytes

public byte[] readBytes(int maxBytes)

readByteLine

public byte[] readByteLine()

readByteLine

public byte[] readByteLine(int timeOutMS)

readLine

public java.lang.String readLine()

readLine

public java.lang.String readLine(int timeOutMS)

readLineFraction

public java.lang.String readLineFraction(int timeOutMS)

sendCommand

public boolean sendCommand(java.lang.String command)

sendCommand

public boolean sendCommand(java.lang.String command,
                           java.lang.String expectedReturn,
                           int timeOut)

sendCommand

public boolean sendCommand(java.lang.String command,
                           java.lang.String expectedReturn)

jAER project on SourceForge