I have a device connected at my com port and I am trying to get its values but I am stuck at the first step.
I am unable to get the existing com ports. In the code below by enumeration seems to be empty because the program doesn't enter the while loop at all. Can anyone please help
public class connectnow implements Runnable, SerialPortEventListener {
static CommPortIdentifier portId;
static Enumeration portList;
InputStream inputStream;
SerialPort serialPort;
Thread readThread;
byte[] readBuffer;
public static void main(String[] args) {
portList = CommPortIdentifier.getPortIdentifiers();
System.out.println("portList... " + portList);
while (portList.hasMoreElements()) {
System.out.println("yes");
}
}