![Texas TMS320C6000 Programmer'S Reference Manual Download Page 259](http://html.mh-extra.com/html/texas/tms320c6000/tms320c6000_programmers-reference-manual_1093844259.webp)
Adding WEB Content
E-2
E.1 Adding WEB Content
E.1.1
Operation
As previously mentioned, the HTTP server allows access to files using the em-
bedded file system (EFS) API. The default instantiation of this API is a RAM
based file system that resides in the OS adaptation layer. This OS adaptation
layer allows the HTTP server to work on any file storage device contained in
the system.
The default RAM based file system is built up mainly from a standard file i/o
API, with the addition of some private functions. These private functions allow
files to be created and destroyed by passing in memory pointers to where they
are stored. These functions are fully documented in section 2.6.
E.1.2
Converting Standard HTML Files
The example code supplied with the NDK adds WEB pages by converting
them from binary HTML files into data arrays declared in C. An MsDos utility
binsrc is supplied to allow conversion of files to a C array.
The calling format for binsrc is:
binsrc <input file name> <output file name> <identifier>
Parameters:
input file name
File to be converted
output file name
Name for file containing C data
representation of the input file name
identifier
C name for data
For example, to convert an HTML file
default.htm
, for use by EFS, the follow-
ing command could be executed from the Windows command window:
binsrc default.htm default.c DEFAULT
The file default.c would contain the following:
#define DEFAULT_SIZE 1610
unsigned char DEFAULT[] = {0x3C, 0x21, 0x64, 0x6F, 0x63, 0x74, 0x79, 0x70, 0x65,
0x20, 0x68, 0x74,
…
E.1.3
Declaring HTML Files to EFS
Once the HTML file is converted to a memory image, the “file” is declared to
the EFS file system by calling the function efs_createfile(). All the HTML files
are typically created at the same time, during initialization, and before the
HTTP server is actually invoked. In the example code, there are two functions
used, AddWebFiles() and RemoveWebFiles(). These functions include all the
code necessary to initialize and cleanup the EFS file environment.