|
@@ -8083,6 +8083,8 @@ int sendStatusNotificationRequest(int gun_index)
|
|
|
char buf[28];//, usec_buf[6];
|
|
|
char tempdata[65]={0};
|
|
|
int tempIndex = 0;
|
|
|
+ uint8_t isStateChanged = TRUE;
|
|
|
+
|
|
|
DEBUG_INFO("sendStatusNotificationRequest...\n");
|
|
|
|
|
|
gettimeofday(&tmnow, NULL);
|
|
@@ -8446,8 +8448,15 @@ S_FAULT =12
|
|
|
|
|
|
}//end of for AC_QUANTITY
|
|
|
}
|
|
|
- strcpy((char *)ShmOCPP20Data->StatusNotification[gun_index].connectorStatus, ConnectorStatusEnumTypeStr[currentStatus]);
|
|
|
+ //it's option
|
|
|
+ if((strstr((char *)ShmOCPP20Data->StatusNotification[gun_index].connectorStatus, ConnectorStatusEnumTypeStr[currentStatus]) != NULL) &&
|
|
|
+ !ShmOCPP20Data->CsMsg.bits[gun_index].TriggerMessageReq)
|
|
|
+ {
|
|
|
+ isStateChanged = FALSE;
|
|
|
+ }
|
|
|
+ ShmOCPP20Data->CsMsg.bits[gun_index].TriggerMessageReq = 0;
|
|
|
|
|
|
+ strcpy((char *)ShmOCPP20Data->StatusNotification[gun_index].connectorStatus, ConnectorStatusEnumTypeStr[currentStatus]);
|
|
|
random_uuid(guid);
|
|
|
sprintf(message, "[%d,\"%s\",\"StatusNotification\",{\"connectorId\":%d,\"evseId\":%d,\"connectorStatus\":\"%s\",\"timestamp\":\"%s\"}]"
|
|
|
, MESSAGE_TYPE_CALL
|
|
@@ -8457,7 +8466,7 @@ S_FAULT =12
|
|
|
, ShmOCPP20Data->StatusNotification[gun_index].connectorStatus
|
|
|
, ShmOCPP20Data->StatusNotification[gun_index].timestamp);
|
|
|
|
|
|
- if((server_sign == TRUE))
|
|
|
+ if((server_sign == TRUE) && isStateChanged)
|
|
|
{
|
|
|
LWS_Send(message);
|
|
|
|