Win a copy of Escape Velocity: Better Metrics for Agile Teams this week in the Agile and Other Processes forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Frank Carver
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • fred rosenberger

Serial Port not listing

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,

Im working on a COM port reading program. Im using windows 2000 professional. But when it runs , it does not return any port listings.
Im using the method
Enumeration r=CommPortIdentifier.getPortIdentifiers();
but,
while(r.hasMoreElements()) returns false.
what it could be problem. The COM ports are not showing any conflicts in the system properties.
Please see the following code snippet ,that im using.

Enumeration numPort = CommPortIdentifier.getPortIdentifiers();
while(numPort.hasMoreElements()){
CommPortIdentifier cpi = (CommPortIdentifier)numPort.nextElement();
if(cpi.getPortType()==CommPortIdentifier.PORT_PARALLEL){
allPorts.append("Port Name : "+cpi.getName()+" is Parallel : \n-->"+cpi+"\n");
}else if(cpi.getPortType()==CommPortIdentifier.PORT_SERIAL){
allPorts.append("Port Name : "+cpi.getName()+" is Serial : \n-->"+cpi+"\n");
}else{
allPorts.append("Port Name : Unknown : \n-->"+cpi+"\n");
}
******

Thanks in advance

Jagadeesh
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That is a common problem when using the COMM API.
It is probably due to the javax.comm.properties file - which defines the driver class to be used - not being found by the library.
Why Sun couldn't manage to test for Windows and use the appropriate driver is beyond me.
As I recall, that properties file needs to be in the
JAVA_HOME\jre\lib directory

Bill
 
Whatever you say buddy! And I believe this tiny ad too:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic