×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Serial port handling in linux

Serial port handling in linux

Serial port handling in linux

(OP)
Hello,
(1)I am trying to write a program for serial port communication in Linux. I have created a class in which I initiallize the port parameters using a termios structure and open the port. The class also has a function which can return a FILE pointer(using fdopen) attached with the port. This handle I am using in "main" to write to the port using "fprintf" and scan the port using "fscanf". The problem is when I send the data to one port and read it on another serial port in a fixed loop, it always skips first data in reading, however writing is ok. Two ports are connected by Null Modem cable.I am using asych. serial communication. Any clue???
(2) Another query is : I tried to open the port directly using an object from ofstream class and ifstream class.This does not work. Is there any limitation on this in Linux??

Thanks

"Knowledge is power"

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources