|
@@ -54,6 +54,7 @@ PaymentFailResponse ConnectorPaymentFailReason[GENERAL_GUN_QUANTITY];
|
|
char _ConnectorQRCode[GENERAL_GUN_QUANTITY][128];
|
|
char _ConnectorQRCode[GENERAL_GUN_QUANTITY][128];
|
|
StationInfoData _stationInfo[GENERAL_GUN_QUANTITY];
|
|
StationInfoData _stationInfo[GENERAL_GUN_QUANTITY];
|
|
DeductResultInfoData _deductResult[GENERAL_GUN_QUANTITY];
|
|
DeductResultInfoData _deductResult[GENERAL_GUN_QUANTITY];
|
|
|
|
+OccupancyResponse _OccupancyResponse[GENERAL_GUN_QUANTITY];
|
|
unsigned char _GunSystemStatus[GENERAL_GUN_QUANTITY];
|
|
unsigned char _GunSystemStatus[GENERAL_GUN_QUANTITY];
|
|
|
|
|
|
void ShowSocketData(struct PACKET_STRUCTURE *packet)
|
|
void ShowSocketData(struct PACKET_STRUCTURE *packet)
|
|
@@ -1136,7 +1137,7 @@ void ChargingCapabilityResponse(int socket, struct PACKET_STRUCTURE *packet)
|
|
ConnectorCapability[packet->Header.id - 1].CostDiscount != lDiscount)
|
|
ConnectorCapability[packet->Header.id - 1].CostDiscount != lDiscount)
|
|
{
|
|
{
|
|
LOG_INFO("Gun %d TxId: %d Account: %8.2f, Remain: %8.2f, Discount: %.2f [%s]",
|
|
LOG_INFO("Gun %d TxId: %d Account: %8.2f, Remain: %8.2f, Discount: %.2f [%s]",
|
|
- packet->Header.id, transaction, fBalance, fDiscount, fRemainAmount, ConnectorCapability[packet->Header.id - 1].CurrencyString);
|
|
|
|
|
|
+ packet->Header.id, transaction, fBalance, fRemainAmount, fDiscount, ConnectorCapability[packet->Header.id - 1].CurrencyString);
|
|
}
|
|
}
|
|
|
|
|
|
ConnectorCapability[packet->Header.id - 1].MaxOuputVoltage = voltage;
|
|
ConnectorCapability[packet->Header.id - 1].MaxOuputVoltage = voltage;
|
|
@@ -1389,6 +1390,7 @@ bool Is_DispenserForceChargingTriggerWebApi(int gun_index)
|
|
// LOG_INFO("Cabinet >> Connector %d User Price [Trigger]", packet->Header.id);
|
|
// LOG_INFO("Cabinet >> Connector %d User Price [Trigger]", packet->Header.id);
|
|
// LOG_INFO("Cabinet >> Connector %d Receipt URL [Trigger]", packet->Header.id);
|
|
// LOG_INFO("Cabinet >> Connector %d Receipt URL [Trigger]", packet->Header.id);
|
|
// LOG_INFO("Cabinet >> Connector %d ChargingBill [Trigger]", packet->Header.id);
|
|
// LOG_INFO("Cabinet >> Connector %d ChargingBill [Trigger]", packet->Header.id);
|
|
|
|
+// LOG_INFO("Cabinet >> Connector %d ParkingReq [Trigger]", packet->Header.id);
|
|
// LOG_INFO("Cabinet >> Dispenser %d PlugTimeout [%d]", dispenserIndex + 1, misc.Value);
|
|
// LOG_INFO("Cabinet >> Dispenser %d PlugTimeout [%d]", dispenserIndex + 1, misc.Value);
|
|
// LOG_INFO("Cabinet >> Dispenser %d DefaultPrice [%d]", dispenserIndex + 1, misc.Value);
|
|
// LOG_INFO("Cabinet >> Dispenser %d DefaultPrice [%d]", dispenserIndex + 1, misc.Value);
|
|
// LOG_INFO("Cabinet >> Dispenser %d Currency [%d]", dispenserIndex + 1, misc.Value);
|
|
// LOG_INFO("Cabinet >> Dispenser %d Currency [%d]", dispenserIndex + 1, misc.Value);
|
|
@@ -1413,11 +1415,16 @@ bool Is_DispenserForceChargingTriggerWebApi(int gun_index)
|
|
// LOG_INFO("Cabinet >> Dispenser %d Time Offset [+%d]", dispenserIndex + 1, misc.Value);
|
|
// LOG_INFO("Cabinet >> Dispenser %d Time Offset [+%d]", dispenserIndex + 1, misc.Value);
|
|
// LOG_INFO("Cabinet >> Dispenser %d Time Offset [%d]", dispenserIndex + 1, misc.Value);
|
|
// LOG_INFO("Cabinet >> Dispenser %d Time Offset [%d]", dispenserIndex + 1, misc.Value);
|
|
// LOG_INFO("Cabinet >> Dispenser %d DefaultPrice [Trigger]", dispenserIndex + 1);
|
|
// LOG_INFO("Cabinet >> Dispenser %d DefaultPrice [Trigger]", dispenserIndex + 1);
|
|
|
|
+// LOG_INFO("Cabinet >> Dispenser %d ParkingPrice [%d.%02d]", dispenserIndex + 1, (misc.Value / 100), (misc.Value % 100));
|
|
|
|
+// LOG_INFO("Cabinet >> Dispenser %d RFID Endian [%s]", dispenserIndex + 1, strRfidEndian[misc.Value]);
|
|
|
|
+// LOG_INFO("Cabinet >> Dispenser %d RFID Endian [%d]", dispenserIndex + 1, (misc.Value));
|
|
|
|
+// LOG_INFO("Cabinet >> Dispenser %d RFID Reader [%s]", dispenserIndex + 1, misc.Value ? "Enable" : "Disable");
|
|
void MiscCmdRes(int socket, struct PACKET_STRUCTURE *packet, unsigned char dispenserIndex, unsigned char result)
|
|
void MiscCmdRes(int socket, struct PACKET_STRUCTURE *packet, unsigned char dispenserIndex, unsigned char result)
|
|
{
|
|
{
|
|
char *strConnection[] = {STR_CONN_DISABLE, STR_CONN_CONNECTED, STR_CONN_DISCONNECTED};
|
|
char *strConnection[] = {STR_CONN_DISABLE, STR_CONN_CONNECTED, STR_CONN_DISCONNECTED};
|
|
char *strIntensity[] = {STR_DARKEST, STR_MEDIUM, STR_BRIGHTEST};
|
|
char *strIntensity[] = {STR_DARKEST, STR_MEDIUM, STR_BRIGHTEST};
|
|
char *strLcmPage[] = {STR_PAGE_NONE, STR_REMOTE_NO_ID};
|
|
char *strLcmPage[] = {STR_PAGE_NONE, STR_REMOTE_NO_ID};
|
|
|
|
+ char *strRfidEndian[] = {STR_LITTLE_ENDIAN, STR_BIG_ENDIAN};
|
|
struct PACKET_STRUCTURE sendBuffer;
|
|
struct PACKET_STRUCTURE sendBuffer;
|
|
|
|
|
|
memset(&sendBuffer, 0x00, sizeof(sendBuffer));
|
|
memset(&sendBuffer, 0x00, sizeof(sendBuffer));
|
|
@@ -1584,6 +1591,20 @@ void MiscCmdRes(int socket, struct PACKET_STRUCTURE *packet, unsigned char dispe
|
|
AddMiscCommand(&sendBuffer, &misc);
|
|
AddMiscCommand(&sendBuffer, &misc);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ if(Is_Connector_MiscCommand(packet->Header.id - 1, MISC_CONN_PARKING_STATUS))
|
|
|
|
+ {
|
|
|
|
+ Clean_Connector_MiscCommand(packet->Header.id - 1, MISC_CONN_PARKING_STATUS);
|
|
|
|
+ misc.Command = _MiscCmd_ParkingRequest;
|
|
|
|
+ misc.Value = true;
|
|
|
|
+
|
|
|
|
+ if(ShmChargerInfo->AllBill.OccupancyInfo[packet->Header.id - 1].ButtonReqStatus.MiscStatus == _BillStatus_WaitMiscClean)
|
|
|
|
+ {
|
|
|
|
+ ShmChargerInfo->AllBill.OccupancyInfo[packet->Header.id - 1].ButtonReqStatus.MiscStatus = _BillStatus_MiscClean;
|
|
|
|
+ }
|
|
|
|
+ LOG_INFO("Cabinet >> Connector %d ParkingReq [Trigger]", packet->Header.id);
|
|
|
|
+ AddMiscCommand(&sendBuffer, &misc);
|
|
|
|
+ }
|
|
|
|
+
|
|
// announce misc command to first connector of the dispenser
|
|
// announce misc command to first connector of the dispenser
|
|
if(ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[dispenserIndex].ConnectorID[0] == packet->Header.id)
|
|
if(ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[dispenserIndex].ConnectorID[0] == packet->Header.id)
|
|
{
|
|
{
|
|
@@ -1803,6 +1824,43 @@ void MiscCmdRes(int socket, struct PACKET_STRUCTURE *packet, unsigned char dispe
|
|
LOG_INFO("Cabinet >> Dispenser %d DefaultPrice [Trigger]", dispenserIndex + 1);
|
|
LOG_INFO("Cabinet >> Dispenser %d DefaultPrice [Trigger]", dispenserIndex + 1);
|
|
AddMiscCommand(&sendBuffer, &misc);
|
|
AddMiscCommand(&sendBuffer, &misc);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ if(Is_Dispenser_MiscCommand(dispenserIndex, MISC_DISP_PARKING_PRICE))
|
|
|
|
+ {
|
|
|
|
+ Clean_Dispenser_MiscCommand(dispenserIndex, MISC_DISP_PARKING_PRICE);
|
|
|
|
+ misc.Command = _MiscCmd_ParkingPrice;
|
|
|
|
+ misc.Value = (unsigned int)(ShmChargerInfo->CabinetMiscValue.ParkingPrice * 100);
|
|
|
|
+
|
|
|
|
+ LOG_INFO("Cabinet >> Dispenser %d ParkingPrice [%d.%02d]", dispenserIndex + 1, (misc.Value / 100), (misc.Value % 100));
|
|
|
|
+ AddMiscCommand(&sendBuffer, &misc);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if(Is_Dispenser_MiscCommand(dispenserIndex, MISC_DISP_RFID_CARD_ENDIAN))
|
|
|
|
+ {
|
|
|
|
+ Clean_Dispenser_MiscCommand(dispenserIndex, MISC_DISP_RFID_CARD_ENDIAN);
|
|
|
|
+ misc.Command = _MiscCmd_RFIDCardEndian;
|
|
|
|
+ misc.Value = ShmSysConfigAndInfo->SysConfig.RfidCardNumEndian;
|
|
|
|
+
|
|
|
|
+ if(misc.Value <= RFID_ENDIAN_BIG)
|
|
|
|
+ {
|
|
|
|
+ LOG_INFO("Cabinet >> Dispenser %d RFID Endian [%s]", dispenserIndex + 1, strRfidEndian[misc.Value]);
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ LOG_INFO("Cabinet >> Dispenser %d RFID Endian [%d]", dispenserIndex + 1, (misc.Value));
|
|
|
|
+ }
|
|
|
|
+ AddMiscCommand(&sendBuffer, &misc);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if(Is_Dispenser_MiscCommand(dispenserIndex, MISC_DISP_RFID_ENABLE))
|
|
|
|
+ {
|
|
|
|
+ Clean_Dispenser_MiscCommand(dispenserIndex, MISC_DISP_RFID_ENABLE);
|
|
|
|
+ misc.Command = _MiscCmd_RFIDEnable;
|
|
|
|
+ misc.Value = ShmSysConfigAndInfo->SysConfig.isRFID;
|
|
|
|
+
|
|
|
|
+ LOG_INFO("Cabinet >> Dispenser %d RFID Reader [%s]", dispenserIndex + 1, misc.Value ? "Enable" : "Disable");
|
|
|
|
+ AddMiscCommand(&sendBuffer, &misc);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
if(Is_Dispenser_MiscCommand(dispenserIndex, MISC_DISP_CHANGE_LCM_INFO))
|
|
if(Is_Dispenser_MiscCommand(dispenserIndex, MISC_DISP_CHANGE_LCM_INFO))
|
|
@@ -2561,6 +2619,112 @@ void ChargingBillResponse(int socket, struct PACKET_STRUCTURE *packet, unsigned
|
|
SendPacket(socket, &sendBuffer);
|
|
SendPacket(socket, &sendBuffer);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+void ParkingStatusResponse(int socket, struct PACKET_STRUCTURE *packet, unsigned char result)
|
|
|
|
+{
|
|
|
|
+ struct PACKET_STRUCTURE sendBuffer;
|
|
|
|
+
|
|
|
|
+ memset(&sendBuffer, 0x00, sizeof(sendBuffer));
|
|
|
|
+ sendBuffer.Header.se = packet->Header.se;
|
|
|
|
+ sendBuffer.Header.id = packet->Header.id;
|
|
|
|
+ sendBuffer.Header.op = _Header_Response;
|
|
|
|
+ sendBuffer.Header.len = 39;
|
|
|
|
+ sendBuffer.Payload.reg = _Reg_ParkingStatus;
|
|
|
|
+ sendBuffer.Payload.data[0] = result;
|
|
|
|
+
|
|
|
|
+ char *str_occupancy_status[] = {STR_NO_OCCUPANCY, STR_SYNC_OCCUPANCY, STR_OCCUPIED, STR_REQUEST_FEE, STR_WAIT_TO_PAY, STR_PAID_ONLINE_OK, STR_PAID_ONLINE_FAIL};
|
|
|
|
+
|
|
|
|
+ if(result == _R_OK)
|
|
|
|
+ {
|
|
|
|
+ // Parking Status
|
|
|
|
+ sendBuffer.Payload.data[1] = ShmChargerInfo->AllBill.OccupancyInfo[packet->Header.id - 1].Status;
|
|
|
|
+
|
|
|
|
+ // Occupancy SN
|
|
|
|
+ memcpy(&sendBuffer.Payload.data[2], &ShmChargerInfo->AllBill.OccupancyInfo[packet->Header.id - 1].OccupancyBill.Sn[0], sizeof(ShmChargerInfo->AllBill.OccupancyInfo[packet->Header.id - 1].OccupancyBill.Sn) - 1);
|
|
|
|
+
|
|
|
|
+ if(ShmChargerInfo->AllBill.OccupancyInfo[packet->Header.id - 1].ButtonReqStatus.MiscStatus == _BillStatus_MiscClean)
|
|
|
|
+ {
|
|
|
|
+ ShmChargerInfo->AllBill.OccupancyInfo[packet->Header.id - 1].ButtonReqStatus.MiscStatus = _BillStatus_UpdateDone;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if(ShmChargerInfo->AllBill.OccupancyInfo[packet->Header.id - 1].Status != _OccupancyResponse[packet->Header.id - 1].ParkingStatus ||
|
|
|
|
+ strcmp(ShmChargerInfo->AllBill.OccupancyInfo[packet->Header.id - 1].OccupancyBill.Sn, _OccupancyResponse[packet->Header.id - 1].OccupancySn) != EQUAL)
|
|
|
|
+ {
|
|
|
|
+ if(ShmChargerInfo->AllBill.OccupancyInfo[packet->Header.id - 1].Status == _Parking_NoOccupancy)
|
|
|
|
+ {
|
|
|
|
+ LOG_INFO("Gun %d ParkingStatus: [%s]",
|
|
|
|
+ packet->Header.id,
|
|
|
|
+ str_occupancy_status[ShmChargerInfo->AllBill.OccupancyInfo[packet->Header.id - 1].Status]);
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ LOG_INFO("Gun %d ParkingStatus: [%s], SN: [%s]",
|
|
|
|
+ packet->Header.id,
|
|
|
|
+ str_occupancy_status[ShmChargerInfo->AllBill.OccupancyInfo[packet->Header.id - 1].Status],
|
|
|
|
+ ShmChargerInfo->AllBill.OccupancyInfo[packet->Header.id - 1].OccupancyBill.Sn);
|
|
|
|
+ }
|
|
|
|
+ memcpy(_OccupancyResponse[packet->Header.id - 1].OccupancySn, ShmChargerInfo->AllBill.OccupancyInfo[packet->Header.id - 1].OccupancyBill.Sn, sizeof(ShmChargerInfo->AllBill.OccupancyInfo[packet->Header.id - 1].OccupancyBill.Sn));
|
|
|
|
+ _OccupancyResponse[packet->Header.id - 1].ParkingStatus = ShmChargerInfo->AllBill.OccupancyInfo[packet->Header.id - 1].Status;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if(ShmChargerInfo->AllBill.OccupancyInfo[packet->Header.id - 1].Status == _Parking_PaidOnlineOK)
|
|
|
|
+ {
|
|
|
|
+ ShmChargerInfo->AllBill.OccupancyInfo[packet->Header.id - 1].Status = _Parking_NoOccupancy;
|
|
|
|
+ }
|
|
|
|
+ else if(ShmChargerInfo->AllBill.OccupancyInfo[packet->Header.id - 1].Status == _Parking_PaidOnlineFail)
|
|
|
|
+ {
|
|
|
|
+ ShmChargerInfo->AllBill.OccupancyInfo[packet->Header.id - 1].Status = _Parking_Occupied;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ SendPacket(socket, &sendBuffer);
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+void ParkingBillResponse(int socket, struct PACKET_STRUCTURE *packet, unsigned char result)
|
|
|
|
+{
|
|
|
|
+ struct PACKET_STRUCTURE sendBuffer;
|
|
|
|
+
|
|
|
|
+ memset(&sendBuffer, 0x00, sizeof(sendBuffer));
|
|
|
|
+ sendBuffer.Header.se = packet->Header.se;
|
|
|
|
+ sendBuffer.Header.id = packet->Header.id;
|
|
|
|
+ sendBuffer.Header.op = _Header_Response;
|
|
|
|
+ sendBuffer.Header.len = 10 + 1;
|
|
|
|
+ sendBuffer.Payload.reg = _Reg_ParkingBill;
|
|
|
|
+ sendBuffer.Payload.data[0] = result;
|
|
|
|
+
|
|
|
|
+ int timeLen = 0;
|
|
|
|
+ unsigned int lFee = 0;
|
|
|
|
+
|
|
|
|
+ if(result == _R_OK)
|
|
|
|
+ {
|
|
|
|
+ // Parking fee
|
|
|
|
+ lFee = (int)(ShmChargerInfo->AllBill.OccupancyInfo[packet->Header.id - 1].OccupancyBill.Fee * 100);
|
|
|
|
+ sendBuffer.Payload.data[1] = ((lFee >> 24) & 0xFF);
|
|
|
|
+ sendBuffer.Payload.data[2] = ((lFee >> 16) & 0xFF);
|
|
|
|
+ sendBuffer.Payload.data[3] = ((lFee >> 8) & 0xFF);
|
|
|
|
+ sendBuffer.Payload.data[4] = (lFee & 0xFF);
|
|
|
|
+
|
|
|
|
+ // Parking duration
|
|
|
|
+ sendBuffer.Payload.data[5] = ((ShmChargerInfo->AllBill.OccupancyInfo[packet->Header.id - 1].OccupancyBill.Duration >> 24) & 0xFF);
|
|
|
|
+ sendBuffer.Payload.data[6] = ((ShmChargerInfo->AllBill.OccupancyInfo[packet->Header.id - 1].OccupancyBill.Duration >> 16) & 0xFF);
|
|
|
|
+ sendBuffer.Payload.data[7] = ((ShmChargerInfo->AllBill.OccupancyInfo[packet->Header.id - 1].OccupancyBill.Duration >> 8) & 0xFF);
|
|
|
|
+ sendBuffer.Payload.data[8] = (ShmChargerInfo->AllBill.OccupancyInfo[packet->Header.id - 1].OccupancyBill.Duration & 0xFF);
|
|
|
|
+
|
|
|
|
+ // Parking startTime
|
|
|
|
+ timeLen = strlen(ShmChargerInfo->AllBill.OccupancyInfo[packet->Header.id - 1].OccupancyBill.StartTime);
|
|
|
|
+ memcpy(&sendBuffer.Payload.data[9], ShmChargerInfo->AllBill.OccupancyInfo[packet->Header.id - 1].OccupancyBill.StartTime, timeLen);
|
|
|
|
+ sendBuffer.Payload.data[9 + timeLen] = 0;
|
|
|
|
+ sendBuffer.Header.len += timeLen;
|
|
|
|
+
|
|
|
|
+ LOG_INFO("Gun %d ParkingFee: [%d.%02d], StartTime: [%s], Duration: [%d]",
|
|
|
|
+ packet->Header.id,
|
|
|
|
+ (lFee / 100), (lFee % 100),
|
|
|
|
+ ShmChargerInfo->AllBill.OccupancyInfo[packet->Header.id - 1].OccupancyBill.StartTime,
|
|
|
|
+ ShmChargerInfo->AllBill.OccupancyInfo[packet->Header.id - 1].OccupancyBill.Duration);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ SendPacket(socket, &sendBuffer);
|
|
|
|
+}
|
|
|
|
+
|
|
BOOL FindConnectorID(unsigned char dispenserIndex, unsigned char id)
|
|
BOOL FindConnectorID(unsigned char dispenserIndex, unsigned char id)
|
|
{
|
|
{
|
|
BOOL find = false;
|
|
BOOL find = false;
|
|
@@ -2596,15 +2760,15 @@ void ConnectorPhysicalLimitBindingHandler(unsigned char connectorIndex, unsigned
|
|
break;
|
|
break;
|
|
|
|
|
|
case 'S':
|
|
case 'S':
|
|
- ShmSysConfigAndInfo->SysInfo.ConnectorInfo[connectorIndex].RemoteMaxPhysicalVoltage = CHA_MAX_PHYSICAL_VOLTAGE;
|
|
|
|
- ShmSysConfigAndInfo->SysInfo.ConnectorInfo[connectorIndex].RemoteMaxPhysicalCurrent = CHA_NATURAL_S_MAX_CURRENT;
|
|
|
|
- // Boost Mode
|
|
|
|
//ShmSysConfigAndInfo->SysInfo.ConnectorInfo[connectorIndex].RemoteMaxPhysicalVoltage = CHA_MAX_PHYSICAL_VOLTAGE;
|
|
//ShmSysConfigAndInfo->SysInfo.ConnectorInfo[connectorIndex].RemoteMaxPhysicalVoltage = CHA_MAX_PHYSICAL_VOLTAGE;
|
|
- //ShmSysConfigAndInfo->SysInfo.ConnectorInfo[connectorIndex].RemoteMaxPhysicalCurrent = CHA_NATURAL_S_BOOST_CURRENT;
|
|
|
|
- //ShmSysConfigAndInfo->SysInfo.ConnectorInfo[connectorIndex].GeneralChargingData.deratingByConnOtp.isNeedDerating = YES;
|
|
|
|
- //ShmSysConfigAndInfo->SysInfo.ConnectorInfo[connectorIndex].GeneralChargingData.deratingByConnOtp.deratingIndex = 0;
|
|
|
|
- //ShmSysConfigAndInfo->SysInfo.ConnectorInfo[connectorIndex].GeneralChargingData.deratingByConnOtp.deratingTargetCurrent[0] = CHA_NATURAL_S_BOOST_CURRENT;
|
|
|
|
- //ShmSysConfigAndInfo->SysInfo.ConnectorInfo[connectorIndex].GeneralChargingData.deratingByConnOtp.deratingTargetCurrent[1] = CHA_NATURAL_S_MAX_CURRENT;
|
|
|
|
|
|
+ //ShmSysConfigAndInfo->SysInfo.ConnectorInfo[connectorIndex].RemoteMaxPhysicalCurrent = CHA_NATURAL_S_MAX_CURRENT;
|
|
|
|
+ // Boost Mode
|
|
|
|
+ ShmSysConfigAndInfo->SysInfo.ConnectorInfo[connectorIndex].RemoteMaxPhysicalVoltage = CHA_MAX_PHYSICAL_VOLTAGE;
|
|
|
|
+ ShmSysConfigAndInfo->SysInfo.ConnectorInfo[connectorIndex].RemoteMaxPhysicalCurrent = CHA_NATURAL_S_BOOST_CURRENT;
|
|
|
|
+ ShmSysConfigAndInfo->SysInfo.ConnectorInfo[connectorIndex].GeneralChargingData.deratingByConnOtp.isNeedDerating = YES;
|
|
|
|
+ ShmSysConfigAndInfo->SysInfo.ConnectorInfo[connectorIndex].GeneralChargingData.deratingByConnOtp.deratingIndex = 0;
|
|
|
|
+ ShmSysConfigAndInfo->SysInfo.ConnectorInfo[connectorIndex].GeneralChargingData.deratingByConnOtp.deratingTargetCurrent[0] = CHA_NATURAL_S_BOOST_CURRENT;
|
|
|
|
+ ShmSysConfigAndInfo->SysInfo.ConnectorInfo[connectorIndex].GeneralChargingData.deratingByConnOtp.deratingTargetCurrent[1] = CHA_NATURAL_S_MAX_CURRENT;
|
|
break;
|
|
break;
|
|
|
|
|
|
case 'K':
|
|
case 'K':
|
|
@@ -2637,14 +2801,14 @@ void ConnectorPhysicalLimitBindingHandler(unsigned char connectorIndex, unsigned
|
|
case 'V':
|
|
case 'V':
|
|
case 'F':
|
|
case 'F':
|
|
//case 'R': // 20210817 remove type "R"
|
|
//case 'R': // 20210817 remove type "R"
|
|
- ShmSysConfigAndInfo->SysInfo.ConnectorInfo[connectorIndex].RemoteMaxPhysicalVoltage = CCS_MAX_PHYSICAL_VOLTAGE;
|
|
|
|
- ShmSysConfigAndInfo->SysInfo.ConnectorInfo[connectorIndex].RemoteMaxPhysicalCurrent = CCS_LIQUID_V_F_MAX_CURRENT;
|
|
|
|
|
|
+ //ShmSysConfigAndInfo->SysInfo.ConnectorInfo[connectorIndex].RemoteMaxPhysicalVoltage = CCS_MAX_PHYSICAL_VOLTAGE;
|
|
|
|
+ //ShmSysConfigAndInfo->SysInfo.ConnectorInfo[connectorIndex].RemoteMaxPhysicalCurrent = CCS_LIQUID_V_F_MAX_CURRENT;
|
|
// Derating Mode
|
|
// Derating Mode
|
|
- //ShmSysConfigAndInfo->SysInfo.ConnectorInfo[connectorIndex].GeneralChargingData.deratingByConnOtp.isNeedDerating = YES;
|
|
|
|
- //ShmSysConfigAndInfo->SysInfo.ConnectorInfo[connectorIndex].GeneralChargingData.deratingByConnOtp.deratingIndex = 0;
|
|
|
|
- //ShmSysConfigAndInfo->SysInfo.ConnectorInfo[connectorIndex].GeneralChargingData.deratingByConnOtp.deratingTargetCurrent[0] = CCS_LIQUID_V_F_MAX_CURRENT;
|
|
|
|
- //ShmSysConfigAndInfo->SysInfo.ConnectorInfo[connectorIndex].GeneralChargingData.deratingByConnOtp.deratingTargetCurrent[1] = CCS_LIQUID_80_DERATING_1_CUR;
|
|
|
|
- //ShmSysConfigAndInfo->SysInfo.ConnectorInfo[connectorIndex].GeneralChargingData.deratingByConnOtp.deratingTargetCurrent[2] = CCS_LIQUID_85_DERATING_2_CUR;
|
|
|
|
|
|
+ ShmSysConfigAndInfo->SysInfo.ConnectorInfo[connectorIndex].GeneralChargingData.deratingByConnOtp.isNeedDerating = YES;
|
|
|
|
+ ShmSysConfigAndInfo->SysInfo.ConnectorInfo[connectorIndex].GeneralChargingData.deratingByConnOtp.deratingIndex = 0;
|
|
|
|
+ ShmSysConfigAndInfo->SysInfo.ConnectorInfo[connectorIndex].GeneralChargingData.deratingByConnOtp.deratingTargetCurrent[0] = CCS_LIQUID_V_F_MAX_CURRENT;
|
|
|
|
+ ShmSysConfigAndInfo->SysInfo.ConnectorInfo[connectorIndex].GeneralChargingData.deratingByConnOtp.deratingTargetCurrent[1] = CCS_LIQUID_80_DERATING_1_CUR;
|
|
|
|
+ ShmSysConfigAndInfo->SysInfo.ConnectorInfo[connectorIndex].GeneralChargingData.deratingByConnOtp.deratingTargetCurrent[2] = CCS_LIQUID_85_DERATING_2_CUR;
|
|
break;
|
|
break;
|
|
|
|
|
|
case 'P':
|
|
case 'P':
|
|
@@ -2656,14 +2820,28 @@ void ConnectorPhysicalLimitBindingHandler(unsigned char connectorIndex, unsigned
|
|
case 'D':
|
|
case 'D':
|
|
ShmSysConfigAndInfo->SysInfo.ConnectorInfo[connectorIndex].RemoteMaxPhysicalVoltage = CCS_MAX_PHYSICAL_VOLTAGE;
|
|
ShmSysConfigAndInfo->SysInfo.ConnectorInfo[connectorIndex].RemoteMaxPhysicalVoltage = CCS_MAX_PHYSICAL_VOLTAGE;
|
|
ShmSysConfigAndInfo->SysInfo.ConnectorInfo[connectorIndex].RemoteMaxPhysicalCurrent = CCS_NATURAL_T_D_MAX_CURRENT;
|
|
ShmSysConfigAndInfo->SysInfo.ConnectorInfo[connectorIndex].RemoteMaxPhysicalCurrent = CCS_NATURAL_T_D_MAX_CURRENT;
|
|
|
|
+ break;
|
|
|
|
+
|
|
|
|
+ case 'I':
|
|
|
|
+ case 'Q':
|
|
// Boost Mode
|
|
// Boost Mode
|
|
- //ShmSysConfigAndInfo->SysInfo.ConnectorInfo[connectorIndex].RemoteMaxPhysicalVoltage = CCS_MAX_PHYSICAL_VOLTAGE;
|
|
|
|
- //ShmSysConfigAndInfo->SysInfo.ConnectorInfo[connectorIndex].RemoteMaxPhysicalCurrent = CCS_NATURAL_T_D_BOOST_CURRENT;
|
|
|
|
- //ShmSysConfigAndInfo->SysInfo.ConnectorInfo[connectorIndex].GeneralChargingData.deratingByConnOtp.isNeedDerating = YES;
|
|
|
|
- //ShmSysConfigAndInfo->SysInfo.ConnectorInfo[connectorIndex].GeneralChargingData.deratingByConnOtp.deratingIndex = 0;
|
|
|
|
- //ShmSysConfigAndInfo->SysInfo.ConnectorInfo[connectorIndex].GeneralChargingData.deratingByConnOtp.deratingTargetCurrent[0] = CCS_NATURAL_T_D_BOOST_CURRENT;
|
|
|
|
- //ShmSysConfigAndInfo->SysInfo.ConnectorInfo[connectorIndex].GeneralChargingData.deratingByConnOtp.deratingTargetCurrent[1] = CCS_NATURAL_T_D_MAX_CURRENT;
|
|
|
|
- //ShmSysConfigAndInfo->SysInfo.ConnectorInfo[connectorIndex].GeneralChargingData.deratingByConnOtp.deratingTargetCurrent[2] = CCS_NATURAL_T_D_85_DERATING_CUR;
|
|
|
|
|
|
+ ShmSysConfigAndInfo->SysInfo.ConnectorInfo[connectorIndex].RemoteMaxPhysicalVoltage = CCS_MAX_PHYSICAL_VOLTAGE;
|
|
|
|
+ ShmSysConfigAndInfo->SysInfo.ConnectorInfo[connectorIndex].RemoteMaxPhysicalCurrent = CCS_NATURAL_I_Q_BOOST_CURRENT;
|
|
|
|
+ ShmSysConfigAndInfo->SysInfo.ConnectorInfo[connectorIndex].GeneralChargingData.deratingByConnOtp.isNeedDerating = YES;
|
|
|
|
+ ShmSysConfigAndInfo->SysInfo.ConnectorInfo[connectorIndex].GeneralChargingData.deratingByConnOtp.deratingIndex = 0;
|
|
|
|
+ ShmSysConfigAndInfo->SysInfo.ConnectorInfo[connectorIndex].GeneralChargingData.deratingByConnOtp.deratingTargetCurrent[0] = CCS_NATURAL_I_Q_BOOST_CURRENT;
|
|
|
|
+ ShmSysConfigAndInfo->SysInfo.ConnectorInfo[connectorIndex].GeneralChargingData.deratingByConnOtp.deratingTargetCurrent[1] = CCS_NATURAL_I_Q_MAX_CURRENT;
|
|
|
|
+ ShmSysConfigAndInfo->SysInfo.ConnectorInfo[connectorIndex].GeneralChargingData.deratingByConnOtp.deratingTargetCurrent[2] = CCS_NATURAL_I_Q_85_DERATING_CUR;
|
|
|
|
+ break;
|
|
|
|
+
|
|
|
|
+ case 'O':
|
|
|
|
+ // Boost Mode
|
|
|
|
+ ShmSysConfigAndInfo->SysInfo.ConnectorInfo[connectorIndex].RemoteMaxPhysicalVoltage = CHA_MAX_PHYSICAL_VOLTAGE;
|
|
|
|
+ ShmSysConfigAndInfo->SysInfo.ConnectorInfo[connectorIndex].RemoteMaxPhysicalCurrent = CHA_NATURAL_O_BOOST_CURRENT;
|
|
|
|
+ ShmSysConfigAndInfo->SysInfo.ConnectorInfo[connectorIndex].GeneralChargingData.deratingByConnOtp.isNeedDerating = YES;
|
|
|
|
+ ShmSysConfigAndInfo->SysInfo.ConnectorInfo[connectorIndex].GeneralChargingData.deratingByConnOtp.deratingIndex = 0;
|
|
|
|
+ ShmSysConfigAndInfo->SysInfo.ConnectorInfo[connectorIndex].GeneralChargingData.deratingByConnOtp.deratingTargetCurrent[0] = CHA_NATURAL_O_BOOST_CURRENT;
|
|
|
|
+ ShmSysConfigAndInfo->SysInfo.ConnectorInfo[connectorIndex].GeneralChargingData.deratingByConnOtp.deratingTargetCurrent[1] = CHA_NATURAL_O_MAX_CURRENT;
|
|
break;
|
|
break;
|
|
|
|
|
|
default:
|
|
default:
|
|
@@ -3385,6 +3563,7 @@ unsigned char ChargingPermissionHandler(struct PACKET_STRUCTURE *packet, unsigne
|
|
break;
|
|
break;
|
|
|
|
|
|
case S_PREPARING_FOR_EV:
|
|
case S_PREPARING_FOR_EV:
|
|
|
|
+#if 0
|
|
if(chargingInfo[packet->Header.id - 1]->ChargingStopFlag.bits.RemoteStop ||
|
|
if(chargingInfo[packet->Header.id - 1]->ChargingStopFlag.bits.RemoteStop ||
|
|
chargingInfo[packet->Header.id - 1]->ChargingStopFlag.bits.UnlockStop)
|
|
chargingInfo[packet->Header.id - 1]->ChargingStopFlag.bits.UnlockStop)
|
|
{
|
|
{
|
|
@@ -3394,7 +3573,8 @@ unsigned char ChargingPermissionHandler(struct PACKET_STRUCTURE *packet, unsigne
|
|
LOG_INFO("RemoteStop or UnlockStop, not allow dispenser index %d connector id %d preparing to charge", dispenserIndex, packet->Header.id);
|
|
LOG_INFO("RemoteStop or UnlockStop, not allow dispenser index %d connector id %d preparing to charge", dispenserIndex, packet->Header.id);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- else if(ShmSysConfigAndInfo->SysInfo.ConnectorInfo[packet->Header.id - 1].RemoteStatus >= _CRS_Preparing &&
|
|
|
|
|
|
+#endif
|
|
|
|
+ if(ShmSysConfigAndInfo->SysInfo.ConnectorInfo[packet->Header.id - 1].RemoteStatus >= _CRS_Preparing &&
|
|
ShmSysConfigAndInfo->SysInfo.ConnectorInfo[packet->Header.id - 1].RemoteStatus <= _CRS_Charging)
|
|
ShmSysConfigAndInfo->SysInfo.ConnectorInfo[packet->Header.id - 1].RemoteStatus <= _CRS_Charging)
|
|
{
|
|
{
|
|
if(!ShmSysConfigAndInfo->SysInfo.ConnectorInfo[packet->Header.id - 1].Parameter.bits.PermissionRequest)
|
|
if(!ShmSysConfigAndInfo->SysInfo.ConnectorInfo[packet->Header.id - 1].Parameter.bits.PermissionRequest)
|
|
@@ -3420,6 +3600,7 @@ unsigned char ChargingPermissionHandler(struct PACKET_STRUCTURE *packet, unsigne
|
|
break;
|
|
break;
|
|
|
|
|
|
case S_CHARGING:
|
|
case S_CHARGING:
|
|
|
|
+#if 0
|
|
if(chargingInfo[packet->Header.id - 1]->ChargingStopFlag.bits.RemoteStop ||
|
|
if(chargingInfo[packet->Header.id - 1]->ChargingStopFlag.bits.RemoteStop ||
|
|
chargingInfo[packet->Header.id - 1]->ChargingStopFlag.bits.UnlockStop)
|
|
chargingInfo[packet->Header.id - 1]->ChargingStopFlag.bits.UnlockStop)
|
|
{
|
|
{
|
|
@@ -3429,7 +3610,8 @@ unsigned char ChargingPermissionHandler(struct PACKET_STRUCTURE *packet, unsigne
|
|
LOG_INFO("RemoteStop or UnlockStop, not allow dispenser index %d connector id %d charging", dispenserIndex, packet->Header.id);
|
|
LOG_INFO("RemoteStop or UnlockStop, not allow dispenser index %d connector id %d charging", dispenserIndex, packet->Header.id);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- else if(ShmSysConfigAndInfo->SysInfo.ConnectorInfo[packet->Header.id - 1].RemoteStatus == _CRS_Preparing ||
|
|
|
|
|
|
+#endif
|
|
|
|
+ if(ShmSysConfigAndInfo->SysInfo.ConnectorInfo[packet->Header.id - 1].RemoteStatus == _CRS_Preparing ||
|
|
ShmSysConfigAndInfo->SysInfo.ConnectorInfo[packet->Header.id - 1].RemoteStatus == _CRS_Charging)
|
|
ShmSysConfigAndInfo->SysInfo.ConnectorInfo[packet->Header.id - 1].RemoteStatus == _CRS_Charging)
|
|
{
|
|
{
|
|
permission = _DAS_Allowed;
|
|
permission = _DAS_Allowed;
|
|
@@ -3625,9 +3807,11 @@ unsigned char DispenserWriteChargingInfoHandler(struct PACKET_STRUCTURE *packet,
|
|
|
|
|
|
if(diffVoltage > 10 || diffCurrent > 10 || ShmSysConfigAndInfo->SysInfo.ConnectorInfo[gun].RemoteSoc != soc)
|
|
if(diffVoltage > 10 || diffCurrent > 10 || ShmSysConfigAndInfo->SysInfo.ConnectorInfo[gun].RemoteSoc != soc)
|
|
{
|
|
{
|
|
|
|
+ int _connectorTemp = (int)chargingInfo[gun]->ConnectorTemp - 60;
|
|
|
|
+ int _chillerTemp = (int)chargingInfo[gun]->ChillerTemp - 60;
|
|
|
|
+
|
|
LOG_INFO("Connector %d Charging Info: Voltage: %4d.%d V, Current: %3d.%d A, Soc: %3d, Temp: %3d, Chiller: %3d",
|
|
LOG_INFO("Connector %d Charging Info: Voltage: %4d.%d V, Current: %3d.%d A, Soc: %3d, Temp: %3d, Chiller: %3d",
|
|
- packet->Header.id, (voltage / 10), (voltage % 10), (current / 10), (current % 10), soc,
|
|
|
|
- chargingInfo[gun]->ConnectorTemp - 60, chargingInfo[gun]->ChillerTemp - 60);
|
|
|
|
|
|
+ packet->Header.id, (voltage / 10), (voltage % 10), (current / 10), (current % 10), soc, _connectorTemp, _chillerTemp);
|
|
}
|
|
}
|
|
|
|
|
|
ShmSysConfigAndInfo->SysInfo.ConnectorInfo[gun].RemoteChargingVoltage = voltage;
|
|
ShmSysConfigAndInfo->SysInfo.ConnectorInfo[gun].RemoteChargingVoltage = voltage;
|
|
@@ -3817,6 +4001,24 @@ unsigned char DispenserReqHandler(struct PACKET_STRUCTURE *packet, int dispenser
|
|
}
|
|
}
|
|
break;
|
|
break;
|
|
|
|
|
|
|
|
+ case _DisReq_ParkingFee:
|
|
|
|
+ if(connector_req.Value == YES)
|
|
|
|
+ {
|
|
|
|
+ if(ShmChargerInfo->AllBill.OccupancyInfo[gun].Status == _Parking_Occupied)
|
|
|
|
+ {
|
|
|
|
+ if(!ShmChargerInfo->ConnectorActReq[gun].Flag.bits.ParkingFeeRequest)
|
|
|
|
+ {
|
|
|
|
+ LOG_INFO("Gun %d ParkingFee Request", gun + 1);
|
|
|
|
+ }
|
|
|
|
+ ShmChargerInfo->ConnectorActReq[gun].Flag.bits.ParkingFeeRequest = true;
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ LOG_INFO("Gun %d ParkingFee Request, but ParkingStatus is not Occupied", gun + 1);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ break;
|
|
|
|
+
|
|
default:
|
|
default:
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
@@ -3935,12 +4137,14 @@ unsigned char WriteDeductResultHandler(struct PACKET_STRUCTURE *packet, int disp
|
|
char appNo[10];
|
|
char appNo[10];
|
|
char vemData[65];
|
|
char vemData[65];
|
|
char cardNo[21];
|
|
char cardNo[21];
|
|
|
|
+ char occupancy_sn[37];
|
|
|
|
|
|
- char *str_ReaderStatus[] = {STR_DEDUCT_FAIL, STR_DEDUCT_PASS, STR_DEDUCT_CANCEL, STR_DEDUCT_PREAUTH};
|
|
|
|
|
|
+ char *str_ReaderStatus[] = {STR_DEDUCT_FAIL, STR_DEDUCT_PASS, STR_DEDUCT_CANCEL, STR_DEDUCT_PREAUTH, STR_SALE_FAIL, STR_SALE_PASS};
|
|
|
|
|
|
memset(appNo, 0x00, sizeof(appNo));
|
|
memset(appNo, 0x00, sizeof(appNo));
|
|
memset(vemData, 0x00, sizeof(vemData));
|
|
memset(vemData, 0x00, sizeof(vemData));
|
|
memset(cardNo, 0x00, sizeof(cardNo));
|
|
memset(cardNo, 0x00, sizeof(cardNo));
|
|
|
|
+ memset(occupancy_sn, 0x00, sizeof(occupancy_sn));
|
|
|
|
|
|
if(find || packet->Header.id == AUTO_GUN_SELECTION_ID)
|
|
if(find || packet->Header.id == AUTO_GUN_SELECTION_ID)
|
|
{
|
|
{
|
|
@@ -3972,8 +4176,13 @@ unsigned char WriteDeductResultHandler(struct PACKET_STRUCTURE *packet, int disp
|
|
memcpy(deduct.creditNo, (char *)&packet->Payload.data[83], sizeof(deduct.creditNo));
|
|
memcpy(deduct.creditNo, (char *)&packet->Payload.data[83], sizeof(deduct.creditNo));
|
|
memcpy(cardNo, deduct.creditNo, sizeof(deduct.creditNo));
|
|
memcpy(cardNo, deduct.creditNo, sizeof(deduct.creditNo));
|
|
}
|
|
}
|
|
|
|
+ if(packet->Header.len >= 140)
|
|
|
|
+ {
|
|
|
|
+ memcpy(deduct.Sn, (char *)&packet->Payload.data[103], sizeof(deduct.Sn));
|
|
|
|
+ memcpy(occupancy_sn, deduct.Sn, sizeof(deduct.Sn));
|
|
|
|
+ }
|
|
|
|
|
|
- if(deduct.DeductResult == _Deduct_Fail || deduct.DeductResult == _Deduct_Pass)
|
|
|
|
|
|
+ if(deduct.DeductResult == _Deduct_PreAuth_Fail || deduct.DeductResult == _Deduct_PreAuth_Pass)
|
|
{
|
|
{
|
|
if(packet->Header.id != AUTO_GUN_SELECTION_ID)
|
|
if(packet->Header.id != AUTO_GUN_SELECTION_ID)
|
|
{
|
|
{
|
|
@@ -4021,7 +4230,7 @@ unsigned char WriteDeductResultHandler(struct PACKET_STRUCTURE *packet, int disp
|
|
return done;
|
|
return done;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- else if(deduct.DeductResult == _Deduct_Cancel || deduct.DeductResult == _Deduct_PreAuth)
|
|
|
|
|
|
+ else if(deduct.DeductResult == _Deduct_PreAuth_Cancel || deduct.DeductResult == _Deduct_PreAuth)
|
|
{
|
|
{
|
|
if(packet->Header.id != AUTO_GUN_SELECTION_ID)
|
|
if(packet->Header.id != AUTO_GUN_SELECTION_ID)
|
|
{
|
|
{
|
|
@@ -4045,6 +4254,34 @@ unsigned char WriteDeductResultHandler(struct PACKET_STRUCTURE *packet, int disp
|
|
find = true;
|
|
find = true;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ else if(deduct.DeductResult == _Deduct_Sale_Pass)
|
|
|
|
+ {
|
|
|
|
+ if(packet->Header.id != AUTO_GUN_SELECTION_ID)
|
|
|
|
+ {
|
|
|
|
+ if(!ShmChargerInfo->AllBill.OccupancyInfo[gun].OccupancyReq.bits.DeductReq)
|
|
|
|
+ {
|
|
|
|
+ memset(&ShmChargerInfo->AllBill.OccupancyInfo[gun].OccupancyDeduct, 0x00, sizeof(OccupancyDeductInfo));
|
|
|
|
+
|
|
|
|
+ ShmChargerInfo->AllBill.OccupancyInfo[gun].OccupancyReq.bits.DeductReq = true;
|
|
|
|
+ ShmChargerInfo->AllBill.OccupancyInfo[gun].OccupancyDeduct.Fee = ((float)deduct.DeductAmount / 100);
|
|
|
|
+ memcpy(&ShmChargerInfo->AllBill.OccupancyInfo[gun].OccupancyDeduct.Sn[0], &deduct.Sn[0], sizeof(deduct.Sn));
|
|
|
|
+ memcpy(&ShmChargerInfo->AllBill.OccupancyInfo[gun].OccupancyDeduct.creditNo[0], &deduct.creditNo[0], sizeof(deduct.creditNo));
|
|
|
|
+ memcpy(&ShmChargerInfo->AllBill.OccupancyInfo[gun].OccupancyDeduct.ApprovalNumber[0], &deduct.ApprovalNumber[0], sizeof(deduct.ApprovalNumber));
|
|
|
|
+ done = true;
|
|
|
|
+ }
|
|
|
|
+ LOG_INFO("Gun %d OccupancyDeduct, SN: [%s] [%s] %s",
|
|
|
|
+ gun + 1,
|
|
|
|
+ occupancy_sn,
|
|
|
|
+ str_ReaderStatus[deduct.DeductResult],
|
|
|
|
+ done ? "Done" : "Wait");
|
|
|
|
+ LOG_INFO("Gun %d OccupancyDeduct, Fee: [%d.%02d], Card: [%s], ApprovalNo: [%s]",
|
|
|
|
+ gun + 1,
|
|
|
|
+ (deduct.DeductAmount / 100), (deduct.DeductAmount % 100),
|
|
|
|
+ cardNo,
|
|
|
|
+ appNo);
|
|
|
|
+ return done;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
else
|
|
else
|
|
{
|
|
{
|
|
find = true;
|
|
find = true;
|
|
@@ -4128,6 +4365,24 @@ unsigned char ReadChargingBillHandler(struct PACKET_STRUCTURE *packet, int dispe
|
|
return find;
|
|
return find;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+unsigned char ReadParkingStatusHandler(struct PACKET_STRUCTURE *packet, int dispenserIndex)
|
|
|
|
+{
|
|
|
|
+ BOOL find = FindConnectorID(dispenserIndex, packet->Header.id);
|
|
|
|
+
|
|
|
|
+ return find;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+unsigned char ReadParkingBillHandler(struct PACKET_STRUCTURE *packet, int dispenserIndex)
|
|
|
|
+{
|
|
|
|
+ BOOL find = FindConnectorID(dispenserIndex, packet->Header.id);
|
|
|
|
+
|
|
|
|
+ if(ShmChargerInfo->AllBill.OccupancyInfo[packet->Header.id - 1].Status == _Parking_WaitToPay && find)
|
|
|
|
+ {
|
|
|
|
+ return true;
|
|
|
|
+ }
|
|
|
|
+ return false;
|
|
|
|
+}
|
|
|
|
+
|
|
void DisableConnector(unsigned char dispenserIndex)
|
|
void DisableConnector(unsigned char dispenserIndex)
|
|
{
|
|
{
|
|
for(int i = 0; i < ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[dispenserIndex].ConnectorQuantity; i++)
|
|
for(int i = 0; i < ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[dispenserIndex].ConnectorQuantity; i++)
|
|
@@ -4247,6 +4502,7 @@ void DispenserSocketProcess(int socketFd, struct sockaddr_in clientInfo, unsigne
|
|
Set_Dispenser_MiscCommand(dispenserIndex, MISC_DISP_AUTH_MODE_CONFIG);
|
|
Set_Dispenser_MiscCommand(dispenserIndex, MISC_DISP_AUTH_MODE_CONFIG);
|
|
Set_Dispenser_MiscCommand(dispenserIndex, MISC_DISP_EVCCID_CONFIG);
|
|
Set_Dispenser_MiscCommand(dispenserIndex, MISC_DISP_EVCCID_CONFIG);
|
|
Set_Dispenser_MiscCommand(dispenserIndex, MISC_DISP_TIME_OFFSET);
|
|
Set_Dispenser_MiscCommand(dispenserIndex, MISC_DISP_TIME_OFFSET);
|
|
|
|
+ Set_Dispenser_MiscCommand(dispenserIndex, MISC_DISP_RFID_ENABLE);
|
|
|
|
|
|
if(strlen(ShmChargerInfo->StationInfo.StationName) > 0 ||
|
|
if(strlen(ShmChargerInfo->StationInfo.StationName) > 0 ||
|
|
ShmChargerInfo->StationInfo.StationID != 0 ||
|
|
ShmChargerInfo->StationInfo.StationID != 0 ||
|
|
@@ -4261,6 +4517,12 @@ void DispenserSocketProcess(int socketFd, struct sockaddr_in clientInfo, unsigne
|
|
Set_Dispenser_MiscCommand(dispenserIndex, MISC_DISP_DEFAULT_PRICE_STRING);
|
|
Set_Dispenser_MiscCommand(dispenserIndex, MISC_DISP_DEFAULT_PRICE_STRING);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ if(ShmChargerInfo->Control.CustomerCode == _CUSTOMER_CODE_Phihong ||
|
|
|
|
+ ShmChargerInfo->Control.CustomerCode == _CUSTOMER_CODE_Shell)
|
|
|
|
+ {
|
|
|
|
+ Set_Dispenser_MiscCommand(dispenserIndex, MISC_DISP_RFID_CARD_ENDIAN);
|
|
|
|
+ }
|
|
|
|
+
|
|
for(int i = 0; i < ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[dispenserIndex].ConnectorQuantity; i++)
|
|
for(int i = 0; i < ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[dispenserIndex].ConnectorQuantity; i++)
|
|
{
|
|
{
|
|
unsigned char gun = ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[dispenserIndex].ConnectorID[i] - 1;
|
|
unsigned char gun = ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[dispenserIndex].ConnectorID[i] - 1;
|
|
@@ -4627,6 +4889,26 @@ void DispenserSocketProcess(int socketFd, struct sockaddr_in clientInfo, unsigne
|
|
}
|
|
}
|
|
ChargingBillResponse(socketFd, &receiveBuffer, ackResult);
|
|
ChargingBillResponse(socketFd, &receiveBuffer, ackResult);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ // Reg: 0x27 ParkingStatus
|
|
|
|
+ if(receiveBuffer.Header.op == _Header_Read && receiveBuffer.Payload.reg == _Reg_ParkingStatus)
|
|
|
|
+ {
|
|
|
|
+ if(ReadParkingStatusHandler(&receiveBuffer, dispenserIndex))
|
|
|
|
+ {
|
|
|
|
+ ackResult = _R_OK;
|
|
|
|
+ }
|
|
|
|
+ ParkingStatusResponse(socketFd, &receiveBuffer, ackResult);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ // Reg: 0x28 ParkingBill
|
|
|
|
+ if(receiveBuffer.Header.op == _Header_Read && receiveBuffer.Payload.reg == _Reg_ParkingBill)
|
|
|
|
+ {
|
|
|
|
+ if(ReadParkingBillHandler(&receiveBuffer, dispenserIndex))
|
|
|
|
+ {
|
|
|
|
+ ackResult = _R_OK;
|
|
|
|
+ }
|
|
|
|
+ ParkingBillResponse(socketFd, &receiveBuffer, ackResult);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
// clean timeout
|
|
// clean timeout
|
|
@@ -4970,6 +5252,7 @@ void InitialConnector(void)
|
|
memset(&_ConnectorQRCode[i][0], 0x00, 128);
|
|
memset(&_ConnectorQRCode[i][0], 0x00, 128);
|
|
memset(&_stationInfo[i], 0x00, sizeof(StationInfoData));
|
|
memset(&_stationInfo[i], 0x00, sizeof(StationInfoData));
|
|
memset(&_deductResult[i], 0x00, sizeof(DeductResultInfoData));
|
|
memset(&_deductResult[i], 0x00, sizeof(DeductResultInfoData));
|
|
|
|
+ memset(&_OccupancyResponse[i], 0x00, sizeof(OccupancyResponse));
|
|
_GunSystemStatus[i] = 0;
|
|
_GunSystemStatus[i] = 0;
|
|
}
|
|
}
|
|
}
|
|
}
|