LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 08-09-2004, 11:23 PM   #1
blackzone
Member
 
Registered: Jun 2004
Posts: 256

Rep: Reputation: 30
RS232 serial port programing


need to know how to write C programs under linux which can open connection, disconnect, transfer data trough RS232 port between 2 linux box.

Also need to know how to view status of a serial port(if a connection is established), and if possible also control speed, timeout

Specifically need to know after 2 computer is linked using a serial port, when the plug is being pulled.
 
Old 08-10-2004, 04:00 AM   #2
adz
Senior Member
 
Registered: Jun 2003
Location: Sydney
Distribution: Debian, FreeBSD
Posts: 1,713

Rep: Reputation: 53
Try here or here.
 
Old 08-11-2004, 12:54 AM   #3
bruce ford
Member
 
Registered: Jul 2004
Location: Munich, Germany
Distribution: Sun Solaris 8, SuSE 9.0
Posts: 43

Rep: Reputation: 15
Quote:
Specifically need to know after 2 computer is linked using a serial port, when the plug is being pulled.
Since serial lines are connectionless, you can only detect this condition if you are either transmitting something continuously or agree on DTR always being up by the IFD and detetct it going down.
In serial programming, you always have to poll or select for conditions (status lines, bytes received,...) so you have to implement all the timeout handling yourself. Familiarize yourself well with the 'select()' system call as everything sensible is built around it.
adz has given you serveral links where you will find lots of example code so I won't post extra code here, but feel free to come back here with specific problems.

So long...
bruce

Last edited by bruce ford; 08-11-2004 at 12:55 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
console login through RS232/serial port ? Yalla-One Linux - Software 3 02-24-2005 04:12 PM
USB - Serial RS232 Adapter blox Linux - Hardware 3 01-28-2005 10:58 AM
Serial programing in c on Linux OS branens Programming 2 01-19-2005 05:35 AM
Serial RS232 problem Onyx^ Linux - Hardware 6 09-09-2004 11:35 PM
serial port: RS232 RS574? blackzone Linux - Hardware 1 08-10-2004 04:15 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 08:24 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration