I have a need for a linux-based serial data application. The application will be used with another program to talk to an external device via serial port. The programs will share data using flat files. The serial communication will be using ACK/NAK.
Basic Concept:
* Read a conf file containing device name, baud, parity, stop bits, timeout values
* Open the port for read and write
* Start the keepalive
* Listen for incoming data and Watch for files in the /send directory to arrive
* Respond to ENQ
* When data arrives, write a record to the /rcv directory *
Notes:
1. If there is a file in the /send directory, its contents will be sent to the external device. Once sent, the file will be removed. These files will be created by an external application.
2. Data received by the serial port will be written to files in the /rcv directory. These files will be consumed by an external application.
3. All communication is sent and received via ACK/NAK protocol. The data is framed by STX and ETX characters. So a standard "conversation" where device A is sending data to device B follows:
A: ENQ
B: ACK
A: [STX]The data I'm sending to you[ETX]
B: ACK
The keepalive maintains a periodic check to see that the external device is connected.
Receiving data from the port would go something like:
( receive ENQ )
stop keepalive
send ACK
receive record:
[STX] this is the data in the record [ETX]
send ACK
start keepalive
Sending data from the port would go something like
( found file )
stop keepalive
send ENQ
receive ACK
send record
[STX] this is the first record in the file[ETX]
receive ACK
send ENQ
receive ACK
send record
[STX] this is the second record in the file[ETX]
receive ACK
...etc...
Summary:
1. Always respond to ENQ with ACK
2. Run a keepalive by sending ACK and waiting for ENQ
If the keepalive doesn't get a response within TIMEOUT seconds, an error will be written to the /err directory
3. Watch the /send directory for files. Send data from these files when they exist
( This data will be sent via ACK/NAK and framed in STX and ETX)
4. Write received data to the /rcv directory
**See zip for more**
## Deliverables
1) Complete and fully-functional working program(s) in executable form as well as complete source code of all work done.
2) Thorough comments throughout the source code 3) Exclusive and complete copyrights to all work purchased. (No GPL, GNU, 3rd party components, etc. unless all copyright ramifications are explained AND AGREED TO by the buyer on the site per the coder's Seller Legal Agreement).
## Platform
linux