60 data[1] = (pktNo & 0x000000ff);
61 data[2] = (~(pktNo & 0x000000ff));
82 unsigned char receivedC;
87 if (receivedC == ackchr) {
90 else if (receivedC ==
CA) {
94 else if (receivedC ==
NAK) {
104 }
while (errors < tmo);
void Ymodem_PrepareIntialPacket(uint8_t *data, char *fileName, uint32_t length)
Prepares the initial packet for Ymodem transmission.
void Ymodem_PreparePacket(uint8_t *data, uint8_t pktNo, uint32_t sizeBlk, fs::File &ffd)
Prepares a Ymodem packet with the given data.
uint8_t Ymodem_WaitResponse(uint8_t ackchr, uint8_t tmo)
Waits for a specific response character within a given timeout period.
void Ymodem_PrepareLastPacket(uint8_t *data)
Prepares the last packet for Ymodem transmission.
Ymodem Packet preparation functions.
unsigned short crc16(const unsigned char *buf, unsigned long count)
Computes the CRC-16 checksum for a given buffer.
void send_CA()
Sends the CA (Cancel) signal.
int32_t Receive_Byte(unsigned char *c, uint32_t timeout)
Receives a byte from a communication interface.