M
Malik Asif Joyia
Hello
I m writing the following code but it is not working can any bod tell
that what is the problem with it?
<code>
public void OpenSerialPort() throws java.io.IOException {
try {
Enumeration en = CommPortIdentifier.getPortIdentifiers();
CPI1 = CommPortIdentifier.getPortIdentifier("COM1");
try
{
sm = (SerialPort) CPI1.open("UARTTesting", 3000);
}catch(PortInUseException ee)
{
System.out.println(ee.getMessage());
}
} catch (NoSuchPortException e) {
System.out.println(e.getMessage());
}
}
</code>
but when i run the code it throws exception no such port exists, My OS
is Windows 2003 Server Enterpirze Edition.
Thanks
I m writing the following code but it is not working can any bod tell
that what is the problem with it?
<code>
public void OpenSerialPort() throws java.io.IOException {
try {
Enumeration en = CommPortIdentifier.getPortIdentifiers();
CPI1 = CommPortIdentifier.getPortIdentifier("COM1");
try
{
sm = (SerialPort) CPI1.open("UARTTesting", 3000);
}catch(PortInUseException ee)
{
System.out.println(ee.getMessage());
}
} catch (NoSuchPortException e) {
System.out.println(e.getMessage());
}
}
</code>
but when i run the code it throws exception no such port exists, My OS
is Windows 2003 Server Enterpirze Edition.
Thanks