Solved

check if a com port exists by C code

Posted on 2001-06-18
2
743 Views
Last Modified: 2011-10-03
How can we check if a com port exists by C code?
0
Comment
Question by:mathematics
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 5

Expert Comment

by:garboua
ID: 6205981
I don't know how to check using c, but they should be under /dev listed as ttys0-ttys3
0
 

Accepted Solution

by:
ragaMuffin earned 20 total points
ID: 6208013
com ports are character devices.  As a character device is initialized, its device driver registers itself with the linux kernel by adding an entry into the chrdevs vector of device_struct data structure.  You can call a device and tread it exaclty like a file.  operation on a character device include iseek,read,write,readdir,select,ioctl .... etc.
you can use the open function with O_RDONLY, O_WRONLY, or O_RDWR
do a man on open to get details and header files needed.
0

Featured Post

Tutorials alone can't teach real engineering

So we built better training tools.

-Hands-on Labs
-Instructor Mentoring
-Scenario-Based Tests
-Dedicated Cloud Servers

All at your fingertips. What are you waiting for?

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever been frustrated by having to click seven times in order to retrieve a small bit of information from the web, always the same seven clicks, scrolling down and down until you reach your target? When you know the benefits of the command l…
The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

628 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question