<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2600.0" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2><FONT face="Times New Roman" size=3>Here is the
code I used for reading from the serial but it's not working<BR>I also tried it
without the "do -- while " (only using the read sentence)<BR>but it also didn't
work . Is there anyone who could help me ?<BR><BR><BR># include
<stdio.h><BR># include <unistd.h><BR># include <fcntl.h><BR>#
include <sys/ioctl.h><BR># include <sys/wait.h><BR># include
<string.h><BR># include <termios.h><BR># include
<stdlib.h><BR># include
<errno.h><BR>int<BR>main(void)<BR> {<BR> int fd;<BR> int
n;<BR> char recv_char;<BR> int m;<BR><BR> fd =
open("/dev/ttyS0", O_RDWR | O_NOCTTY | O_NDELAY);<BR> if (fd ==
-1)<BR> {<BR> perror("open_port: unable to open /dev/ttyS0 -
");<BR> }<BR> else<BR> fcntl (fd, F_SETFL,
FNDELAY);<BR><BR><BR> do<BR>
{<BR> /* wait for a char to arrive
*/<BR> m=read(fd, &recv_char,
1);<BR> }<BR> while (m !=
1);<BR> printf ( "%c",recv_char);<BR> return
(recv_char);<BR> return (fd);<BR>
}</FONT><BR><BR><BR><BR></FONT></DIV>
<DIV><FONT face='"Verdana", Geneva, MS sans-serif' color=#448593
size=-2><B>__________________________________________________________________</B><BR><FONT
face='"Verdana", Geneva, MS sans-serif' color=#448593 size=-1><B>MOHAMED
RAOUF</B></FONT><BR><B>ICQ#: <FONT color=#4051c8>44365427</FONT></B><BR>
<TABLE border=0>
<TBODY>
<TR>
<TD vAlign=top><FONT face="Verdana,Geneva, MS sans-serif" color=#448593
size=-2><B>Current ICQ status:</B> </FONT></TD>
<TD vAlign=bottom><IMG
src="http://web.icq.com/whitepages/online?icq=44365427&img=21">
</TD></TR></TBODY></TABLE><FONT face=Wingdings size=3><B>+</B></FONT> <A
href="http://wwp.icq.com/44365427"><B>More ways to contact me
</B></A><BR><B>__________________________________________________________________</B><BR></FONT></DIV></BODY></HTML>