18 unsigned char receivedC;
26 if (err >= 45 || receivedC !=
CRC16) {
46 if (err == 0 || err == 4) {
67 uint16_t blkNumber = 0x01;
69 uint32_t size = sizeFile;
87 else if (err == 0 || err == 4) {
111 else if (err == 0 || err == 4) {
139 if (err == 0 || err == 4) {
#define YMODEM_LED_ACT_ON
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.
int sendInitialPacket(char *sendFileName, unsigned int sizeFile)
Sends the initial packet for a file transfer using the Ymodem protocol.
int sendFileBlocks(unsigned int sizeFile, fs::File &ffd)
Sends file blocks over a communication channel.
int waitForReceiverResponse()
Waits for a response from the receiver.
int sendEOT()
Sends the End Of Transmission (EOT) signal.
int sendLastPacket()
Sends the last packet in the Ymodem transmission.
Ymodem Packet transmission functions.
void IRAM_ATTR LED_toggle()
Toggles the state of an LED.
void send_CA()
Sends the CA (Cancel) signal.
uint32_t Send_Byte(char c)
Sends a single byte of data.
int32_t Receive_Byte(unsigned char *c, uint32_t timeout)
Receives a byte from a communication interface.