| 
  • If you are citizen of an European Union member nation, you may not use this service unless you are at least 16 years old.

  • You already know Dokkio is an AI-powered assistant to organize & manage your digital files & messages. Very soon, Dokkio will support Outlook as well as One Drive. Check it out today!

View
 

ListCommPorts

Page history last edited by PBworks 16 years, 12 months ago

package edu.stanford.hci.exemplar;

import java.util.Enumeration;

import gnu.io.*;

 

public class ListCommPorts {

 

/**

* @param args

*/

public static void main(String[] args) {

// TODO Auto-generated method stub

Enumeration port_list = gnu.io.CommPortIdentifier.getPortIdentifiers();

while (port_list.hasMoreElements ()) {

CommPortIdentifier port_id =

(CommPortIdentifier)port_list.nextElement ();

 

if (port_id.getPortType () == CommPortIdentifier.PORT_SERIAL) {

System.out.println("Found port "+port_id.getName()+ "id "+port_id);

}

}

}

 

}

Comments (0)

You don't have permission to comment on this page.