This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Modem na porta serial
- From: Ian Lance Taylor <ian at wasabisystems dot com>
- To: Luiz Bernardi <lbernard at uncnet dot br>
- Cc: gcc at gcc dot gnu dot org
- Date: 03 Jun 2004 23:05:19 -0400
- Subject: Re: Modem na porta serial
- References: <1086306412.40bfb86cb8a7d@webmail.uncnet.br>
Luiz Bernardi <lbernard@uncnet.br> writes:
> Estou usando o gcc para criar uma rotina (c) para escrever uma sÃrie de bytes
> atravÃs de um modem conectado na serial (ttyS2) de um micro rodando linux.
>
> Para isso, utilizo open para abrir a porta e write para escrever para ela.
>
> O problema à que, quando uso o open("/dev/ttyS2",O_RDWR | O_NOCTTY), o sistema
> fica parado, nÃo retornando nada. Se uso O_NDELAY em conjunto com as constantes
> acima, o sistema retorna um int vÃlido para a porta, entretanto como um FIFO,
> nÃo permitindo que eu escreva diretamente na porta.
>
> Como posso fazer para burlar essa caracterÃstica e ter o controle do modem
> atravÃs da ttyS2???
I'm afraid this is the wrong mailing list for this question. This
mailing list is for the development of gcc. It's not for programming
questions. Please ask elsewhere, perhaps on a mailing list about
Linux programming. Also, this mailing list is normally conducted in
English--I'm afraid I don't know enough Portugese to reply in that
language.
While I'm not sure what the problem is, I recommend reading the
termios man page. Perhaps you need to set CLOCAL. Or perhaps it is
something else entirely.
Good luck.
Ian