|
@@ -10282,7 +10282,7 @@ int handleDataTransferRequest(char *uuid, char *payload)
|
|
|
sprintf(message,"[%d,\"%s\",%s]",MESSAGE_TYPE_CALLRESULT, uuid, json_object_to_json_string_ext(response, JSON_C_TO_STRING_PLAIN));
|
|
|
json_object_put(response);
|
|
|
}
|
|
|
- else if(strstr(tempmessageId, "ID_DisplayLcdPage") != NULL)
|
|
|
+ else if(strstr(tempmessageId, "ID_LineStatusPage") != NULL)
|
|
|
{
|
|
|
json_object *data;
|
|
|
data = json_tokener_parse(tempdata);
|
|
@@ -10292,7 +10292,12 @@ int handleDataTransferRequest(char *uuid, char *payload)
|
|
|
|
|
|
if(json_object_object_get(data, "ConnectorId") != NULL)
|
|
|
{
|
|
|
- ShmSysConfigAndInfo->SysInfo.LcdOveride.connectorId = json_object_get_int(json_object_object_get(data, "ConnectorId"));
|
|
|
+ ShmSysConfigAndInfo->SysInfo.LcdOveride.connectorId = json_object_get_int(json_object_object_get(data, "ConnectorId"));
|
|
|
+ }
|
|
|
+
|
|
|
+ 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")));
|
|
|
}
|
|
|
|
|
|
if(json_object_object_get(data, "Page_Index") != NULL)
|
|
@@ -10519,6 +10524,54 @@ int handleDataTransferRequest(char *uuid, char *payload)
|
|
|
sprintf(message,"[%d,\"%s\",%s]",MESSAGE_TYPE_CALLRESULT, uuid, json_object_to_json_string_ext(response, JSON_C_TO_STRING_PLAIN));
|
|
|
json_object_put(response);
|
|
|
}
|
|
|
+ else if(strstr(tempmessageId, "ID_GetTxUserInfo") != NULL)
|
|
|
+ {
|
|
|
+ json_object *data;
|
|
|
+ data = json_tokener_parse(tempdata);
|
|
|
+ if(!is_error(data))
|
|
|
+ {
|
|
|
+ if((json_object_object_get(data, "ConnectorId") != NULL) && (json_object_object_get(data, "txId") != NULL))
|
|
|
+ {
|
|
|
+ int gun_index = json_object_get_int(json_object_object_get(data, "ConnectorId"))-1;
|
|
|
+ json_object_object_add(response, "status", json_object_new_string("Accepted"));
|
|
|
+ if(gun_index < gunTotalNumber)
|
|
|
+ {
|
|
|
+ if(ShmOCPP16DataPH->StartTransaction[gun_index].ResponseTransactionId == json_object_get_int(json_object_object_get(data, "txId")))
|
|
|
+ {
|
|
|
+ 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, "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)));
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ json_object_object_add(response, "status", json_object_new_string("Rejected"));
|
|
|
+ json_object_object_add(response, "data", json_object_new_string("txId doesn't match the current transactionId."));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ json_object_object_add(response, "status", json_object_new_string("Rejected"));
|
|
|
+ json_object_object_add(response, "data", json_object_new_string("ConnectorId is invalid."));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ json_object_object_add(response, "status", json_object_new_string("Rejected"));
|
|
|
+ json_object_object_add(response, "data", json_object_new_string("Configuration content something wrong."));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ json_object_object_add(response, "status", json_object_new_string("Rejected"));
|
|
|
+ json_object_object_add(response, "data", json_object_new_string("Configuration content something wrong."));
|
|
|
+ }
|
|
|
+
|
|
|
+ sprintf(message,"[%d,\"%s\",%s]",MESSAGE_TYPE_CALLRESULT, uuid, json_object_to_json_string_ext(response, JSON_C_TO_STRING_PLAIN));
|
|
|
+ json_object_put(response);
|
|
|
+ }
|
|
|
else
|
|
|
{
|
|
|
json_object_object_add(response, "status", json_object_new_string("Rejected"));
|