• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 361
  • Last Modified:

Sending data to COM2 in UNIX Lynx with C

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
Bazavilvazo
Asked:
Bazavilvazo
1 Solution
 
BazavilvazoAuthor Commented:
any help with be VERY useful!!
0
 
jlmsCommented:
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
 
JYoungmanCommented:
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
 
grantkCommented:
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] Kill tickets & tabs using PowerShell

Are you tired of cycling through the same browser tabs everyday to close the same repetitive tickets? In this webinar JumpCloud will show how you can leverage RESTful APIs to build your own PowerShell modules to kill tickets & tabs using the PowerShell command Invoke-RestMethod.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now