Re: Serial Port problem
From: <- Chameleon -> (cham_gss_at_hotmail.NOSPAM.com)
Date: 09/03/04
- Next message: Fred Flintstone: "ResourceBundles - how to locate on Orion"
- Previous message: Funny: "Re: Sorting a List of Calendar Objects"
- In reply to: nik[no-spam]cross: "Re: Serial Port problem"
- Next in thread: nik[no-spam]cross: "Re: Serial Port problem"
- Reply: nik[no-spam]cross: "Re: Serial Port problem"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 3 Sep 2004 18:29:33 +0300
> >>>Enumeration portList = CommPortIdentifier.getPortIdentifiers();
> >>>
> >>>this command returns an empty Enumeration. Why?
> >>>
> >>>My system is PC with WinXP.
> >>>I have 1 parallel and 2 serial ports
> >>>
> >>>
> >>
> >>As a first thought, have you initialized the comm driver.
> >>I forgot and couldn't see any ports until I used this:
> >>
> >> String driverName = "com.sun.comm.Win32Driver";
> >> try{
> >> CommDriver commdriver =
> >>(CommDriver)Class.forName(driverName).newInstance();
> >> commdriver.initialize();
> >> }
> >> catch (Exception e2)
> >> {
> >> e2.printStackTrace();
> >> }
> >>
> >>If this doesn't help maybe you could post your code.
> >
> >
> > I have javax.comm.properties file inside <java dir>\lib directory and
this
> > file have this line inside:
> > -------------
> > Driver=com.sun.comm.Win32Driver
> > -------------
> > Your code works and thankyou, but why I must load dynamically this
driver?
> > If I want to run this code in Linux or other platform?
> >
> > Thanks again!
> >
> >
> If that works my first thought would be that you do not have your java
> lib path set up correctly. What environment/IDE are you developing in?
> Do you have multiple JREs installed and if so have you installed the
> Java comm api in the one ypu are running?
I have 3 JRE in my machine.
1 with Borland J Builder
1 the original from Sun
1 with Mathematica
I have installed comm in both Borland J Builder and Sun's stand-alone
- Next message: Fred Flintstone: "ResourceBundles - how to locate on Orion"
- Previous message: Funny: "Re: Sorting a List of Calendar Objects"
- In reply to: nik[no-spam]cross: "Re: Serial Port problem"
- Next in thread: nik[no-spam]cross: "Re: Serial Port problem"
- Reply: nik[no-spam]cross: "Re: Serial Port problem"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|