浏览代码

2022-07-11/Jerry Wang
[OCPP 1.6]

Action:
1. Improve ID_TxEnergy related logic to avoid missing transactionId.
2. Modify chaging isQueueSendable, StartTransactionConf, StartTransactionReq flag timing.

File:
1. EVSE/Modularization/ocppfiles/MessageHandler.c
--> Action 1,2

Jerry Wang 2 年之前
父节点
当前提交
e62bd97120
共有 1 个文件被更改,包括 5 次插入3 次删除
  1. 5 3
      EVSE/Modularization/ocppfiles/MessageHandler.c

+ 5 - 3
EVSE/Modularization/ocppfiles/MessageHandler.c

@@ -16190,9 +16190,7 @@ void handleStartTransactionResponse(char *payload, int gun_index)
 	}
 	json_object_put(StartTransaction);
 
-	isQueueSendable = 1;
-	ShmOCPP16Data->CpMsg.bits[gun_index].StartTransactionConf = 1;
-	ShmOCPP16Data->CpMsg.bits[gun_index].StartTransactionReq = 0;
+	OCPP_updatePeriodEnergy(gun_index);
 
 	//-----------Start : write to the Queue TransactionId file -----------------//
 	if((access("/Storage/OCPP/QueueTransactionId",F_OK))!=-1)
@@ -16227,6 +16225,10 @@ void handleStartTransactionResponse(char *payload, int gun_index)
 	DEBUG_INFO("idTagInfo-status: %s\n", ShmOCPP16Data->StartTransaction[gun_index].ResponseIdTagInfo.Status);
 	DEBUG_INFO("transactionId: %d\n", ShmOCPP16Data->StartTransaction[gun_index].ResponseTransactionId);
 	system("/bin/fsync -d /dev/mtdblock13;/bin/sync &");
+
+	isQueueSendable = 1;
+	ShmOCPP16Data->CpMsg.bits[gun_index].StartTransactionConf = 1;
+	ShmOCPP16Data->CpMsg.bits[gun_index].StartTransactionReq = 0;
 }
 
 void handleStatusNotificationResponse(char *payload, int gun_index)