|
@@ -885,6 +885,36 @@ void OCPP_query_deduct_info()
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+void reportReaderStatus(int gun_index)
|
|
|
+{
|
|
|
+ struct timeval tmnow;
|
|
|
+ struct tm *tm;
|
|
|
+ char buf[28];//, usec_buf[6];
|
|
|
+ gettimeofday(&tmnow, NULL);
|
|
|
+
|
|
|
+ time_t t;
|
|
|
+ t = time(NULL);
|
|
|
+ /*UTC time and date*/
|
|
|
+ tm = gmtime(&t);
|
|
|
+ strftime(buf,28,"%Y-%m-%dT%H:%M:%SZ", tm);
|
|
|
+ #if 0 // remove temporally
|
|
|
+ strftime(buf,30,"%Y-%m-%dT%H:%M:%S", tm);
|
|
|
+ strcat(buf,".");
|
|
|
+ sprintf(usec_buf,"%dZ",(int)tmnow.tv_usec);
|
|
|
+ strcat(buf,usec_buf);
|
|
|
+ #endif
|
|
|
+ sprintf((char*)ShmOCPP16DataPH->DataTransfer[0].VendorId, "%s", ShmSysConfigAndInfo->SysConfig.chargePointVendor);
|
|
|
+ sprintf((char*)ShmOCPP16DataPH->DataTransfer[0].MessageId,"%s","ID_ReaderStatus");
|
|
|
+ sprintf((char*)ShmOCPP16DataPH->DataTransfer[0].Data, "{\\\"connectorId\\\":%d,\\\"readerStatus\\\":%d,\\\"timestamp\\\":\\\"%s\\\",\\\"SerialNo\\\":\\\"%s\\\",\\\"creditNo\\\":\\\"%s\\\"}",
|
|
|
+ (gun_index+1),
|
|
|
+ ShmOCPP16DataPH->TcciCustomData.ReaderStatus[gun_index].readerStatus,
|
|
|
+ buf,
|
|
|
+ ShmOCPP16DataPH->TcciCustomData.SerialNo[gun_index],
|
|
|
+ ShmOCPP16DataPH->TcciCustomData.ReaderStatus[gun_index].creditNo);
|
|
|
+
|
|
|
+ ShmOCPP16DataPH->CsMsg.bits[0].DataTransferReq = 1;
|
|
|
+}
|
|
|
+
|
|
|
//==========================================
|
|
|
// Check time passed since today
|
|
|
//==========================================
|
|
@@ -4538,7 +4568,16 @@ void CheckSystemValue(void)
|
|
|
}
|
|
|
|
|
|
//==============================================
|
|
|
- // CSU Trigger Smart Charging Profilw
|
|
|
+ // TCCI reader status report
|
|
|
+ //==============================================
|
|
|
+ if(ShmOCPP16DataPH->TcciCustomData.ReaderStatus[gun_index].ReportReaderStatusReq == 1)
|
|
|
+ {
|
|
|
+ reportReaderStatus(gun_index);
|
|
|
+ ShmOCPP16DataPH->TcciCustomData.ReaderStatus[gun_index].ReportReaderStatusReq = 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ //==============================================
|
|
|
+ // CSU Trigger Smart Charging Profile
|
|
|
//==============================================
|
|
|
if(ShmOCPP16DataPH->CSUMsg.bits[gun_index].ChargingProfileReq == 1)
|
|
|
{
|
|
@@ -10303,7 +10342,7 @@ int handleDataTransferRequest(char *uuid, char *payload)
|
|
|
|
|
|
if(json_object_object_get(data, "SerialNo") != NULL)
|
|
|
{
|
|
|
- sprintf((char *)ShmOCPP16DataPH->TcciCustomData.LineStatusPage.SerialNo[(ShmSysConfigAndInfo->SysInfo.LcdOveride.connectorId-1)], "%s", json_object_get_string(json_object_object_get(data,"SerialNo")));
|
|
|
+ sprintf((char *)ShmOCPP16DataPH->TcciCustomData.SerialNo[(ShmSysConfigAndInfo->SysInfo.LcdOveride.connectorId-1)], "%s", json_object_get_string(json_object_object_get(data,"SerialNo")));
|
|
|
}
|
|
|
|
|
|
if(json_object_object_get(data, "Page_Index") != NULL)
|
|
@@ -10547,7 +10586,7 @@ int handleDataTransferRequest(char *uuid, char *payload)
|
|
|
json_object *responsedata = json_object_new_object();
|
|
|
json_object_object_add(responsedata, "txId", json_object_new_int(ShmOCPP16DataPH->StartTransaction[gun_index].ResponseTransactionId));
|
|
|
json_object_object_add(responsedata, "ConnectorId", json_object_new_int(gun_index+1));
|
|
|
- json_object_object_add(responsedata, "SerialNo", json_object_new_string((char*)ShmOCPP16DataPH->TcciCustomData.LineStatusPage.SerialNo[gun_index]));
|
|
|
+ json_object_object_add(responsedata, "SerialNo", json_object_new_string((char*)ShmOCPP16DataPH->TcciCustomData.SerialNo[gun_index]));
|
|
|
json_object_object_add(responsedata, "StartTime", json_object_new_string((char*)ShmOCPP16DataPH->StartTransaction[gun_index].Timestamp));
|
|
|
json_object_object_add(response, "data", json_object_new_string(json_object_to_json_string_ext(responsedata, JSON_C_TO_STRING_PLAIN)));
|
|
|
}
|