Răsfoiți Sursa

2022-12-30 / ct_chen

Actions:
1. Webservice modify restart from soft to hard

FIles:
1. EVSE/Modularization/WebService.c
ct_chen 2 ani în urmă
părinte
comite
6fe6a1be12
1 a modificat fișierele cu 6 adăugiri și 5 ștergeri
  1. 6 5
      EVSE/Modularization/WebService.c

+ 6 - 5
EVSE/Modularization/WebService.c

@@ -1511,19 +1511,20 @@ int main(int argc, char *argv[]) {
 		{
 			if((ShmSysConfigAndInfo->SysInfo.OcppRunningVer == OCPP_RUNNING_VERSION_16) && (system("pidof -s OcppBackend > /dev/null") == 0))
 			{
-				sprintf((char*)ShmOCPP16Data->Reset.Type, "Soft");
+				sprintf((char*)ShmOCPP16Data->Reset.Type, "Hard");
 				ShmOCPP16Data->MsMsg.bits.ResetReq = 1;
-				DEBUG_INFO("Soft reset by OCPP1.6 form web page.\n");
+				DEBUG_INFO("Hard reset by OCPP1.6 form web page.\n");
 			}
 			else if((ShmSysConfigAndInfo->SysInfo.OcppRunningVer == OCPP_RUNNING_VERSION_20) && (system("pidof -s OcppBackend20 > /dev/null") == 0))
 			{
-				sprintf((char*)ShmOCPP20Data->Reset.type, "OnIdle");
+				sprintf((char*)ShmOCPP20Data->Reset.type, "Immediate");
 				ShmOCPP20Data->MsMsg.bits.ResetReq = 1;
-				DEBUG_INFO("Soft reset by OCPP2.0.1 form web page.\n");
+				DEBUG_INFO("Hard reset by OCPP2.0.1 form web page.\n");
 			}
 			else
 			{
-				system("exec /usr/bin/run_evse_restart.sh");
+				//system("exec /usr/bin/run_evse_restart.sh");
+				system("exec /sbin/reboot");
 				DEBUG_INFO("Soft reset directly form web page.\n");
 			}
 		}