|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object ch.aplu.util.LptPort
public class LptPort
Support to write to and read from the LPT port registers on a Windows operating system. Uses the Java Native Interface (JNI) and INPOUT32.DLL by Jan Axelsons. Circumvents Windows protection of I/O-ports on W2K, XP, W2003 OS by installing a driver on the fly (when opening the port). INPOUT32.DLL and JLPTPORT.DLL needed in file system path (distributed with Examples, Chap. 34).
Field Summary | |
---|---|
static int |
ACKNOWLEDGE
Bit value of Acknowledge line in status register of LPT port (at base address + 1). |
static int |
AUTOLINEFEED
Bit value of Auto Linefeed line in control register of LPT port (at base address + 2). |
static int |
BUSY
Bit value of Busy line in status register of LPT port (at base address + 1). |
static int |
DATA0
Bit value of bit 0 in data register of LPT port (at base address). |
static int |
DATA1
Bit value of bit 1 in data register of LPT port (at base address). |
static int |
DATA2
Bit value of bit 2 in data register of LPT port (at base address). |
static int |
DATA3
Bit value of bit 3 in data register of LPT port (at base address). |
static int |
DATA4
Bit value of bit 4 in data register of LPT port (at base address). |
static int |
DATA5
Bit value of bit 5 in data register of LPT port (at base address). |
static int |
DATA6
Bit value of bit 6 in data register of LPT port (at base address). |
static int |
DATA7
Bit value of bit 7 in data register of LPT port (at base address). |
static int |
ERROR
Bit value of Error line in status register of LPT port (at base address + 1). |
static int |
INITRESET
Bit value of Init/Reset line in control register of LPT port (at base address + 2). |
static int |
PAPEREND
Bit value of Paper End line in status register of LPT port (at base address + 1). |
static int |
SELECT
Bit value of Select line in status register of LPT port (at base address + 1). |
static int |
SELECTIN
Bit value of Select In line in control register of LPT port (at base address + 2). |
static int |
STROBE
Bit value of Strobe line in control register of LPT port (at base address + 2). |
Constructor Summary | |
---|---|
LptPort()
|
Method Summary | |
---|---|
void |
close()
Close port Do 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 |
Field Detail |
---|
public static final int DATA0
public static final int DATA1
public static final int DATA2
public static final int DATA3
public static final int DATA4
public static final int DATA5
public static final int DATA6
public static final int DATA7
public static final int ERROR
public static final int SELECT
public static final int PAPEREND
public static final int ACKNOWLEDGE
public static final int BUSY
public static final int STROBE
public static final int AUTOLINEFEED
public static final int INITRESET
public static final int SELECTIN
Constructor Detail |
---|
public LptPort()
Method Detail |
---|
public int open(int address)
public boolean isOpen()
public int writeData(int data)
public int writeControl(int data)
public int readData()
public int readStatus()
public void close()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |