Solved

Sending data to COM2 in UNIX Lynx with C

Posted on 1998-08-31
4
328 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
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 100 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Let's say you need to move the data of a file system from one partition to another. This generally involves dismounting the file system, backing it up to tapes, and restoring it to a new partition. You may also copy the file system from one place to…
I promised to write further about my project, and here I am.  First, I needed to setup the Primary Server.  You can read how in this article: Setup FreeBSD Server with full HDD encryption (http://www.experts-exchange.com/OS/Unix/BSD/FreeBSD/A_3660-S…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
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…

820 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