Method for reliably transmitting files through serial port
The invention discloses a method for reliably transmitting files through a serial port. The method comprises the following steps: firstly, establishing a list of a to-be-transmitted file for recordingthe name, a CRC32 (Cyclic Redundancy Check) and the transmission state of the to-be-transmitted file...
Gespeichert in:
Hauptverfasser: | , , , , , |
---|---|
Format: | Patent |
Sprache: | chi ; eng |
Schlagworte: | |
Online-Zugang: | Volltext bestellen |
Tags: |
Tag hinzufügen
Keine Tags, Fügen Sie den ersten Tag hinzu!
|
Zusammenfassung: | The invention discloses a method for reliably transmitting files through a serial port. The method comprises the following steps: firstly, establishing a list of a to-be-transmitted file for recordingthe name, a CRC32 (Cyclic Redundancy Check) and the transmission state of the to-be-transmitted file; when transmitting the file, adding the file name and the CRC32 of the file text to the list of the to-be-transmitted file, and marking the file name and the CRC32 as to-be-transmitted; regularly traversing the list of the to-be-transmitted file, if the file is not transmitted successfully or to be transmitted, reading the file, sending the file length and the CRC32 to a receiving end, sending file text contents, and if the file state is successfully transmitted, then deleting the file from the list of the to-be-transmitted file; after receiving the file length by the receiving end, saving as a file according to the file length, calculating the CRC32 of the file and comparing the CRC32 with an original check code, |
---|