XC2 webserver

Technical discussions related to any XMOS development kit or reference design. Eg XK-1A, sliceKIT, etc.
User avatar
Experienced Member
Posts: 104
Joined: Fri Dec 11, 2009 8:29 pm

Post by davelacey »

I can answer some of these questions. I'm afraid that the contents of the XC-2 demo is not tremendously well documented (as you have pointed out the web page delivery part of it is not really supposed to be adapted to a "real" application but to give an example of working ethernet and tcp stack).
smuraski wrote:OK...so now that I understand this better...it is the sequence of 0x0A 0x0D that windows translates into 0x0A...I tried to decypher the perl script and it looks like if it is an .HTML file or .CSS then binary mode is turned off and if the file is located in the img folder and is a .jpg, .gif or .png it is turned on.

Is there another program that could be used to generate the data?

Some other issues that will eventually need answers include:

What is the meaning of the rest of the information in the declarations following the "data' as in:

static unsigned int cmd__config_html[] = {
1,(unsigned int) &data__config_html[13],2,2052,8,2,33,4,2,45,9,2,42,10,2,32,12,2,414,10,2,94,12,2,714,0,
What is the purpose of the data in the struct declarations?
This structure is a list of commands for displaying the data in the webpage. Some pages are templates which have data from the system (i.e. the current ip address) inserted into the page. The perl script converts this into a list of commands e.g. read 130 bytes of data from the page, then display current ip address, then read 52 data bytes from the page... This avoids having to put a template engine in the firmware itself.

These commands are interpreted in the file page_server_support.c in the firmware.
How does the script make the decision when it creates the 2nd to last line "#define FS_ROOT file__index_html" because this also is incorrect in the genereted fsdata.c file...in one case it referred to a jpg image.
The files are put into a linked list data structure and FS_ROOT is the root node of this list. The list is just ordered in the order the perl script happens to read the directory (dependent on the OS) so will vary between runs. Hence the FS_ROOT value may vary.

Hope this helps.