LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
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, 04:27 AM   #1
kauuttt
Member
 
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
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,882
Blog Entries: 13

Rep: Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930
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



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

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 07:41 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration