Re: About the serial port communication ?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Dec 26, 2001 at 01:24:53PM +0800, PC32 YPXin wrote:

[Please don't use HTML encoded messages to mailing lists]

This is not a kernel related question, use the Linux C Programming list
next time. For more information ,see:

  http://lists.linux.org.au/listinfo/linuxcprogramming

> 	I write two programs to communicate,but only when I run the minicom,
> the data can be read correctly.I think there must be something else to be
> initialized.Can you tell me.

For starters, the baudrate in the two programs is not the same: one
uses 38400, the other one 57600 baud. 

The most important thing is that the baudrate should NOT directly be
written into struct termios, you should use cfsetispeed() and
cfsetospeed() instead.


Erik

-- 
J.A.K. (Erik) Mouw, Information and Communication Theory Group, Faculty
of Information Technology and Systems, Delft University of Technology,
PO BOX 5031, 2600 GA Delft, The Netherlands  Phone: +31-15-2783635
Fax: +31-15-2781843  Email: J.A.K.Mouw@its.tudelft.nl
WWW: http://www-ict.its.tudelft.nl/~erik/
--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
IRC Channel:   irc.openprojects.net / #kernelnewbies
Web Page:      http://www.kernelnewbies.org/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux