Article View: borland.public.jbuilder.java.api
Article #2653javax.comm problems
From: Trejkaz Xaoza
Date: Tue, 25 Jul 2000 00:00
Date: Tue, 25 Jul 2000 00:00
52 lines
2015 bytes
2015 bytes
This optional package is causing me some headaches.
I have a device (a GameBoy cartridge writer, to be precise), which
connects
on the parallel port. It only works when the parallel port is in EPP
mode.
My BIOS settings definitely have the parallel port LPT1 set to EPP.
Running my test program, I can't set the port to EPP mode. Weird
stuff...
code follows.
TX
-----begin code-----
import java.util.Enumeration;
import javax.comm.*;
public class CommTest {
public static void main(String[] args) {
// get the list of comm ports
Enumeration commPorts = CommPortIdentifier.getPortIdentifiers();
while(commPorts.hasMoreElements()) {
CommPortIdentifier portId =
(CommPortIdentifier)commPorts.nextElement();
if (portId.getName().equalsIgnoreCase("LPT1")) {
ParallelPort port = null;
try {
port = (ParallelPort)portId.open("CommTest", 1000);
}
catch (PortInUseException e) {
System.err.println("Port is in use.");
System.exit(1);
}
try {
port.setMode(ParallelPort.LPT_MODE_EPP);
}
catch (UnsupportedCommOperationException ex) {
System.err.println("LPT_MODE_EPP unsupported");
}
port.close();
}
}
}
}
-----end code-----
Technical Details
Message-ID:
<397CE04B.D407AE5F@xaoza.net>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1089d0,e6f521c3a621d293,start X-Google-Attributes: gid1089d0,public From: Trejkaz Xaoza <trejkaz@xaoza.net> Subject: javax.comm problems Date: 2000/07/25 Message-ID: <397CE04B.D407AE5F@xaoza.net> X-Deja-AN: 650353356 Content-Transfer-Encoding: 7bit X-Accept-Language: en Content-Type: text/plain; charset=us-ascii X-Trace: 24 Jul 2000 17:23:50 -0800, 203.18.229.43 MIME-Version: 1.0 Newsgroups: borland.public.jbuilder.java.api