Solved

Sending data to COM2 in UNIX Lynx with C

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

[Webinar] Code, Load, and Grow

Managing multiple websites, servers, applications, and security on a daily basis? Join us for a webinar on May 25th to learn how to simplify administration and management of virtual hosts for IT admins, create a secure environment, and deploy code more effectively and frequently.

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…
Introduction Regular patching is part of a system administrator's tasks. However, many patches require that the system be in single-user mode before they can be installed. A cluster patch in particular can take quite a while to apply if the machine…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

738 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