Best way to program a simple serial routine
I need to write a piece of software to do the following:
1. Sends a byte through a serial port (triggers an external device to send a reply).
2. Receives a byte from the serial port. This byte is then written to a file.
I've been coding my whole project in bash scripts and perl and don't want to have to learn another language if possible. Can anyone recommend the best way to solve this problem? Any code to setup the serial port would also be appreciated.
I believe you know C. If you don't, then learn it. You can write a C program to read and to write to a serial port.
Two good references that I would suggest will be : -
1.) Serial Programming HOWTO by Gary Frerking available in http://www.tldp.org/HOWTO/Serial-Programming-HOWTO/
2.) Serial Programming Guide for POSIX Operating Systems by Michael R. Sweet which can be downloaded from his site which is http://www.easysw.com/~mike/serial/
Both of them discusses the Input/Output concepts of serial devices well. I am sure you will definitely find them interesting.
Thanks Theorist, C did it without any problems.
|All times are GMT -5. The time now is 09:04 PM.|