LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices

Reply
 
Search this Thread
Old 10-18-2012, 05:27 AM   #1
kauuttt
Member
 
Registered: Dec 2008
Location: Kolkata, India
Distribution: Ubuntu
Posts: 123

Rep: Reputation: 25
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, 01:50 PM   #2
rtmistler
Senior Member
 
Registered: Mar 2011
Location: Milford, MA. USA
Distribution: Angstrom, Debian, Ubuntu, MINT
Posts: 1,322
Blog Entries: 7

Rep: Reputation: 506Reputation: 506Reputation: 506Reputation: 506Reputation: 506Reputation: 506
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?
 
  


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 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 08:58 AM
video rate settings in AIX kjohnson79 AIX 0 07-17-2007 11:41 AM
settings monitor to 100 Hz refresh rate TranceDude Linux - Hardware 2 09-25-2005 05:36 AM
please rate me security settings qwijibow Linux - Security 2 09-09-2003 05:28 AM
how do I set the refresh rate settings? tdnik Linux - General 3 01-03-2002 12:10 PM


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