?
Solved

Sending data to COM2 in UNIX Lynx with C

Posted on 1998-08-31
4
Medium Priority
?
346 Views
Last Modified: 2010-04-21
hi!!
do someone know how can i send and receive data throw the com2 in a UNIX Lynx system???
the manuals don't work... i mean programing it with C
0
Comment
Question by:Bazavilvazo
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 

Author Comment

by:Bazavilvazo
ID: 2006826
any help with be VERY useful!!
0
 
LVL 4

Expert Comment

by:jlms
ID: 2006827
com2 should be associated to a device, and since devices are just handled like a file, then the normal input/output operations should work in UNIX.

Now, how to do it properly can be found if you get any program in the internet that handles serial communication protocols (kermit for example) and analyze its code.


0
 
LVL 2

Expert Comment

by:JYoungman
ID: 2006828
The OS whose name you are trying to think of is "Linux".

YOu can send data out of the serial port just with
"cat data > /dev/ttyS1"
In un*x, everything is just a file, this includes the serial ports.  Use stty(1) to set the serial port's baud rate etc, appropriately.   If you want to do that in C, see "man termios".

0
 

Accepted Solution

by:
grantk earned 200 total points
ID: 2006829
Source code in a Sunsite mirror in
/pub/Linux/system/network/serial/ppp/ppp-2.3.4.tar.gz

open it and look in ppp-2.3.4/chat/chat.c, a single C program which covers almost everything you could want to do with a serial port in C.
0

Featured Post

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Attention: This article will no longer be maintained. If you have any questions, please feel free to mail me. jgh@FreeBSD.org Please see http://www.freebsd.org/doc/en_US.ISO8859-1/articles/freebsd-update-server/ for the updated article. It is avail…
This tech tip describes how to install the Solaris Operating System from a tape backup that was created using the Solaris flash archive utility. I have used this procedure on the Solaris 8 and 9 OS, and it shoudl also work well on the Solaris 10 rel…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.
Suggested Courses
Course of the Month12 days, 15 hours left to enroll

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question