Browse Source

2022-12-21/Jerry Wang
[OCPP 2.0.1]

Action:
1. Modify and Improve whole MeterValues and TransactionEvent related functions.
2. Re-define evseId & connectorId for following the rule of OCPP spec.
3. Improve checkCompositeSchedule() function.
4. Fix the problem of sending Heartbeat anytime once HeartbeatInterval is set to 0.

File:
1. EVSE/Modularization/ocpp20/MessageHandler.c
--> Action 1-4
2. EVSE/Modularization/ocpp20/MessageHandler.h
--> Action 1
3. EVSE/Modularization/ocpp20/Module_OcppBackend20.c
--> Action 1
4. EVSE/Modularization/ocpp20/Module_OcppBackend20.h
--> Action 1

Jerry Wang 2 years ago
parent
commit
8c94a0f642

File diff suppressed because it is too large
+ 402 - 105
EVSE/Modularization/ocpp20/MessageHandler.c


+ 1 - 1
EVSE/Modularization/ocpp20/MessageHandler.h

@@ -869,7 +869,7 @@ int sendGet15118EVCertificateRequest();
 int sendGetCertificateStatusRequest();
 int sendHeartbeatRequest();
 int sendLogStatusNotificationRequest(char *status);
-int sendMeterValuesRequest(int gun_index, ReadingContextEnumType dataType);
+int sendMeterValuesRequest(int gun_index, ReadingContextEnumType dataType, uint8_t isSampledDataTxEnd);
 int sendNotifyChargingLimitRequest(int gun_index);
 int sendNotifyCustomerInformationRequest();
 int sendNotifyDisplayMessagesRequest();

+ 2 - 2
EVSE/Modularization/ocpp20/Module_OcppBackend20.c

@@ -56,14 +56,14 @@ int SendData(struct lws *wsi)
 {
     int n;
     int len;
-    unsigned char out[LWS_SEND_BUFFER_PRE_PADDING + (1024*20) + LWS_SEND_BUFFER_POST_PADDING] = {0};
+    unsigned char out[LWS_SEND_BUFFER_PRE_PADDING + ARRAY_SIZE(SendBuffer) + LWS_SEND_BUFFER_POST_PADDING] = {0};
 
     len = strlen((char *)SendBuffer);
 
     if(len == 0)return 0;
 
 	if((strstr((char*)SendBuffer, "\"MeterValues\"") != NULL)
-	|| (strstr((char*)SendBuffer, "\"TransactionEven\"") != NULL))
+	|| (strstr((char*)SendBuffer, "\"TransactionEvent\"") != NULL))
 	{
 		isQueueSendable = OFF;
 	}

+ 2 - 2
EVSE/Modularization/ocpp20/Module_OcppBackend20.h

@@ -109,10 +109,10 @@ enum GUN_TYPE
 #define QUEUE_OPERATION_SENT		3
 #define QUEUE_OPERATION_ADD			4
 #define QUEUE_OPERATION_STORE		5
-#define QUEUE_MESSAGE_LENGTH		1024*20
+#define QUEUE_MESSAGE_LENGTH		1024*495
 
 // Websocket TX/RX buffer size
-#define WEBSOCKET_BUFFER_SIZE          (1024*200)
+#define WEBSOCKET_BUFFER_SIZE          (1024*500)
 
 struct QueueOpInfo
 {

Some files were not shown because too many files changed in this diff