|
@@ -1187,7 +1187,7 @@ void get_firmware_version(unsigned char gun_index)
|
|
|
strcpy((char*)ShmSysConfigAndInfo->SysInfo.CsuPrimFwRev, ShmCharger->gun_info[gun_index].ver.Version_FW);
|
|
|
|
|
|
// Get CSU root file system version
|
|
|
- sprintf((char*)ShmSysConfigAndInfo->SysInfo.CsuRootFsFwRev, "B0.51.00.0000.00");
|
|
|
+ sprintf((char*)ShmSysConfigAndInfo->SysInfo.CsuRootFsFwRev, "B0.52.00.0000.00");
|
|
|
|
|
|
// Get AC connector type from model name
|
|
|
for(uint8_t idx=0;idx<3;idx++)
|
|
@@ -1638,7 +1638,7 @@ int isReachableInternet()
|
|
|
FILE *fp;
|
|
|
char cmd[256];
|
|
|
char buf[512];
|
|
|
- //char tmp[512];
|
|
|
+ char tmp[512];
|
|
|
|
|
|
if(ShmOCPP16Data->OcppConnStatus == PASS)
|
|
|
{
|
|
@@ -1646,6 +1646,28 @@ int isReachableInternet()
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
+ strcpy(cmd, "ifconfig eth0");
|
|
|
+ fp = popen(cmd, "r");
|
|
|
+
|
|
|
+ if (fp != NULL)
|
|
|
+ {
|
|
|
+ while(fgets(buf, sizeof(buf), fp) != NULL)
|
|
|
+ {
|
|
|
+ if (strstr(buf, "inet addr:") > 0)
|
|
|
+ {
|
|
|
+ sscanf(buf, "%*s%s", tmp);
|
|
|
+ substr(tmp, tmp, strspn(tmp, "addr:"), strlen(buf)-strspn(tmp, "addr:"));
|
|
|
+
|
|
|
+ if (strcmp(tmp, (char *)ShmSysConfigAndInfo->SysConfig.Eth0Interface.EthIpAddress) != 0)
|
|
|
+ {
|
|
|
+ strcpy((char *) ShmSysConfigAndInfo->SysConfig.Eth0Interface.EthIpAddress, tmp);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ pclose(fp);
|
|
|
+ memset(buf, 0x00, sizeof(buf));
|
|
|
+
|
|
|
for(int idx=0;idx<ARRAY_SIZE(valid_Internet);idx++)
|
|
|
{
|
|
|
sprintf(cmd, "ping -c 1 -w 3 -I eth0 %s", valid_Internet[idx]);
|
|
@@ -1844,7 +1866,7 @@ int getEth0MacAddress()
|
|
|
char buf[512];
|
|
|
char tmp[512];
|
|
|
|
|
|
- strcpy(cmd, "ifconfig");;
|
|
|
+ strcpy(cmd, "ifconfig eth0");
|
|
|
fp = popen(cmd, "r");
|
|
|
if(fp != NULL)
|
|
|
{
|
|
@@ -2403,6 +2425,7 @@ int main(void)
|
|
|
ftime(&startTime[gun_index][TMR_IDX_AUTH]);
|
|
|
if(ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].StartMethod == START_METHOD_RFID)
|
|
|
{
|
|
|
+ memset(ShmOCPP16Data->Authorize.ResponseIdTagInfo.Status, 0x00, ARRAY_SIZE(ShmOCPP16Data->Authorize.ResponseIdTagInfo.Status));
|
|
|
switch(ShmSysConfigAndInfo->SysConfig.AuthorisationMode)
|
|
|
{
|
|
|
case AUTH_MODE_ENABLE:
|