AN2836 Freescale Semiconductor / Motorola, AN2836 Datasheet - Page 30

no-image

AN2836

Manufacturer Part Number
AN2836
Description
Web Server Development with MC9S12NE64 and OpenTCP
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
Overview of a Web Server Developed Using OpenTCP TCP/IP Stack
FileSys.c
FileSys.c is used by OpenTCP as a file system array reference for HTML and other files used in the web
server. When a client remote host makes a request to the web server for a file, OpenTCP accesses
FileSys.c to determine whether the file is available, so it is important that FileSys.c contains the correct
information. FileSys.c requires that the header files provided by CEncoderBeta.exe are listed in the
include section for FileSys.c as shown in the source code.
FileSys.c defines an array of the web server files. Each file entry is defined by the following structure,
which includes a hash value of the original web server file name, a pointer to the C representation of the
web server file, and its file size. For demo.htm , the pointer to the C representation of the web server file
is found in demo.c (demo_file); the length of the demo.c date is provided in demo.h (DEMO_FILE_LEN).
typedef struct TFileEntry
{
unsigned char hash;
const unsigned char* file_start_address; //start of file
unsigned short
} TFileEntry;
The hash value for demo.htm can be easily calculated. The hash calculation formula is provided in the
https_calculatehash (UINT32 len) function in the http_server.c file. A simple utility is provided with this
application note (in AN2863SW.zip from freescale.com) to provide the hash calculation,
hashcalculator.exe . This hash calculator is provided without any guarantees.
Table 8
30
provides a brief description of each file referenced by the web server.
index.htm
devetools.htm
features.htm
demo.htm
freescale.jpg
space.jpg
NE64DemoNDPIC.cab
Filename
Web Server Development with MC9S12NE64 and OpenTCP, Rev. 0
file_length;
Table 8. Files Referenced by the Web Server
// hash value for this entry file name
Hash Value
115
139
242
160
193
120
247
Static web page
Static web page
Static web page
Dynamic web page
Logo graphic
Graphic
Compressed ActiveX file
Description
Freescale Semiconductor

Related parts for AN2836