Christian said:
OK, but i use a RS-232 serial PCMCIA card, where to the PCMCIA card 4
RS-232 ports are connected. These ports are seen by the OS (Win98,
W2K, WinXP) and listed as COM ports, but not by the COMM API.
Does you or anyone else know any alternative to the COMM API?
Oh ! That's different. If it is a PCMCIA card that add serial ports,
then yes they should be found by the COMM PAI (provided these ports are
listed in the Hardware/Device Manager, which is the case as I read you).
Try the sample code of the COMMAPI to simply list the ports seen Java.
It should list the Parallel port and the serial ports. All
Virtual/Emulated Serial ports should appear (I can list the Serial Port
created by my BlueTooth dongle, or I use to emulate a serial Port other
InfraRed). Also if you have an internal modem, it should list the
virtual serial port (/usually/ COM3).
The following code with print the list of Serial/Parallel port if COMM
API is correctly installed:
<code>
public void listPorts() {
Class.forName("com.sun.comm.Win32Driver")
Enumeration list = CommPortIdentifier.getPortIdentifiers();
CommPortIdentifier po;
while(list.hasMoreElements()) {
po = (CommPortIdentifier) list.nextElement();
if(po.getPortType() == CommPortIdentifier.PORT_SERIAL) {
System.out.println("Serial port found: " + po.getName());
}
else if(po.getPortType() == CommPortIdentifier.PORT_PARALLEL) {
System.out.println("Parallel port found: " + po.getName());
}
}
}
</code>
To have a valid COMM API installed:
1. Find the default path of the java.exe (usually C:\Program
Files\Java\JRE\bin\java.exe on Windows, but check yours): JAVA_HOME
2. in JAVA_HOME\bin put win32comm.dll
3. in JAVA_HOME\lib put the javax.comm.properties
4. in JAVA_HOME\lib\ext put the comm.jar
That's all I can help