Ymodem ESP32 1.0.0
Loading...
Searching...
No Matches
Ymodem Class Reference

Ymodem class. More...

#include <YmodemCore.h>

Public Member Functions

 Ymodem ()
 Constructor for the Ymodem class.
 
 ~Ymodem ()
 Destructor for the Ymodem class.
 
int receive (fs::File &ffd, unsigned int maxsize, char *getname)
 Receives data and writes it to the provided file.
 
int transmit (char *sendFileName, unsigned int sizeFile, fs::File &ffd)
 Transmits a file using the Ymodem protocol.
 
void setLedPin (int pin)
 Sets the pin number for the LED.
 
int getLedPin ()
 Retrieves the pin number associated with the LED.
 

Detailed Description

Ymodem class.

This class provides high-level functions for sending and receiving files using the Ymodem protocol. It encapsulates the low-level packet processing and communication functions to simplify the file transfer process.

Definition at line 29 of file YmodemCore.h.

Constructor & Destructor Documentation

◆ Ymodem()

Ymodem::Ymodem ( )

Constructor for the Ymodem class.

Initializes a new instance of the Ymodem class.

Definition at line 17 of file YmodemCore.cpp.

◆ ~Ymodem()

Ymodem::~Ymodem ( )
inline

Destructor for the Ymodem class.

This destructor is responsible for cleaning up any resources that the Ymodem class may have allocated during its lifetime. Currently, it does not perform any specific actions.

Definition at line 46 of file YmodemCore.h.

Member Function Documentation

◆ getLedPin()

int Ymodem::getLedPin ( )

Retrieves the pin number associated with the LED.

Returns
int The pin number of the LED.

Definition at line 30 of file YmodemCore.cpp.

◆ receive()

int Ymodem::receive ( fs::File & ffd,
unsigned int maxsize,
char * getname )

Receives data and writes it to the provided file.

Parameters
ffdReference to the file where the received data will be written.
maxsizeMaximum size of the data to be received.
getnamePointer to a character array where the name of the received file will be stored.
Returns
int Status code indicating the result of the receive operation. Error code:
  • -1: Abort by sender
  • -2: Too many errors
  • -3: Packet sequence error
  • -4: Invalid file size
  • -5: Filename packet error
  • -6: File write error
  • -7: User abort
  • -8: Timeout
  • -9: File size exceeds maxsize

Definition at line 51 of file YmodemCore.cpp.

◆ setLedPin()

void Ymodem::setLedPin ( int pin)

Sets the pin number for the LED.

This function configures the specified pin to be used for controlling an LED.

Parameters
pinThe pin number to be set for the LED.

Definition at line 22 of file YmodemCore.cpp.

◆ transmit()

int Ymodem::transmit ( char * sendFileName,
unsigned int sizeFile,
fs::File & ffd )

Transmits a file using the Ymodem protocol.

Parameters
sendFileNameThe name of the file to be transmitted.
sizeFileThe size of the file to be transmitted.
ffdA reference to the file object to be transmitted.
Returns
int Status code of the transmission (0 for success, non-zero for errors). Error code:
  • -1: Abort by sender
  • -2: Too many errors
  • -3: Packet sequence error
  • -4: Invalid file size
  • -5: Filename packet error
  • -6: File write error
  • -7: User abort
  • -8: Timeout
  • -9: File size exceeds maxsize

Definition at line 69 of file YmodemCore.cpp.


The documentation for this class was generated from the following files: