Ymodem ESP32 1.0.0
Loading...
Searching...
No Matches
YmodemPaquets.h File Reference

Ymodem Packet preparation functions. More...

#include "YmodemUtils.h"
+ Include dependency graph for YmodemPaquets.h:
+ This graph shows which files directly or indirectly include this file:

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.
 

Detailed Description

Ymodem Packet preparation functions.

Author
Miguel Ferrer (mferr.nosp@m.er@i.nosp@m.nbiot.nosp@m..es)
Version
0.1
Date
2025-01-24

Definition in file YmodemPaquets.h.

Function Documentation

◆ Ymodem_PrepareIntialPacket()

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.

Parameters
dataPointer to the buffer where the initial packet will be prepared.
fileNamePointer to a null-terminated string containing the name of the file.
lengthThe length of the file in bytes.

Definition at line 16 of file YmodemPaquets.cpp.

◆ Ymodem_PrepareLastPacket()

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.

Parameters
dataPointer to the buffer where the last packet data will be stored.

Definition at line 40 of file YmodemPaquets.cpp.

◆ Ymodem_PreparePacket()

void Ymodem_PreparePacket ( uint8_t * data,
uint8_t pktNo,
uint32_t sizeBlk,
fs::File & ffd )

Prepares a Ymodem packet with the given data.

Parameters
dataPointer to the buffer where the packet will be prepared.
pktNoPacket number to be included in the packet.
sizeBlkSize of the block to be included in the packet.
ffdReference to the file from which data will be read.

Definition at line 54 of file YmodemPaquets.cpp.

◆ Ymodem_WaitResponse()

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.

Parameters
ackchrThe expected response character to wait for.
tmoThe timeout period in milliseconds to wait for the response.
Returns
uint8_t Returns 1 if the expected response character is received within the timeout period, otherwise returns 0.

Definition at line 80 of file YmodemPaquets.cpp.