Main Page   Modules   Alphabetical List   Data Structures   File List   Data Fields   Related Pages  

TFTP Routines

Download the binary application file into the flash ROM. More...

Data Structures

struct  tftphdr

Defines

#define TFTP_RRQ   01
 TFTP read request packet.

#define TFTP_WRQ   02
 TFTP write request packet.

#define TFTP_DATA   03
 TFTP data packet.

#define TFTP_ACK   04
 TFTP acknowledgement packet.

#define TFTP_ERROR   05
 TFTP error packet.

#define TFTP_OACK   06
 TFTP option acknowledgement packet.


Typedefs

typedef tftphdr TFTPHDR

Functions

void FlashPage (u_short page, void *data, u_short len)
 Erase and program a page in the flash ROM.

int MakeRequest (TFTPHDR *th, u_short request, u_char *name, u_char *mode)
 Set up a TFTP header for a file request.

int TftpRecv (void)
 Download a file from a TFTP server and burn it into the flash ROM.


Detailed Description

Download the binary application file into the flash ROM.


Function Documentation

void FlashPage u_short    page,
void *    data,
u_short    len
[static]
 

Erase and program a page in the flash ROM.

Parameters:
page  The page number to program, 0..479.
data  Pointer to the new page contents.
len  Number of bytes to program. If this is less than 256, then the remaining bytes will be filled with 0xFF.

Definition at line 63 of file tftp.c.

int MakeRequest TFTPHDR *    th,
u_short    request,
u_char   name,
u_char   mode
[static]
 

Set up a TFTP header for a file request.

Parameters:
th  Points to the TFTP header structure.
request  Type of the request, either TFTP_RRQ or TFTP_WRQ.
name  Name of the files.
mode  Transfer mode.

Definition at line 100 of file tftp.c.

int TftpRecv void   
 

Download a file from a TFTP server and burn it into the flash ROM.

Returns:
0 on success, -1 otherwise.

Definition at line 120 of file tftp.c.


© 2002 by egnite Software GmbH - visit http://www.ethernut.de/