Y-Modem send n*CAN receive CAN+CAN abort transmission - when is waiting for the beginning of a block or - when is waiting for an acknowledgement to a block that has been sent. The receiver initiates batch file transmission by sending a "C" character (for CRC-16). The sender opens the first file and sends block number 0 with the following information: - Only the filename part is required, the file length and all other fields are optional. - All unused bytes in block 0 should be set to null. - The filename: a null terminated ASCII string. - The length: a decimal string counting the number of data bytes in the file. - If the file length is not known, it should be set to the maximum expected value or not sent. - other fields: Modification Data, Unix File Mode, Serial Number, future fields. - remainder: set to null. If header block is received with error, a retransmission is requested. After the header block has been received, - if the can be opened for writing --> send ACK. - else the receiver cancels the transfer --> n*CAN. The receiver then initiates transfer of the file contents with a "C" character, according to the standard XMODEM/CRC protocol. After the file contents and XMODEM EOT have been transmitted and acknowledged, the receiver again asks for the next pathname. Transmission of a null pathname terminates batch file transmission. Note that transmission of no files at all is not necessarily an error. Example: YMODEM Batch Transmission Sessions ________________________________________________________________ RECEIVER SENDER RECEIVER C (command:rb) SOH 00 FF "foo.c" NUL[123] CRC CRC ACK C SOH 01 FE Data[128] CRC CRC ACK SOH 02 FC Data[128] CRC CRC ACK SOH 03 FB Data[100] ^Z[28] CRC CRC ACK EOT NAK EOT ACK C SOH 00 FF NUL[128] CRC CRC ACK ________________________________________________________________ RECEIVER SENDER RECEIVER C (command:rb) SOH 00 FF "foo.c" NUL[123] CRC CRC ACK C SOH 01 FE Data[128] CRC CRC ACK SOH 02 FC Data[128] CRC CRC ACK SOH 03 FB Data[100] ^Z[28] CRC CRC ACK EOT NAK EOT ACK C SOH 00 FF "baz.c" NUL[123] CRC CRC ACK C SOH 01 FB Data[100] ^Z[28] CRC CRC ACK EOT NAK EOT ACK C SOH 00 FF NUL[128] CRC CRC ACK ________________________________________________________________ RECEIVER SENDER RECEIVER C (command:rb) SOH 00 FF "foo.c" NUL[123] CRC CRC ACK C STX 01 FD Data[1024] CRC CRC ACK SOH 02 FC Data[128] CRC CRC ACK SOH 03 FB Data[100] ^Z[28] CRC CRC ACK EOT NAK EOT ACK C SOH 00 FF NUL[128] CRC CRC ACK ________________________________________________________________ RECEIVER SENDER RECEIVER (timeout) NAK SOH 01 FE -data- xx ACK SOH 02 FD -data- xx (broken) NAK SOH 02 FD -data- xx ACK SOH 03 FC -data- xx (ACK) (gets garbaged) SOH 03 FC -data- xx ACK EOT (anything except ACK) EOT ACK