Hello,I met a question when I wrote the program.I want the program can
transmit the data frame continuosly through the RS232 when the
communication has been interrupted.But I don't know how to write. I
don't know how to record.Who can give me hand?Thanks very much!
The closest that the C language itself comes to knowing about
RS232 or serial communications, is that there are certain
provisions about default buffering if the implementation can
prove that a stream is a "terminal". C does not define what
a "terminal" is, though, so the connection between that and
"serial" is pretty weak.
This newsgroup, comp.lang.c, only deals with that which is
covered in the C standards. Hence, this is not an appropriate
newsgroup for asing about RS232 or serial communications.
I would redirect you to a more appropriate newsgroup, but you
did not mention anything about which OS you are using,
so I cannot tell you at the moment which would be the appropriate
place. Probably one of the Windows or Unix newsgroups.
When you go to post your question to a more appropriate newsgroup,
I would suggest that you explain your question in more detail.
I do not understand what you mean when you say that you want
the program to transmit the data frame "continuously" when the
communications has been interrupted. I am not sure if you are
talking about the bit level, or the character level, or some kind
of packet level. I cannot tink of any circumstances under which
continually retransmitting the same bit or byte would be useful,
and retransmitting the same packet would normally not be done
until you were sure the other end had not received it. I do not
know how you intend how to detect that "communication has been
interrupted".
I have to wonder whether you are reinventing things, and whether
you would perhaps be better off using an already written
transmission program such as x-modem, z-modem, or kermit.