(Sorry for my poor english).
Today, I would like to redirect all data from a port to another port. (Like socat or netcat, but I can't use these tools because of their licence).
My data are undefined (so are not start or stop bit) and have different length.
- From ethernet port to an ethernet port it's easy(there are the ethernet header).
- From ethernet port to an serial port it's also easy (there are the ethernet header to know the begin and the end of the frame and so after cut the data to send data to the serial port).
But my problem is from serial port to Ethernet port. How do I know when I received my full frame from serial port if I have not header? Because before redirect the data in Ethernet port, I need to receive all data and only after convert in a ethernet frame, we agree?
I thought about this solution: I can define an inter-frame delay, if the time between two serial data bytes is less than inter-frame delay, the data are in the same frame, and I wait the next data before convert the frame in a Ethernet frame.
receiver timeout
interrupt on some USARTs for this purpose. – sawdust