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

  • Stop wasting time looking for files and revisions. Connect your Gmail, DriveDropbox, and Slack accounts and in less than 2 minutes, Dokkio will automatically organize all your file attachments. Learn more and claim your free account.

View
 

ListCommPorts

Page history last edited by PBworks 13 years, 7 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.