#include <rtl.h>
BOOL tftpc_put (
U8* ipadr, /* IP address of the TFTP server. */
U16 port, /* Port number of TFTP server. */
const char *src, /* Name of the local file to send. */
const char *dst, /* Name of the file on TFTP server. */
void (*cbfunc)(U8 event) ); /* Function to call when the session ends. */
Description
The tftpc_put function starts the TFTP client on the TCPnet
system to transfer a file from the local system to remote TFTP
server. This causes the TFTP client to then start a TFTP session by
connecting to a TFTP server on the UDP port specified in the
function argument. If the port is not specified, that is the
argument port has a value of 0, the system uses a standard
TFTP server port to connect to.
The argument ipadr points to an array of 4 bytes containing
the dotted-decimal notation of the IP address of the TFTP server to
connect to.
The arguments src and dst are pointers to
0-terminated names of source and destination files. Source file is a
local file that is going to be sent. Destination file is a file on
TFTP server, where the file content will be copied to. If the
destination file is not specified, that is the argument dst
has a value of NULL, then the name of the source file becomes also a
name of the destination file.
The argument cbfunc points to a function that the TFTP
client running on TCPnet calls when the TFTP session ends. The
cbfunc is an event callback function that uses the
event argument of the cbfunc function to signal one of
the following TFTP events:
Event
Description
TFTPC_EVT_SUCCESS
The file has been successfully transferred.
TFTPC_EVT_TIMEOUT
TFTP Server response has timed out, and hence the TFTP client
has aborted the operation.
TFTPC_EVT_NOACCESS
File access on TFTP server is not allowed for a specified
file.
TFTPC_EVT_DISKFULL
The TFTP server has run out of disk space, file transfer is
not possible.
TFTPC_EVT_ERROR
The TFTP server has encountered an error during file transfer
process.
The tftpc_put function is in the RL-TCPnet library. The
prototype is defined in rtl.h.
note
The standard TFTP server port is UDP port 69.
Your application, running on TCPnet, can call the
tftpc_put function to send a file to a TFTP server.
Return Value
The tftpc_put function returns __TRUE if the TFTP client
has been successfully started. Otherwise it returns __FALSE.
Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers of your data.