|
@@ -2932,57 +2932,80 @@ char CheckUpdateProcess()
|
|
|
|
|
|
switch (Type)
|
|
|
{
|
|
|
- case 0x10000001:
|
|
|
- case 0x10000002:
|
|
|
- case 0x10000003:
|
|
|
- case 0x10000004:
|
|
|
- case 0x10000005:
|
|
|
+ case CSU_BOOTLOADER:
|
|
|
+ case CSU_KERNEL_CONFIGURATION:
|
|
|
+ case CSU_KERNEL_IMAGE:
|
|
|
+ case CSU_ROOT_FILE_SYSTEM:
|
|
|
+ case CSU_USER_CONFIGURATION:
|
|
|
{
|
|
|
- if (Upgrade_Flash(Type, new_str, ShmSysConfigAndInfo->SysConfig.ModelName) == PASS)
|
|
|
+ if (Upgrade_Flash(Type, new_str, (char *)ShmSysConfigAndInfo->SysConfig.ModelName) == PASS)
|
|
|
return PASS;
|
|
|
else
|
|
|
return FAIL;
|
|
|
}
|
|
|
- break;
|
|
|
- case 0x10000007:
|
|
|
- case 0x10000008:
|
|
|
- case 0x10000009:
|
|
|
- case 0x1000000A:
|
|
|
+ break;
|
|
|
+ case CCS_BOARD_BOOTLOADER:
|
|
|
+ case CCS_BOARD_KERNEL_CONFIGURATION:
|
|
|
+ case CCS_BOARD_KERNEL_IMAGE:
|
|
|
+ case CCS_BOARD_FILE_SYSTEM:
|
|
|
{
|
|
|
+ bool isPass = true;
|
|
|
+ int CanFd = InitCanBus();
|
|
|
|
|
|
+ if (CanFd > 0)
|
|
|
+ {
|
|
|
+ for(byte index = 0; index < ShmSysConfigAndInfo->SysConfig.TotalConnectorCount; index++)
|
|
|
+ {
|
|
|
+ if (!isPass)
|
|
|
+ break;
|
|
|
+
|
|
|
+ if (chargingInfo[index]->Type == _Type_CCS_2)
|
|
|
+ {
|
|
|
+ if (Upgrade_CCS(CanFd, Type, chargingInfo[index]->Evboard_id, new_str, (char *)ShmSysConfigAndInfo->SysConfig.ModelName) == FAIL)
|
|
|
+ {
|
|
|
+ isPass = false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ printf("Upgrade CCS open CAN FD fail.\n");
|
|
|
+ isPass = false;
|
|
|
+ }
|
|
|
+
|
|
|
+ return isPass;
|
|
|
}
|
|
|
break;
|
|
|
- case 0x10000006:
|
|
|
- case 0x1000000D:
|
|
|
- case 0x1000000E:
|
|
|
- case 0x20000002:
|
|
|
+ case CSU_PRIMARY_CONTROLLER:
|
|
|
+ case RELAY_CONTROL_BOARD:
|
|
|
+ case FAN_CONTROL_BOARD:
|
|
|
+ case AC_WALLMOUNT_CONTROLLER:
|
|
|
{
|
|
|
- // CSU_PRIMARY_CONTROLLER : 0x10000006
|
|
|
byte target = 0x00;
|
|
|
|
|
|
- if (Type == 0x10000006)
|
|
|
+ if (Type == CSU_PRIMARY_CONTROLLER)
|
|
|
target = UPGRADE_PRI;
|
|
|
- else if (Type == 0x1000000D)
|
|
|
+ else if (Type == RELAY_CONTROL_BOARD)
|
|
|
target = UPGRADE_RB;
|
|
|
- else if (Type == 0x1000000E)
|
|
|
+ else if (Type == FAN_CONTROL_BOARD)
|
|
|
target = UPGRADE_FAN;
|
|
|
- else if (Type == 0x20000002)
|
|
|
+ else if (Type == AC_WALLMOUNT_CONTROLLER)
|
|
|
target = UPGRADE_AC;
|
|
|
|
|
|
int fd = InitComPort(target);
|
|
|
|
|
|
- if (Upgrade_UART(fd, Type, target, new_str, ShmSysConfigAndInfo->SysConfig.ModelName) == PASS)
|
|
|
+ if (Upgrade_UART(fd, Type, target, new_str, (char *)ShmSysConfigAndInfo->SysConfig.ModelName) == PASS)
|
|
|
return PASS;
|
|
|
else
|
|
|
return FAIL;
|
|
|
|
|
|
close(fd);
|
|
|
}
|
|
|
- break;
|
|
|
- case 0x1000000B:
|
|
|
- case 0x1000000C:
|
|
|
+ break;
|
|
|
+ case CHAdeMO_BOARD:
|
|
|
+ case GB_BOARD:
|
|
|
{
|
|
|
- // CHAdeMO_BOARD : 0x1000000B, GBT : 0x1000000C
|
|
|
bool isPass = true;
|
|
|
int CanFd = InitCanBus();
|
|
|
|
|
@@ -2993,10 +3016,10 @@ char CheckUpdateProcess()
|
|
|
if (!isPass)
|
|
|
break;
|
|
|
|
|
|
- if ((Type == 0x1000000B && chargingInfo[index]->Type == _Type_Chademo) ||
|
|
|
- (Type == 0x1000000C && chargingInfo[index]->Type == _Type_GB))
|
|
|
+ if ((Type == CHAdeMO_BOARD && chargingInfo[index]->Type == _Type_Chademo) ||
|
|
|
+ (Type == GB_BOARD && chargingInfo[index]->Type == _Type_GB))
|
|
|
{
|
|
|
- if (Upgrade_CAN(CanFd, Type, chargingInfo[index]->Evboard_id, new_str, ShmSysConfigAndInfo->SysConfig.ModelName) == PASS)
|
|
|
+ if (Upgrade_CAN(CanFd, Type, chargingInfo[index]->Evboard_id, new_str, (char *)ShmSysConfigAndInfo->SysConfig.ModelName) == PASS)
|
|
|
return PASS;
|
|
|
else
|
|
|
return FAIL;
|