Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / First Aid / February 2005

Tip: Looking for answers? Try searching our database.

javax.comm: how to get the name of a device at the serial port?

Thread view: 
Sarah Klage - 26 Feb 2005 09:33 GMT
Hello,

is there a possibility to get the name of a device connected to a particular
COM port (serial port) or another unique id? I checked the javax.comm
package (and its docs) but found no informations about that.

And: Is there a possibility to check in short intervalls if the device is
still connected to the com port?

kind regards
Sarah
Chris Smith - 26 Feb 2005 13:52 GMT
> is there a possibility to get the name of a device connected to a particular
> COM port (serial port) or another unique id? I checked the javax.comm
> package (and its docs) but found no informations about that.

> And: Is there a possibility to check in short intervalls if the device is
> still connected to the com port?

Neither of these is even theoretically possible.  Without knowing some
about the higher-level protocol spoken by the device, there is no
provision in RS232 for a device to provide its name or to signal its
presence.

If you do know something about a higher-level protocol and it allows you
to ask for a device name or detect presence of a device (for example
with some kind of ping), then you need implement those functions
yourself, in whatever way that protocol provides.

Signature

www.designacourse.com
The Easiest Way To Train Anyone... Anywhere.

Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation

Knute Johnson - 26 Feb 2005 20:40 GMT
> Hello,
>
[quoted text clipped - 7 lines]
> kind regards
> Sarah

You need to look into serial data communication and RS232 in particular.
 There are two lines on the serial port to tell you that a device is
attached, DTR and DSR.

Signature

Knute Johnson
email s/nospam/knute/

dar7yl - 27 Feb 2005 07:29 GMT
> is there a possibility to get the name of a device connected to a
> particular
> COM port (serial port) or another unique id? I checked the javax.comm
> package (and its docs) but found no informations about that.

The serial port doesn't have any information about a device
attached to it.  However, if you suspect that the device is
a Hayes-compatable modem, you can interrogate it by
sending an information request command "ATI<num>\r"
where <num> is any number from 0 to 999, but usually
limits out at about 7.  Different modems return various
response strings that you can parse to extract useful information.

Otherwise, anything may be attached to the serial port, and
you would have to know what sort of protocol it talks in order
to recognize it.

> And: Is there a possibility to check in short intervalls if the device is
> still connected to the com port?

Usually, a device raises the DTR-DSR line when it connects, which
you can test using  javax.comm.CommPort.isDSR().

regards,
   Dar7yl


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.