Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 11-16-2007, 05:59 PM
Member
 
Join Date: Nov 2007
Posts: 5
hobbyist is on a distinguished road
Comm API Usage
I am trying to write a JavaSE application using Swing to access the virtual COM port created when connecting a Modem aware device to the USB.
I can see data coming across the COM port via Hyperterminal and I want to write a hyperterminal like application to react to and filter this messaging.
I have tried using the Comm API and followed the API instructions to the letter.
I am using the following code in my JavaSE app:

{
...

private void initCommPorts() {

CommPortIdentifier portId;
Enumeration portList = CommPortIdentifier.getPortIdentifiers();
if (portList == null) {
System.out.println("portList is null");
}
else {
System.out.println(portList.toString());
}

String comPort = "";
while (portList.hasMoreElements()) {
portId = (CommPortIdentifier) portList.nextElement();
System.out.print("Port found");
comPort = portId.getName();
System.out.println("Found port: " + comPort);
// Add COM port to visual object selection list
comChoice.addItem(comPort);
}

}
...
}

The issue is that this code never finds the virtual COM ports. The Enumeration is always empty.

Am I using the right API here. Can the Comm API be used to create a connection to the virtual COM ports in Windows XP?

Thanks guys - and sorry for my ignorance on this matter!
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
javax.comm:Error instantiating class com.sun.comm.Win32Driver bbq Advanced Java 3 02-07-2008 10:41 PM
Integer Usage bluegreen7hi New To Java 11 01-24-2008 09:54 AM
How to determine CPU usage using Java????? JavaEmpires New To Java 2 01-11-2008 12:19 AM
javax.comm package for COM ports valery Advanced Java 1 08-07-2007 04:03 PM
javax/comm/SerialPortEvent musiigedeo Threads and Synchronization 8 07-25-2007 11:36 AM


All times are GMT +3. The time now is 10:06 PM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org