|
@@ -1396,9 +1396,9 @@ void reportReaderStatus(int gun_index)
|
|
|
sprintf(usec_buf,"%dZ",(int)tmnow.tv_usec);
|
|
|
strcat(buf,usec_buf);
|
|
|
#endif
|
|
|
- sprintf((char*)ShmOCPP16Data->DataTransfer[0].VendorId, "%s", ShmSysConfigAndInfo->SysConfig.chargePointVendor);
|
|
|
- sprintf((char*)ShmOCPP16Data->DataTransfer[0].MessageId,"%s","ID_ReaderStatus");
|
|
|
- sprintf((char*)ShmOCPP16Data->DataTransfer[0].Data, "{\\\"connectorId\\\":%d,\\\"readerStatus\\\":%d,\\\"timestamp\\\":\\\"%s\\\",\\\"SerialNo\\\":\\\"%s\\\",\\\"creditNo\\\":\\\"%s\\\",\\\"VEMData\\\":\\\"%s\\\"}",
|
|
|
+ sprintf((char*)ShmOCPP16Data->DataTransfer[gun_index].VendorId, "%s", ShmSysConfigAndInfo->SysConfig.chargePointVendor);
|
|
|
+ sprintf((char*)ShmOCPP16Data->DataTransfer[gun_index].MessageId,"%s","ID_ReaderStatus");
|
|
|
+ sprintf((char*)ShmOCPP16Data->DataTransfer[gun_index].Data, "{\\\"connectorId\\\":%d,\\\"readerStatus\\\":%d,\\\"timestamp\\\":\\\"%s\\\",\\\"SerialNo\\\":\\\"%s\\\",\\\"creditNo\\\":\\\"%s\\\",\\\"VEMData\\\":\\\"%s\\\"}",
|
|
|
(gun_index+1),
|
|
|
ShmOCPP16Data->TcciCustomData.ReaderStatus[gun_index].readerStatus,
|
|
|
buf,
|
|
@@ -1406,7 +1406,7 @@ void reportReaderStatus(int gun_index)
|
|
|
ShmOCPP16Data->TcciCustomData.ReaderStatus[gun_index].creditNo,
|
|
|
ShmOCPP16Data->TcciCustomData.VEMData[gun_index]);
|
|
|
|
|
|
- ShmOCPP16Data->CsMsg.bits[0].DataTransferReq = 1;
|
|
|
+ ShmOCPP16Data->CsMsg.bits[gun_index].DataTransferReq = 1;
|
|
|
}
|
|
|
|
|
|
//==========================================
|
|
@@ -5329,10 +5329,10 @@ void CheckSystemValue(void)
|
|
|
//==============================================
|
|
|
// TCCI reader status report
|
|
|
//==============================================
|
|
|
- if(ShmOCPP16Data->TcciCustomData.ReaderStatus[gun_index].ReportReaderStatusReq == 1)
|
|
|
+ if(isWebsocketSendable && (server_sign == TRUE) && (ShmOCPP16Data->TcciCustomData.ReaderStatus[gun_index].ReportReaderStatusReq == 1))
|
|
|
{
|
|
|
reportReaderStatus(gun_index);
|
|
|
- ShmOCPP16Data->TcciCustomData.ReaderStatus[gun_index].ReportReaderStatusReq = 0;
|
|
|
+ //ShmOCPP16Data->TcciCustomData.ReaderStatus[gun_index].ReportReaderStatusReq = 0;
|
|
|
}
|
|
|
|
|
|
//==============================================
|
|
@@ -6097,7 +6097,7 @@ int sendStatusNotificationRequest(int gun_index)
|
|
|
//strcpy(ShmOCPP16Data->StatusNotification[gun_index].ErrorCode, "NoError"); --- CSU Setting
|
|
|
|
|
|
// it's option
|
|
|
- strcpy((char *)ShmOCPP16Data->StatusNotification[gun_index].Info, "");
|
|
|
+ //strcpy((char *)ShmOCPP16Data->StatusNotification[gun_index].Info, "");
|
|
|
|
|
|
/*
|
|
|
enum _SYSTEM_STATUS
|
|
@@ -15596,6 +15596,12 @@ void handleDataTransferResponse(char *payload, int gun_index)
|
|
|
{
|
|
|
OCPP_update_deduct_info(json_object_get_int(json_object_object_get(Data, "txId")), (char*)json_object_get_string(json_object_object_get(Data, "creditNo")));
|
|
|
}
|
|
|
+
|
|
|
+ if(strstr(json_object_get_string(json_object_object_get(Data, "msgId")), "ID_ReaderStatus") != NULL)
|
|
|
+ {
|
|
|
+ if(json_object_object_get(Data, "ConnectorId") != NULL)
|
|
|
+ ShmOCPP16Data->TcciCustomData.ReaderStatus[json_object_get_int(json_object_object_get(Data, "ConnectorId"))-1].ReportReaderStatusReq = 0;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
json_object_put(Data);
|