From: "Jaime Garcia" <jgarcia@vali.com.mx>
To: linux-c-programming@vger.kernel.org
Subject: RE: Serial Port (RS-232)
Date: Wed, 28 Jan 2009 09:16:42 -0600 [thread overview]
Message-ID: <001501c9815b$6cbb6fc0$46324f40$@com.mx> (raw)
In-Reply-To: <18815.44366.593591.776560@cerise.gclements.plus.com>
Hi Glynn,
What I want to do is to read from another device that transmit a string of
chars through serial connector, what do you recommend? I would like to know
your approach for this. Thank you in advance for your help.
Best Regards!
> -----Mensaje original-----
> De: Glynn Clements [mailto:glynn@gclements.plus.com]
> Enviado el: Martes, 27 de Enero de 2009 06:57 p.m.
> Para: Jaime Garcia
> CC: linux-c-programming@vger.kernel.org
> Asunto: RE: Serial Port (RS-232)
>
>
> Jaime Garcia wrote:
>
> > > > I am pretty new to Linux programming, I want to start doing
> something
> > > > useful, so I was thinking to start programming the serial port
> (RS-232)
> > > > of my box, so I can read and write data from it, can someone of
> you give
> > > > some feedback about how to start this?
> > >
> > > The keyword you are looking for is ``ioctl''.
> >
> > Right now I opened man ioctl(2) to start looking for directions on
> > this, I appreciate so much your tip, thanks a lot! =-)
>
> You probably don't need to use ioctl() unless you need to treat the
> serial port as a general-purpose I/O port (e.g. manually setting the
> control lines).
>
> If you just want to talk to another serial device, open()ing one of
> the /dev/ttyS* devices and using tcsetattr/tcgetattr will normally
> suffice.
>
> If you do need to use ioctl(), the ioctl(2) manpage won't help much,
> as ioctl() is a generic interface to device-specific functionality.
> The tty_ioctl(4) manpage has details related to TTY (serial) ioctl()
> commands.
>
> --
> Glynn Clements <glynn@gclements.plus.com>
next prev parent reply other threads:[~2009-01-28 15:16 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-27 15:59 Serial Port (RS-232) Jaime Garcia
2009-01-27 16:20 ` Jai Sharma
2009-01-27 16:46 ` Jaime Garcia
2009-01-27 16:35 ` Tiago Maluta
2009-01-27 17:13 ` Michael Iatrou
2009-01-27 17:33 ` Jaime Garcia
2009-01-28 0:56 ` Glynn Clements
2009-01-28 15:16 ` Jaime Garcia [this message]
2009-01-28 17:19 ` Glynn Clements
2009-01-29 0:14 ` Jaime Garcia
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='001501c9815b$6cbb6fc0$46324f40$@com.mx' \
--to=jgarcia@vali.com.mx \
--cc=linux-c-programming@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.