Finished Time Stamping - Started Web Log Structure
This commit is contained in:
		
							parent
							
								
									20ce79ef34
								
							
						
					
					
						commit
						b6c019d1a8
					
				|  | @ -1274,7 +1274,8 @@ int HAPClient::getStatusURL(){ | |||
|   response+="<p><b>" + String(homeSpan.displayName) + "</b></p>\n"; | ||||
|    | ||||
|   response+="<table>\n"; | ||||
|   response+="<tr><td>Uptime:</td><td>" + String(uptime) + "</td></tr>\n"; | ||||
|   response+="<tr><td>Up Time:</td><td>" + String(uptime) + "</td></tr>\n"; | ||||
|   response+="<tr><td>Boot Time:</td><td>" + String(homeSpan.bootTime) + "</td></tr>\n"; | ||||
|   response+="<tr><td>ESP32 Board:</td><td>" + String(ARDUINO_BOARD) + "</td></tr>\n"; | ||||
|   response+="<tr><td>Arduino-ESP Version:</td><td>" + String(ARDUINO_ESP_VERSION) + "</td></tr>\n"; | ||||
|   response+="<tr><td>ESP-IDF Version:</td><td>" + String(ESP_IDF_VERSION_MAJOR) + "." + String(ESP_IDF_VERSION_MINOR) + "." + String(ESP_IDF_VERSION_PATCH) + "</td></tr>\n"; | ||||
|  |  | |||
|  | @ -563,10 +563,10 @@ void Span::checkConnect(){ | |||
|   if(timeServer){ | ||||
|     Serial.printf("Acquiring Time from %s... ",timeServer,timeZone); | ||||
|     configTzTime(timeZone,timeServer); | ||||
|     struct tm timeinfo; | ||||
|     if(getLocalTime(&timeinfo)){ | ||||
|       char c[65]; | ||||
|       strftime(c,64,"%a %b %e %Y %I:%M:%S %p",&timeinfo); | ||||
|       Serial.printf("%s (%s)\n\n",c,timeZone); | ||||
|       strftime(bootTime,sizeof(bootTime),"%c",&timeinfo); | ||||
|       Serial.printf("%s\n\n",bootTime); | ||||
|     } else { | ||||
|       Serial.printf("Can't access Time Server - time-keeping disabled!\n\n"); | ||||
|       timeServer=NULL; | ||||
|  |  | |||
|  | @ -94,6 +94,14 @@ struct SpanBuf{                               // temporary storage buffer for us | |||
|    | ||||
| ///////////////////////////////
 | ||||
| 
 | ||||
| struct SpanWebLog{                            // optional web status/log data
 | ||||
|   int maxEntries=-1;                          // max number of log entries; -1 = do not create log or status; 0 = create status but no log; 1..N = create status and log with N entries
 | ||||
|   int nEntries=0;                             // current number of log entries
 | ||||
|   char **entry;                               // pointers to log entries of arbitrary size
 | ||||
| }; | ||||
| 
 | ||||
| ///////////////////////////////
 | ||||
| 
 | ||||
| struct Span{ | ||||
| 
 | ||||
|   const char *displayName;                      // display name for this device - broadcast as part of Bonjour MDNS
 | ||||
|  | @ -115,7 +123,8 @@ struct Span{ | |||
|   char pairingCodeCommand[12]="";               // user-specified Pairing Code - only needed if Pairing Setup Code is specified in sketch using setPairingCode()
 | ||||
|   const char *timeZone=NULL;                    // optional time-zone specification
 | ||||
|   const char *timeServer=NULL;                  // optional time server to use for acquiring clock time
 | ||||
|   struct tm timeinfo;                           // optional time info structure
 | ||||
|   char bootTime[33]="Unknown";                  // boot time
 | ||||
|   SpanWebLog webLog;                            // optional web status/log
 | ||||
|    | ||||
|   boolean connected=false;                      // WiFi connection status
 | ||||
|   unsigned long waitTime=60000;                 // time to wait (in milliseconds) between WiFi connection attempts
 | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue
	
	 Gregg
						Gregg