|
@@ -2810,75 +2810,149 @@ bool CheckConnectorTypeStatus()
|
|
|
ShmSysConfigAndInfo->SysConfig.TotalConnectorCount,
|
|
|
ShmSysConfigAndInfo->SysConfig.AcConnectorCount);
|
|
|
|
|
|
- if (ShmSysConfigAndInfo->SysConfig.TotalConnectorCount == 0 &&
|
|
|
- ShmSysConfigAndInfo->SysConfig.AcConnectorCount == 0)
|
|
|
- result = false;
|
|
|
-
|
|
|
- // 偵測槍屬於哪個 slot : 可知道插在板上的Slot 0 或 1 是 Chademo 還是 CCS
|
|
|
- for (byte gunIndex = 0; gunIndex < ShmSysConfigAndInfo->SysConfig.TotalConnectorCount; gunIndex++)
|
|
|
+ if (ShmSysConfigAndInfo->SysConfig.TotalConnectorCount == 0)
|
|
|
+ {
|
|
|
+ if(ShmSysConfigAndInfo->SysConfig.AcConnectorCount == 0)
|
|
|
+ {
|
|
|
+ result = false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else if (ShmSysConfigAndInfo->SysConfig.TotalConnectorCount == 1)
|
|
|
{
|
|
|
- if (gunIndex == 0 && bd0_1_status == 0 && bd0_2_status == 1)
|
|
|
+ bool SingleBoardDetected = true;
|
|
|
+
|
|
|
+ if (bd0_1_status == 0 && bd0_2_status == 1)
|
|
|
{
|
|
|
// 與硬體相同 type : Chademo
|
|
|
- if (chargingInfo[gunIndex]->Type == _Type_Chademo)
|
|
|
+ if (chargingInfo[0]->Type == _Type_Chademo)
|
|
|
{
|
|
|
- chargingInfo[gunIndex]->Evboard_id = 0x01;
|
|
|
+ chargingInfo[0]->Evboard_id = 0x01;
|
|
|
}
|
|
|
}
|
|
|
- else if (gunIndex == 0 && bd0_1_status == 1 && bd0_2_status == 0)
|
|
|
+ else if (bd0_1_status == 1 && bd0_2_status == 0)
|
|
|
{
|
|
|
- // 與硬體相同 type : CCS
|
|
|
- if (chargingInfo[gunIndex]->Type == _Type_CCS_2)
|
|
|
- {
|
|
|
- chargingInfo[gunIndex]->Evboard_id = 0x01;
|
|
|
- }
|
|
|
+ PRINTF_FUNC("For single connector EVSE, CCS board should not at slot 0\n");
|
|
|
+ result = false;
|
|
|
}
|
|
|
- else if (gunIndex == 0 && bd0_1_status == 1 && bd0_2_status == 1)
|
|
|
+ else if (bd0_1_status == 1 && bd0_2_status == 1)
|
|
|
{
|
|
|
// 與硬體相同 type : GB
|
|
|
- if (chargingInfo[gunIndex]->Type == _Type_GB)
|
|
|
+ if (chargingInfo[0]->Type == _Type_GB)
|
|
|
{
|
|
|
- chargingInfo[gunIndex]->Evboard_id = 0x01;
|
|
|
+ chargingInfo[0]->Evboard_id = 0x01;
|
|
|
}
|
|
|
}
|
|
|
+ else
|
|
|
+ {
|
|
|
+ SingleBoardDetected = false;
|
|
|
+ }
|
|
|
|
|
|
- if (gunIndex == 1 && bd1_1_status == 0 && bd1_2_status == 1)
|
|
|
+ if(SingleBoardDetected == true)
|
|
|
{
|
|
|
- // 與硬體相同 type : Chademo
|
|
|
- if (chargingInfo[gunIndex]->Type == _Type_Chademo)
|
|
|
+ if(!(bd1_1_status == 0 && bd1_2_status == 0))
|
|
|
{
|
|
|
- chargingInfo[gunIndex]->Evboard_id = 0x02;
|
|
|
+ PRINTF_FUNC("For single connector EVSE, it should not have two EV board\n");
|
|
|
+ result = false;
|
|
|
}
|
|
|
-
|
|
|
- if (ShmSysConfigAndInfo->SysConfig.TotalConnectorCount == 1)
|
|
|
- chargingInfo[gunIndex]->Evboard_id = 0x01;
|
|
|
}
|
|
|
- else if (gunIndex == 1 && bd1_1_status == 1 && bd1_2_status == 0)
|
|
|
+ else if(SingleBoardDetected == false)
|
|
|
{
|
|
|
- // 與硬體相同 type : CCS
|
|
|
- if (chargingInfo[gunIndex]->Type == _Type_CCS_2)
|
|
|
+ if (bd1_1_status == 0 && bd1_2_status == 1)
|
|
|
+ {
|
|
|
+ // 與硬體相同 type : Chademo
|
|
|
+ if (chargingInfo[0]->Type == _Type_Chademo)
|
|
|
+ {
|
|
|
+ chargingInfo[0]->Evboard_id = 0x01;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else if (bd1_1_status == 1 && bd1_2_status == 0)
|
|
|
+ {
|
|
|
+ // 與硬體相同 type : CCS
|
|
|
+ if (chargingInfo[0]->Type == _Type_CCS_2)
|
|
|
+ {
|
|
|
+ chargingInfo[0]->Evboard_id = 0x01;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else if (bd1_1_status == 1 && bd1_2_status == 1)
|
|
|
{
|
|
|
- chargingInfo[gunIndex]->Evboard_id = 0x02;
|
|
|
+ // 與硬體相同 type : GB
|
|
|
+ if (chargingInfo[0]->Type == _Type_GB)
|
|
|
+ {
|
|
|
+ chargingInfo[0]->Evboard_id = 0x01;
|
|
|
+ }
|
|
|
}
|
|
|
+ }
|
|
|
|
|
|
- if (ShmSysConfigAndInfo->SysConfig.TotalConnectorCount == 1)
|
|
|
- chargingInfo[gunIndex]->Evboard_id = 0x01;
|
|
|
+ PRINTF_FUNC("Single Connector EVSE, Type = %d, Evboard_id = %d \n", chargingInfo[0]->Type, chargingInfo[0]->Evboard_id);
|
|
|
+ if (chargingInfo[0]->Evboard_id == 0x00)
|
|
|
+ {
|
|
|
+ result = false;
|
|
|
}
|
|
|
- else if (gunIndex == 1 && bd1_1_status == 1 && bd1_2_status == 1)
|
|
|
+ }
|
|
|
+ else if(ShmSysConfigAndInfo->SysConfig.TotalConnectorCount == 2)
|
|
|
+ {
|
|
|
+ // 偵測槍屬於哪個 slot : 可知道插在板上的Slot 0 或 1 是 Chademo 還是 CCS
|
|
|
+ for (byte gunIndex = 0; gunIndex < ShmSysConfigAndInfo->SysConfig.TotalConnectorCount; gunIndex++)
|
|
|
{
|
|
|
- // 與硬體相同 type : GB
|
|
|
- if (chargingInfo[gunIndex]->Type == _Type_GB)
|
|
|
+ if (gunIndex == 0 && bd0_1_status == 0 && bd0_2_status == 1)
|
|
|
+ {
|
|
|
+ // 與硬體相同 type : Chademo
|
|
|
+ if (chargingInfo[gunIndex]->Type == _Type_Chademo)
|
|
|
+ {
|
|
|
+ chargingInfo[gunIndex]->Evboard_id = 0x01;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else if (gunIndex == 0 && bd0_1_status == 1 && bd0_2_status == 0)
|
|
|
+ {
|
|
|
+ // 與硬體相同 type : CCS
|
|
|
+ if (chargingInfo[gunIndex]->Type == _Type_CCS_2)
|
|
|
+ {
|
|
|
+ chargingInfo[gunIndex]->Evboard_id = 0x01;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else if (gunIndex == 0 && bd0_1_status == 1 && bd0_2_status == 1)
|
|
|
{
|
|
|
- chargingInfo[gunIndex]->Evboard_id = 0x02;
|
|
|
+ // 與硬體相同 type : GB
|
|
|
+ if (chargingInfo[gunIndex]->Type == _Type_GB)
|
|
|
+ {
|
|
|
+ chargingInfo[gunIndex]->Evboard_id = 0x01;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
- if (ShmSysConfigAndInfo->SysConfig.TotalConnectorCount == 1)
|
|
|
- chargingInfo[gunIndex]->Evboard_id = 0x01;
|
|
|
- }
|
|
|
+ if (gunIndex == 1 && bd1_1_status == 0 && bd1_2_status == 1)
|
|
|
+ {
|
|
|
+ // 與硬體相同 type : Chademo
|
|
|
+ if (chargingInfo[gunIndex]->Type == _Type_Chademo)
|
|
|
+ {
|
|
|
+ chargingInfo[gunIndex]->Evboard_id = 0x02;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else if (gunIndex == 1 && bd1_1_status == 1 && bd1_2_status == 0)
|
|
|
+ {
|
|
|
+ // 與硬體相同 type : CCS
|
|
|
+ if (chargingInfo[gunIndex]->Type == _Type_CCS_2)
|
|
|
+ {
|
|
|
+ chargingInfo[gunIndex]->Evboard_id = 0x02;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else if (gunIndex == 1 && bd1_1_status == 1 && bd1_2_status == 1)
|
|
|
+ {
|
|
|
+ // 與硬體相同 type : GB
|
|
|
+ if (chargingInfo[gunIndex]->Type == _Type_GB)
|
|
|
+ {
|
|
|
+ chargingInfo[gunIndex]->Evboard_id = 0x02;
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
- PRINTF_FUNC("index = %d, Type = %d, Evboard_id = %d \n", gunIndex, chargingInfo[gunIndex]->Type, chargingInfo[gunIndex]->Evboard_id);
|
|
|
- if (chargingInfo[gunIndex]->Evboard_id == 0x00)
|
|
|
- result = false;
|
|
|
+ PRINTF_FUNC("index = %d, Type = %d, Evboard_id = %d \n", gunIndex, chargingInfo[gunIndex]->Type, chargingInfo[gunIndex]->Evboard_id);
|
|
|
+ if (chargingInfo[gunIndex]->Evboard_id == 0x00)
|
|
|
+ result = false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ // Module Name 不正確 - 告警
|
|
|
+ result = false;
|
|
|
}
|
|
|
}
|
|
|
else
|