Jump to: navigation, search

Table of Contents >> Application Reference

The TFTPD Application Program Interface allows the user to run a TFTP server. It consists of two parts:

1. User Interface:
The user interface allows the user to start/stop the TFTP server to allow/stop remote TFTP clients to connect and exchange files with the host.
2. File System Interface:
The file system interface allows the TFTP server to interact with the operating system's file system to do such things as store and retrieve files.

User Interface

Four calls are provided in the TFTPD User Interface.

1. tfTftpdInit()
This function must be called before any other TFTP API calls are made. It initializes various data associated with the TFTP server.
2. tfTftpdUserStart()
The user calls tfTftpdUserStart() to open a TFTP server socket and to begin listening for incoming connections. tfTftpdUserStart() can be either blocking or non blocking, as specified by its last parameter.
Blocking Mode
In blocking mode, tfTftpdUserStart() should be called from a task. It will block and wait for incoming connections, and will not return unless an error occurs. The TFTP server code is executed in the context of the calling task. Choose blocking mode if you are using an RTOS/Kernel.
Non-Blocking Mode
In non-blocking mode, tfTftpdUserStart() will return immediately after checking for incoming connections. It is the user’s responsibility to then call tfTftpdUserExecute() periodically to execute the TFTP server code. Choose non-blocking mode if you do not have an RTOS/Kernel.
3. tfTftpdUserExecute()
If tfTftpdUserStart() was called in non-blocking mode, tfTftpdUserExecute() must be called periodically. If tfTftpdUserStart() was called in blocking mode, there is no need to call tfTftpdUserExecute().
4. tfTftpdUserStop()
The user calls tfTftpdUserStop() to close the TFTP server socket and kill all existing TFTP connections.

File System Interface

Note Note: File system calls for the FTP server can be found on the File System Interface page.

Function Calls

Table of Contents >> Application Reference