Author Topic: adding html page with new header, but it show "!DEF"  (Read 1951 times)

Bua

  • Sr. Member
  • ****
  • Posts: 34
    • View Profile
adding html page with new header, but it show "!DEF"
« on: March 16, 2014, 10:46:25 PM »
Hi,

I create an additional html page called PosturePlane.html and an additional PPheader.inc in Default webpage.  Both have been added inside the webpage folder.  The PPheader.inc is almost a copy of header.inc.

I saw that I need to add a case in HTTPPrint.h, and I have add PPheader.inc at the lowest case just before default: see below.

case 0x0000003a:
         HTTPIncFile((ROM BYTE*)"PPheader.inc");
         break;
      default:
         // Output notification for undefined values
         TCPPutROMArray(sktHTTP, (ROM BYTE*)"!DEF", 4);

Once I compiled and downloaded the firmware and generated the MPFS file and uploaded the webpages.  I can see http://mchpboard/PosturePlane.html with no header. At the header it shows !DEF.

What else I have to look at to make the PPheader.inc works?  If I changed from PPheader.inc to header.inc, it works fine.  I suspected that there are something to do with the case number.

Thanks,
Bua

Bua

  • Sr. Member
  • ****
  • Posts: 34
    • View Profile
Re: adding html page with new header, but it show "!DEF"
« Reply #1 on: March 23, 2014, 06:08:19 PM »
I got the solution from this link http://www.egr.msu.edu/classes/ece480/capstone/fall11/group03/TCPIP%20Stack%20Help.pdf.

Quote
When you run the MPFS2 Utility to generate the web pages, it will
automatically index these variables in HTTPPrint.h. This index will instruct your application to invoke the function
HTTPPrint_myVariable when this string is encountered.

 So after you generated the new webpage, you will have to copy the HTTPPrint. H file from webpages folder into your project folder.

Bua