/*********************************************************************/ /*** Other Functions ***/ /*********************************************************************/ /***********************/ /*** UpdateHTMLIndex ***/ /***********************/ INT8 UpdateHTMLIndex( UINT8 mote ); Input Args - mote to use for updating the index Output Args - None Return Value - 0 if success; non-zero if error This function takes two files, the template.html file and the mote data file and merges the two files into the index.html file. This is done by using the File API to open the two input files and parsing them piece by piece, looking for particular markers for adding the mote data. When a mote data marker is found in the template, the data from the mote is parsed and placed in the output file. Other than the data markers, the input file is directly transferred to the output file. The Mote data markers appear in the input file like this: ###x - where x is the particular value needed x = A (mote temperature), x = B (mote humidity), etc. (K max) When the template file is done being parsed, the files are closed and ready to be read by the html server. /***********************/ /*** CreateFiles ***/ /***********************/ INT8 CreateFiles(); Input Args - None Output Args - None Return Value - 0 if success; non-zero if error This function creates two files, template.html and back.jpg These files are needed to use the HTTP functionality of the project. The template.html is used for merging files and the back.jpg is a background image of the web page. /***********************/ /*** our_strcmp ***/ /***********************/ int our_strcmp(far char * str1, far char * str2) Input Args - str1 & str2 - strings to compare Output Args - None Return Value - 0 if same; 1 if different This checks two strings for similarity. This replaces the base string library function which uses 2 near pointers. If the strings are the same, it returns 0, else 1. /***********************/ /*** our_strcpy ***/ /***********************/ void our_strcpy(far char * dest, far char * src) Input Args - src - the input string Output Args - dest - the place to copy src Return Value - None This function copies the string from src to dest and appends a null character to the end of dest. This null character is always appeneded even if src is null. This replaces the base string library function which uses 2 near pointers. /***********************/ /*** our_strcat ***/ /***********************/ void our_strcat(far char * orig, far char * append) Input Args - append - the string to append to orig Output Args - orig - the string to get modified Return Value - None This adds the string append to the string orig. After the append is complete a null character is added to orig. This replaces the base string libaray function which uses 2 near pointers. /*********************************************************************/ /*********************************************************************/