This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Modem na porta serial


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]