My Project
 All Classes Functions Variables Pages
Classes | Public Member Functions | List of all members
TFTP Class Reference

A TFTP server. More...

#include <TFTP.h>

Classes

class  TFTP_Transaction
 Internal class for TFTP processing. More...
 

Public Member Functions

void start (uint16_t port=TFTP_DEFAULT_PORT)
 Start being a TFTP server. More...
 
void setBaseDir (std::string baseDir)
 Set the base dir for file access. If we are asked to put a file to the file system, this is the base relative directory. More...
 

Detailed Description

A TFTP server.

The Trivial File Transfer Protocol is a specification for simple file transfer without the richness of implementation of full FTP. It is very easy to implement both a server and a client. The protocol leverages UDP as opposed to connection oriented (TCP). The specification can be found here.

Here is an example fragment which mounts a file system and then starts a TFTP server to provide access to its content.

FATFS_VFS fs("/spiflash", "storage");
fs.mount();
TFTP tftp;
tftp.setBaseDir("/spiflash");
tftp.start();

On Linux, I recommend the atftp client.

Member Function Documentation

void TFTP::setBaseDir ( std::string  baseDir)

Set the base dir for file access. If we are asked to put a file to the file system, this is the base relative directory.

Parameters
baseDirBase directory for file access.
Returns
N/A.
void TFTP::start ( uint16_t  port = TFTP_DEFAULT_PORT)

Start being a TFTP server.

This function does not return.

Parameters
[in]portThe port number on which to listen. The default is 69.
Returns
N/A.

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