LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
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.

Notices

Reply
 
Search this Thread
Old 01-13-2006, 08:08 PM   #1
fizgig10
Member
 
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
maus
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:

Code:
    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".
 
  


Reply


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


All times are GMT -5. The time now is 11:13 PM.

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