Re: Read Data from Serial Port

Erik Mouw (J.A.K.Mouw@its.tudelft.nl)
Thu, 11 Apr 2002 16:16:53 +0200


On Thu, Apr 11, 2002 at 05:08:15PM +0500, Anil Kumar wrote:
> I am new to Linux .
> I am looking for provisions in linux Kernel or Linux User Space through
> which i can read data directly from
> serial port (A device is Connected to Serial Port).

open("/dev/ttyS0"), see "man open".

> I read the literature regarding Raw Sockets but could not figure out
> how to read data from serial port.

A serial port is a device file in /dev. Sockets are for networking.

> If there is any URL where i can find information regarding this please
> mail me that also.

You can read the Serial-Programming-HOWTO. There is also a lot of
information in the book "Advanced programming in the UNIX environment"
by W. Richard Stevens. The book is expensive, but worth its price.

Erik

PS: this kind of userland questions is off-topic for this list. Next
time use the linux-c-programming mailing list, see
http://lists.linux.org.au/listinfo/linuxcprogramming

-- 
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/
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/