Code written by Paul Rabbat, Angel Daruna, Jarel Hawkins, and Cordel Williams
Dependencies: 4DGL-uLCD-SE EthernetInterface HTTPClient NTPClient PinDetect SDFileSystem mbed-rpc mbed-rtos mbed wave_player
Fork of ECE4180_FinalProject by
Diff: Formatter.cpp
- Revision:
- 12:a99989062fee
- Parent:
- 11:1c3bc07daabf
--- a/Formatter.cpp Sun Dec 07 20:37:08 2014 +0000 +++ b/Formatter.cpp Sun Dec 07 20:53:05 2014 +0000 @@ -5,23 +5,6 @@ #include "alarmContainer.h" #include <string> -/* itoa: convert n to characters in s */ -void itoa( unsigned long long int value, char *str) -{ - int i,j; - char temp[30]; - for(i=0; value > 0; i++){ - str[i] = value%10+'0'; - value=value/10; - } - for(j=0;i>=0;j++,i--){ - temp[j]=str[i-1]; - } - for(i=0;i<j;i++){ - str[i]=temp[i]; - } -} - const char *SIMPLE_HTML_CODE = "\ <!DOCTYPE html>\ <html>\ @@ -82,7 +65,6 @@ const char* INTERACTIVE_HTML_CODE_2 = "</body> \ </html>"; -//static char chunk[1024]; static char chunk[4096]; Formatter::Formatter(int nb): @@ -119,14 +101,6 @@ void SimpleHTMLFormatter::get_chunk(const int c, char* reply) { strcat(chunk, SIMPLE_HTML_CODE); - - if(reply != NULL && strlen(reply) != 0) - { - /* - strcat(chunk, "RPC reply : "); - strcat(chunk, reply); - */ - } if(!RPCObjectManager::instance().is_empty()) { @@ -403,11 +377,9 @@ strcat(chunk, "<option "); if(strcmp(_alarm.amPm,"AM") == 0){ strcat(chunk, "selected=\"selected\""); } strcat(chunk, "value=\"0\">AM</option>"); - strcat(chunk, "<option "); if(strcmp(_alarm.amPm,"PM") == 0){ strcat(chunk, "selected=\"selected\""); } strcat(chunk, "value=\"1\">PM</option>"); - strcat(chunk, "</select>"); strcat(chunk, "<br><p>"); strcat(chunk, "<input type=\"button\" value=\"Save\" onclick=\"javascript:submitAlarmPreferences();\">");