Przeglądaj źródła

[Improve][AW-Regular][main.c]
2022-07-11 / EASON YANG
Action:
1. Improve: Check RFID authorization. Prevent swiping twice.

File:
1. main.c
Action 1

FIRMWARE VERSION: V0.71.XX.XXXX.PX

8009 2 lat temu
rodzic
commit
c10f1dbd72
1 zmienionych plików z 10 dodań i 1 usunięć
  1. 10 1
      EVSE/Projects/AW-Regular/Apps/main.c

+ 10 - 1
EVSE/Projects/AW-Regular/Apps/main.c

@@ -67,6 +67,7 @@ int 	rfidFd = -1;
 char* 	rfidPortName = "/dev/ttyS2";
 RFID 	rfid;
 char 	*valid_Internet[2] 	  = {"8.8.8.8", "180.76.76.76"};
+int		isRfidReadable;
 
 //==========================
 // Declare share memory
@@ -4222,7 +4223,15 @@ int main(void)
 		{
 			if(GetCardSerialNumber()!= FAIL)
 			{
-				ShmCharger->gun_info[ShmCharger->gun_selectd].rfidReq = ON;
+				if(isRfidReadable)
+				{
+					ShmCharger->gun_info[ShmCharger->gun_selectd].rfidReq = ON;
+					isRfidReadable = NO;
+				}
+			}
+			else
+			{
+				isRfidReadable = YES;
 			}
 		}