Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Linux - Kernel This forum is for all discussion relating to the Linux kernel.


  Search this Thread
Old 10-18-2012, 04:27 AM   #1
Registered: Dec 2008
Location: Atlanta, GA, USA
Distribution: Ubuntu
Posts: 135

Rep: Reputation: 26
Baud rate and other settings settings for Linux UART drivers through ioctls.

Hi All,

I want to write an application for using Linux UART driver. And for the same, I need to set baud rate, number of data bits, parity, stop bits, and hardware flow control.

I am finding the way to do the same through POSIX functions tcgetattr(3) and tcsetattr(3).

But not able to find the way to set it through ioctl().

Any suggestions friends.?
Old 10-18-2012, 12:50 PM   #2
Senior Member
Registered: Mar 2011
Location: Sutton, MA. USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu
Posts: 3,950
Blog Entries: 10

Rep: Reputation: 1471Reputation: 1471Reputation: 1471Reputation: 1471Reputation: 1471Reputation: 1471Reputation: 1471Reputation: 1471Reputation: 1471Reputation: 1471
The ioctl calls for TTY can be viewed on most systems if you do "man tty_ioctl"; HOWEVER, you should also note that these should also say:

"Use of ioctl makes for non-portable programs. Use the POSIX interface described in termios(3) whenever possible."

And if you do a man on termios, you'll see that it guides you to use tcget/setattr() function calls instead.

Since you said you're accomplishing this using the tcgetattr() tcsetattr() calls, why are you trying to do it differently?


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 Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
[help]how to set baud rate up to 230400 in linux? uni_apollo Programming 1 10-25-2007 07:58 AM
video rate settings in AIX kjohnson79 AIX 0 07-17-2007 10:41 AM
settings monitor to 100 Hz refresh rate TranceDude Linux - Hardware 2 09-25-2005 04:36 AM
please rate me security settings qwijibow Linux - Security 2 09-09-2003 04:28 AM
how do I set the refresh rate settings? tdnik Linux - General 3 01-03-2002 11:10 AM

All times are GMT -5. The time now is 01:21 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