Ymodem ESP32 1.0.0
|
Ymodem Packet preparation functions. More...
#include "YmodemUtils.h"
Go to the source code of this file.
Functions | |
void | Ymodem_PrepareIntialPacket (uint8_t *data, char *fileName, uint32_t length) |
Prepares the initial packet for Ymodem transmission. | |
void | Ymodem_PrepareLastPacket (uint8_t *data) |
Prepares the last 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. | |
Ymodem Packet preparation functions.
Definition in file YmodemPaquets.h.
void Ymodem_PrepareIntialPacket | ( | uint8_t * | data, |
char * | fileName, | ||
uint32_t | length ) |
Prepares the initial packet for Ymodem transmission.
This function initializes the first packet to be sent in a Ymodem transfer. The initial packet contains metadata about the file being transferred, such as the file name and its length.
data | Pointer to the buffer where the initial packet will be prepared. |
fileName | Pointer to a null-terminated string containing the name of the file. |
length | The length of the file in bytes. |
Definition at line 16 of file YmodemPaquets.cpp.
void Ymodem_PrepareLastPacket | ( | uint8_t * | data | ) |
Prepares the last packet for Ymodem transmission.
This function is responsible for preparing the final packet to be sent during a Ymodem file transfer. It ensures that the last packet is properly formatted and ready for transmission.
data | Pointer to the buffer where the last packet data will be stored. |
Definition at line 40 of file YmodemPaquets.cpp.
void Ymodem_PreparePacket | ( | uint8_t * | data, |
uint8_t | pktNo, | ||
uint32_t | sizeBlk, | ||
fs::File & | ffd ) |
Prepares a Ymodem packet with the given data.
data | Pointer to the buffer where the packet will be prepared. |
pktNo | Packet number to be included in the packet. |
sizeBlk | Size of the block to be included in the packet. |
ffd | Reference to the file from which data will be read. |
Definition at line 54 of file YmodemPaquets.cpp.
uint8_t Ymodem_WaitResponse | ( | uint8_t | ackchr, |
uint8_t | tmo ) |
Waits for a specific response character within a given timeout period.
This function waits for a response character (ackchr) to be received within a specified timeout period (tmo). It is typically used in communication protocols to ensure that the expected response is received before proceeding.
ackchr | The expected response character to wait for. |
tmo | The timeout period in milliseconds to wait for the response. |
Definition at line 80 of file YmodemPaquets.cpp.