Functions to connect to a TFTP server. More...
Functions | |
netStatus | netTFTPc_Put (const NET_ADDR *addr, const char *fname, const char *local_fname) |
Put a file to a remote TFTP server. [thread-safe]. | |
netStatus | netTFTPc_Get (const NET_ADDR *addr, const char *fname, const char *local_fname) |
Retrieve a file from a remote TFTP server. [thread-safe]. | |
Functions to connect to a TFTP server.
Due to the simplicity of the TFTP protocol, there are only two user commands for interaction with a remote TFTP server. netTFTPc_Get is used to download a file from the server, whereas netTFTPc_Put uploads a file onto the server. TFTP servers do not support directories, so all files will be up-/downloaded from the same root-directory.
Retrieve a file from a remote TFTP server. [thread-safe].
[in] | addr | structure containing IP address and port of remote TFTP server. |
[in] | fname | pointer to the remote file name, a null-terminated string. |
[in] | local_fname | pointer to the local file name, a null-terminated string. |
The function netTFTPc_Get is used to transfer a file from a remote TFTP server to the local system. The TFTP client starts a (UDP based) TFTP session by connecting to a TFTP server specified by the argument addr. This argument points to a structure containing the IP address and port of the TFTP server. If the specified port is 0, the client uses a standard TFTP server port 69 to connect to the server.
The argument fname points to the null-terminated name of the source file on the TFTP server.
The argument local_fname points to the null-terminated name of the destination file on the local system. If the destination file is not specified (local_fname has a value of NULL), then the fname will be used as the destination file name.
Possible netStatus return values:
Code Example
Put a file to a remote TFTP server. [thread-safe].
[in] | addr | structure containing IP address and port of remote TFTP server. |
[in] | fname | pointer to the remote file name, a null-terminated string. |
[in] | local_fname | pointer to the local file name, a null-terminated string. |
The function netTFTPc_Put is used to transfer a file from the local system using the TFTP client to a remote TFTP server. This causes the TFTP client to start a (UDP based) TFTP session by connecting to the TFTP server specified by the argument addr. This points to the structure containing the IP address and port of the TFTP server. If the specified port is 0, the client uses a standard TFTP server port 69 to connect to the server.
The argument fname points to the null-terminated name of the destination file on the TFTP server. If the destination file is not specified (fname has a value of NULL), then the local_fname name will be used as the destination file name.
The argument local_fname points to the null-terminated name of the source file on the local system.
Possible netStatus return values:
Code Example