This library contains functions for downloading files from a TFTP server. Note that the function settftpserver from the socket library must be used to initialize the IP address of the TFTP server before communication can begin.
For detailed information on the DS80C400 please see the High-Speed Microcontroller User's Guide: DS80C400 Supplement.
Go to the source code of this file.
Defines | |
| #define | ROM400_TFTP_VERSION 5 |
| #define | TFTP_MORE_DATA 0 |
| #define | TFTP_LAST_SEGMENT 1 |
Functions | |
| unsigned int | tftp_init (void) |
| Initialize the TFTP client. | |
| unsigned int | tftp_first (unsigned char *filename) |
| Requests a file from the TFTP server. | |
| unsigned int | tftp_next (unsigned int ack_only) |
| Read subsequent blocks of a file from a TFTP server. | |
| void * | tftp_getdata (void) |
| Get the pointer to the TFTP client's read buffer. | |
| void | tftp_close (void) |
| Closes the socket used by the TFTP library. | |
| unsigned int | tftp_version (void) |
| Returns the version number of this TFTP library. | |
|
|
Version number associated with this header file. Should be the same as the version number returned by the tftp_version function.
|
|
|
Agrument to function tftp_next requesting the connection be closed.
|
|
|
Agrument to function tftp_next requesting more data.
|
|
|
Closes the socket used by the TFTP library. Closes the socket used by the TFTP library. Every call to tftp_first creates a new socket, and must be balanced by a call to tftp_close or the system will have lingering, inaccessible sockets.
|
|
|
Requests a file from the TFTP server. Requests the specified file from the TFTP server. As long as the file exists and this function returns successfully, use the buffer pointer returned from tftp_getdata to read the first block of the requested file. Use tftp_next to read subsequent blocks of data. After the TFTP transaction is complete (or an error has occurred and the TFTP transaction will be abandoned), use tftp_close to clean up the transmission socket.
|
|
|
Get the pointer to the TFTP client's read buffer. Applications should read the TFTP data after every call to tftp_first or tftp_next. This function only needs to be called once after tftp_init has been called (the buffer pointer does not change).
|
|
|
Initialize the TFTP client. Initializes the TFTP client. Note that the IP address of the TFTP server must be set using the settftpserver function from the socket library. After the TFTP Client is initialized, call the tftp_getdata function to request a pointer to the TFTP client's buffer.
|
|
|
Read subsequent blocks of a file from a TFTP server. Requests the next block of a file be read from the TFTP server. Use the buffer pointer returned from tftp_getdata to read the block read from the TFTP server. If this function returns less than 512 bytes read, it means this is the last block of data. Call tftp_next one more time with the argument TFTP_LAST_SEGMENT to clean up. After the TFTP transaction is complete (or an error has occurred and the TFTP transaction will be abandoned), use tftp_close to clean up the transmission socket.
|
|
|
Returns the version number of this TFTP library.
|
| Copyright 2004 Dallas Semiconductor, Inc.. | Documentation generated by Doxygen. |