|
@@ -1271,7 +1271,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, "V0.64.00.0000.00");
|
|
|
+ sprintf((char*)ShmSysConfigAndInfo->SysInfo.CsuRootFsFwRev, "V0.65.00.0000.00");
|
|
|
|
|
|
// Get AC connector type from model name
|
|
|
for(uint8_t idx=0;idx<3;idx++)
|
|
@@ -1745,12 +1745,40 @@ int isReachableInternet()
|
|
|
{
|
|
|
strcpy((char *) ShmSysConfigAndInfo->SysConfig.Eth0Interface.EthIpAddress, tmp);
|
|
|
}
|
|
|
+
|
|
|
+ sscanf(buf, "%*s%*s%*s%s", tmp);
|
|
|
+ substr(tmp, tmp, strspn(tmp, "Mask:"), strlen(buf)-strspn(tmp, "Mask:"));
|
|
|
+ if (strcmp(tmp, (char *)ShmSysConfigAndInfo->SysConfig.Eth0Interface.EthSubmaskAddress) != 0)
|
|
|
+ {
|
|
|
+ strcpy((char *) ShmSysConfigAndInfo->SysConfig.Eth0Interface.EthSubmaskAddress, tmp);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
pclose(fp);
|
|
|
memset(buf, 0x00, sizeof(buf));
|
|
|
|
|
|
+ // Get gateway
|
|
|
+ fp = popen("ip route", "r");
|
|
|
+ if(fp == NULL)
|
|
|
+ result = FAIL;
|
|
|
+ else
|
|
|
+ {
|
|
|
+ while(fgets(buf, sizeof(buf), fp) != NULL)
|
|
|
+ {
|
|
|
+ if((strstr(buf, "default") != NULL) && (strstr(buf, "eth0") != NULL))
|
|
|
+ break;
|
|
|
+ }
|
|
|
+
|
|
|
+ if(strstr(buf, "default") != NULL)
|
|
|
+ {
|
|
|
+ sscanf(buf, "%*s%*s%s", tmp);
|
|
|
+ substr((char*)ShmSysConfigAndInfo->SysConfig.Eth0Interface.EthGatewayAddress, tmp, 0, strlen(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]);
|