Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


  Search this Thread
Old 01-13-2006, 08:08 PM   #1
Registered: Nov 2004
Location: San Diego
Distribution: Mepis w/ 2.6.9 kernel, KDE 3.3
Posts: 36

Rep: Reputation: 15
flush the serial buffer

I want to flush the serial buffer before I read from it (monitor it for the next transmission). Is this possible?
Old 09-21-2009, 03:29 AM   #2
LQ Newbie
Registered: Jun 2009
Posts: 14

Rep: Reputation: 0
If you initialize and configure the serial device with tcsetattr() you can flush the serial buffer by setting the new tio with the TCSAFLUSH Parameter:

    tcsetattr(fileDescriptor, TCSAFLUSH, &myNewTTYoptions);
See POSIX Serial Programming Guide for details.

PS: I made this tardy replay, since this post shows up as result number one while googeling for "flush serial buffer".


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to increase the serial transmit buffer size in the Kernel. pwlodarczyk Programming 13 01-21-2009 04:39 PM
flush() before use... Elric of Grans Programming 1 07-12-2005 07:54 PM
Buffer serial input -- create new device? prell Programming 4 04-30-2005 03:52 PM
how to increase serial receive email buffer size? HZC Programming 0 02-14-2005 10:32 PM
No of bytes in the serial drivers transmit buffer igjesdal Programming 0 10-13-2004 10:58 AM > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 03:16 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration