Solved

check if a com port exists by C code

Posted on 2001-06-18
2
723 Views
Last Modified: 2011-10-03
How can we check if a com port exists by C code?
0
Comment
Question by:mathematics
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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

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…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

757 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now