Ymodem ESP32 1.0.0
Loading...
Searching...
No Matches
YmodemTransmit.cpp File Reference

Ymodem Packet transmission functions. More...

#include "YmodemTransmit.h"
+ Include dependency graph for YmodemTransmit.cpp:

Go to the source code of this file.

Functions

int waitForReceiverResponse ()
 Waits for a response from the receiver.
 
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 sendEOT ()
 Sends the End Of Transmission (EOT) signal.
 
int sendLastPacket ()
 Sends the last packet in the Ymodem transmission.
 

Detailed Description

Ymodem Packet transmission functions.

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

This file contains the functions to transmit files using the Ymodem protocol. Format the packets and send them to the receiver or wait for the receiver response.

Definition in file YmodemTransmit.cpp.

Function Documentation

◆ sendEOT()

int sendEOT ( )

Sends the End Of Transmission (EOT) signal.

This function is used to signal the end of a transmission process. It typically sends an EOT character to indicate that the transmission is complete.

Returns
int Returns 0 on success, or a negative error code on failure.

Definition at line 100 of file YmodemTransmit.cpp.

◆ sendFileBlocks()

int sendFileBlocks ( unsigned int sizeFile,
fs::File & ffd )

Sends file blocks over a communication channel.

This function is responsible for transmitting the contents of a file in blocks.

Parameters
sizeFileThe size of the file to be sent, in bytes.
ffdA reference to the file object to be transmitted.
Returns
int Returns 0 on success, or a negative error code on failure.

Definition at line 64 of file YmodemTransmit.cpp.

◆ sendInitialPacket()

int sendInitialPacket ( char * sendFileName,
unsigned int sizeFile )

Sends the initial packet for a file transfer using the Ymodem protocol.

This function prepares and sends the initial packet containing the file name and size to initiate the Ymodem file transfer process.

Parameters
sendFileNameThe name of the file to be sent.
sizeFileThe size of the file to be sent, in bytes.
Returns
int Returns 0 on success, or a negative error code on failure.

Definition at line 34 of file YmodemTransmit.cpp.

◆ sendLastPacket()

int sendLastPacket ( )

Sends the last packet in the Ymodem transmission.

This function is responsible for transmitting the final packet in the Ymodem protocol. It ensures that the transmission is properly terminated.

Returns
int Returns 0 on success, or a negative error code on failure.

Definition at line 122 of file YmodemTransmit.cpp.

◆ waitForReceiverResponse()

int waitForReceiverResponse ( )

Waits for a response from the receiver.

This function blocks the execution until a response is received from the receiver. It is typically used in communication protocols where the transmitter needs to wait for an acknowledgment or other response from the receiver before proceeding.

Returns
int Returns a status code indicating the result of waiting for the receiver's response. The specific values and their meanings should be defined in the implementation.

Definition at line 16 of file YmodemTransmit.cpp.