ch.aplu.util
Class LptPort

java.lang.Object
  |
  +--ch.aplu.util.LptPort

public class LptPort
extends java.lang.Object


Constructor Summary
LptPort()
           
 
Method Summary
 void close()
          Close port Does nothing, if port is not open.
 boolean isOpen()
          Return true if port is open, false otherwise.
 int open(int address)
          Open LPT port at specified base address, e.g. 0x378.
 int readData()
          Return content of data port (at base address) in lower byte.
 int readStatus()
          Return content of status port (at base address + 1) in lower byte.
 int writeControl(int data)
          Write lower byte of data into control port (at base address + 2).
 int writeData(int data)
          Write lower byte of data into data port (at base address).
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LptPort

public LptPort()
Method Detail

close

public void close()
Close port Does nothing, if port is not open.


isOpen

public boolean isOpen()
Return true if port is open, false otherwise.


open

public int open(int address)
Open LPT port at specified base address, e.g. 0x378. Return 0 if successful, -1 otherwise.


readData

public int readData()
Return content of data port (at base address) in lower byte. (Upper byte is 0.) Return -1 if port is not open.


readStatus

public int readStatus()
Return content of status port (at base address + 1) in lower byte. (Upper byte is 0.) Return -1 if port is not open.


writeControl

public int writeControl(int data)
Write lower byte of data into control port (at base address + 2). (Upper byte is ignored.) Return -1 if port is not open, 0 otherwise


writeData

public int writeData(int data)
Write lower byte of data into data port (at base address). (Upper byte is ignored.) Return -1 if port is not open, 0 otherwise