Advertisement
Guest User

bosak gay

a guest
Mar 1st, 2015
192
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1.  
  2.  
  3. import gnu.io.*; // RXTX
  4. // import javax.comm.*; // SUN
  5. import java.util.Enumeration;
  6.  
  7.  
  8. public class ErsteSchritte {
  9.  
  10. /**
  11. * @param args
  12. */
  13. public static void main(String[] args) {
  14. // TODO Auto-generated method stub
  15.  
  16. System.out.println("Program started");
  17.  
  18. //System.out.println(java.library.path);
  19. CommPortIdentifier serialPortId;
  20. //static CommPortIdentifier sSerialPortId;
  21. Enumeration enumComm;
  22. //SerialPort serialPort;
  23.  
  24. enumComm = CommPortIdentifier.getPortIdentifiers();
  25. while (enumComm.hasMoreElements()) {
  26. serialPortId = (CommPortIdentifier) enumComm.nextElement();
  27. if(serialPortId.getPortType() == CommPortIdentifier.PORT_SERIAL) {
  28. System.out.println(serialPortId.getName());
  29. }
  30. }
  31.  
  32. System.out.println("Finished successfully");
  33. }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement