Results 1 to 2 of 2
I am developing an application in c with Linux OS, where a radio modem working at baud rate 9600 will be attached to PC on serial port. More than four ...
- 08-19-2008 #1Just Joined!
- Join Date
- Aug 2008
- Posts
- 1
Serial port programming
I am developing an application in c with Linux OS, where a radio modem working at baud rate 9600 will be attached to PC on serial port. More than four such units will be communicating at one time, so there may be jamming or data corruption. Each module will be transmitting Data packets less than 500 bytes.
How should I set my serial port and program my application so that I can receive packets correctly.
Your suggestions will be welcomed
- 08-19-2008 #2
Programming serial ports isn't a black art, and it's not even rocket science. But it can be difficult to understand at first.
Do these two commands at the shell prompt:
If those man pages are not installed on your system, do a google search for each of these sets of terms:Code:man tcgetattr man tcsetattr
There's a lot of information on those man pages, and it's no picnic gathering it all into a program that works.Code:linux man tcgetattr linux man tcsetattr
It turns out that I've written a sample program that you might wish to examine. It's here. I wrote this application to communicate with a modem, but you can ignore the parts you don't need. It's insanely well documented if I say so myself. :)
I will leave that source code there for at least two weeks.--
Bill
Old age and treachery will overcome youth and skill.


Reply With Quote