|
@@ -991,40 +991,41 @@ int sentqueue()
|
|
|
{
|
|
|
if(strstr(action, "StartTransaction") != NULL)
|
|
|
{
|
|
|
- if(hashmap_operation(HASH_OP_GET, guid, key_value) == TRUE)
|
|
|
+ char idtag[21]={0};
|
|
|
+ char timestamp[36]={0};
|
|
|
+ int meterStart=0;
|
|
|
+ int reservationId=-1;
|
|
|
+ if(json_object_object_get(objPayload, "idTag") != NULL)
|
|
|
{
|
|
|
-
|
|
|
+ sprintf(idtag, "%s", json_object_get_string(json_object_object_get(objPayload, "idTag")));
|
|
|
}
|
|
|
- else
|
|
|
+
|
|
|
+ if(json_object_object_get(objPayload, "meterStart") != NULL)
|
|
|
{
|
|
|
- char idtag[21]={0};
|
|
|
- char timestamp[36]={0};
|
|
|
- int meterStart=0;
|
|
|
- int reservationId=-1;
|
|
|
- sprintf(hashData, "StartTransaction,%d", (connectorId-1));
|
|
|
- hashmap_operation(HASH_OP_ADD, guid, hashData);
|
|
|
+ meterStart = json_object_get_int(json_object_object_get(objPayload, "meterStart"));
|
|
|
+ }
|
|
|
|
|
|
- if(json_object_object_get(objPayload, "idTag") != NULL)
|
|
|
- {
|
|
|
- sprintf(idtag, "%s", json_object_get_string(json_object_object_get(objPayload, "idTag")));
|
|
|
- }
|
|
|
+ if(json_object_object_get(objPayload, "reservationId") != NULL)
|
|
|
+ {
|
|
|
+ reservationId = json_object_get_int(json_object_object_get(objPayload, "reservationId"));
|
|
|
+ }
|
|
|
|
|
|
- if(json_object_object_get(objPayload, "meterStart") != NULL)
|
|
|
- {
|
|
|
- meterStart = json_object_get_int(json_object_object_get(objPayload, "meterStart"));
|
|
|
- }
|
|
|
+ if(json_object_object_get(objPayload, "timestamp") != NULL)
|
|
|
+ {
|
|
|
+ sprintf(timestamp, "%s", json_object_get_string(json_object_object_get(objPayload, "timestamp")));
|
|
|
+ }
|
|
|
|
|
|
- if(json_object_object_get(objPayload, "reservationId") != NULL)
|
|
|
- {
|
|
|
- reservationId = json_object_get_int(json_object_object_get(objPayload, "reservationId"));
|
|
|
- }
|
|
|
+ FillStartTransaction(connectorId, (unsigned char*)idtag, meterStart, reservationId, (unsigned char*)timestamp);
|
|
|
|
|
|
- if(json_object_object_get(objPayload, "timestamp") != NULL)
|
|
|
- {
|
|
|
- sprintf(timestamp, "%s", json_object_get_string(json_object_object_get(objPayload, "timestamp")));
|
|
|
- }
|
|
|
|
|
|
- FillStartTransaction(connectorId, (unsigned char*)idtag, meterStart, reservationId, (unsigned char*)timestamp);
|
|
|
+ if(hashmap_operation(HASH_OP_GET, guid, key_value) == TRUE)
|
|
|
+ {
|
|
|
+
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ sprintf(hashData, "StartTransaction,%d", (connectorId-1));
|
|
|
+ hashmap_operation(HASH_OP_ADD, guid, hashData);
|
|
|
|
|
|
}
|
|
|
|
|
@@ -1364,7 +1365,7 @@ int main(void)
|
|
|
queueOpInfo.TransactionMessageResend = 0;
|
|
|
|
|
|
DEBUG_INFO("Module_OcppBackend task initialization...\n");
|
|
|
- DEBUG_INFO("Git update date: 2022/09/28 \n");
|
|
|
+ DEBUG_INFO("Git update date: 2022/11/11 \n");
|
|
|
|
|
|
|
|
|
if(ProcessShareMemory()== FAIL)
|