Преглед на файлове

Add MAC reply for distribution

zack преди 1 година
родител
ревизия
e56f9c0796
променени са 6 файла, в които са добавени 3410 реда и са изтрити 3360 реда
  1. 4 2
      Core/Inc/tt808.h
  2. 19 0
      Core/Src/freertos.c
  3. 0 1
      Core/Src/mba32a.c
  4. 18 4
      Core/Src/tt808.c
  5. 1 1
      MDK-ARM/dtu.uvoptx
  6. 3368 3352
      Output/dtu.hex

+ 4 - 2
Core/Inc/tt808.h

@@ -43,13 +43,15 @@ void ReMLBSLOC(void);
 void XGtest(void);
 void MIPURCHandle(void);
 void ReMIPURC(void);
-
+void RTCtime(void);
+extern uint8_t BDmacNum ;
 extern uint8_t MIPurc_test1;
-
+extern uint8_t WbscCmd;
 extern uint32_t uploadtime;
 
 
 
+extern uint8_t sjfNowStatus ;
 
 
 

+ 19 - 0
Core/Src/freertos.c

@@ -31,6 +31,7 @@
 #include <stdlib.h>
 #include "tt808.h"
 
+extern Time time;
 extern Menu_table menu;
 extern TT808 tt808;
 void Jump_interface(Menu_table menu);
@@ -314,6 +315,15 @@ void StartloginfoTaskTask(void const * argument)
 	{
 		Ptsjf = false;
 		menu.enter=4;
+		
+		
+		/* 开启后和紧急上报冲突 */
+//		RTCtime();
+//		uint8_t testsjfdata[] = {0x55,WbscCmd,  MIPurc1[17], MIPurc1[18], MIPurc1[19], MIPurc1[20], 0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00, sjfNowStatus, 0x00, 0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x07, time.tt[0],time.tt[1],time.tt[2],time.tt[3]+DongbaquTime,time.tt[4],time.tt[5]};			//testMAC数据
+//		tt808FsFunc(testsjfdata,35,XXIDwbsc);		//testSJF数据
+		
+		
+		
 		locDw =true;
 		XTflag = true;
 	}
@@ -324,7 +334,16 @@ void StartloginfoTaskTask(void const * argument)
 	 {
 		 genghaunmac = false;
 		 newMacchange(MIPurc1);//处理MAC数据
+		 
+		RTCtime();
+		uint8_t testmacdata[] = {0x52,0x03,BDmacNum,MIPurc1[18],MIPurc1[19],MIPurc1[20],MIPurc1[21],0x00,time.tt[0],time.tt[1],time.tt[2],time.tt[3]+DongbaquTime,time.tt[4],time.tt[5]};			//testMAC数据
+		tt808FsFunc(testmacdata,14,XXIDbdMac);		//testMAC数据
+		 
+		 
 		 memset(MIPurc1,0,rlt);//rlt下发长度
+			
+		locDw =true;
+		XTflag = true;
 	 }
 
   }

+ 0 - 1
Core/Src/mba32a.c

@@ -487,7 +487,6 @@ void open_close_lock(void)
 				Write_Information(Sn1StatusAddr, 0x1111);
 				tt808.L1Lockstatus = LockStatusOpen;
 				HAL_Delay(50);
-
 				SdjfEmergency=true;
 			}
 		}

+ 18 - 4
Core/Src/tt808.c

@@ -196,7 +196,7 @@ bool newmac=false;
 
 
 bool genghaunmac =false;
-
+uint8_t BDmacNum =0;
 extern Menu_table menu;
 void newMacchange(uint8_t MIPurc1[])
 {
@@ -206,7 +206,7 @@ void newMacchange(uint8_t MIPurc1[])
 	//snnum				0010
 	
 	
-		uint8_t BDmacNum = MIPurc1[17];//绑定的L1
+		BDmacNum = MIPurc1[17];//绑定的L1
 		uint16_t mac = (MIPurc1[20] << 8) | MIPurc1[21]; //eg 0010
 	
 	
@@ -304,7 +304,7 @@ void newMacchange(uint8_t MIPurc1[])
 //		menu.SN3name = SNname;
 //		menu.SN3D = SND;
 		Write_Information(Sn3Addr, mac);
-		menu.home &= 0xF0FF;
+		menu.home &= 0xFF0F;
 	}		
 	else if(BDmacNum==0x04)//M4
 	{
@@ -322,7 +322,7 @@ void newMacchange(uint8_t MIPurc1[])
 //		menu.SN4name = SNname;
 //		menu.SN4D = SND;
 		Write_Information(Sn4Addr, mac);
-		menu.home &= 0xFF0F;
+		menu.home &= 0xFFF0;
 	}		
 	
 	  readLockStatusinit();
@@ -651,6 +651,8 @@ bool Ptsjf = false;
 extern bool locDw;
 bool Timetb=false;
 bool JQflag = false;
+
+uint8_t sjfNowStatus = 0;
 void MIPURCHandle(void)
 {
 	 if(MIPurc1[0]==0x7E)
@@ -786,6 +788,7 @@ void MIPURCHandle(void)
 							 HAL_Delay(400);
 						 }
 					 }
+					 sjfNowStatus = tt808.L1Lockstatus;
 				 }
 				 else if(nowMac2 == WbscLmac && L2bd)//施封L2
 				 {
@@ -804,6 +807,7 @@ void MIPURCHandle(void)
 						 }
 				 
 					 }
+					 sjfNowStatus = tt808.L2Lockstatus;
 				 }
 				 else if(nowMac3 == WbscLmac && L3bd)//施封L3
 				 {
@@ -822,6 +826,7 @@ void MIPURCHandle(void)
 						 }
 				 
 					 }
+					 sjfNowStatus = tt808.L3Lockstatus;
 				 }
 				 else if(nowMac4 == WbscLmac && L4bd)//施封L4
 				 {
@@ -840,6 +845,7 @@ void MIPURCHandle(void)
 						 }
 				 
 					 }
+					 sjfNowStatus = tt808.L4Lockstatus;
 				 }
 				 else
 				 {
@@ -868,6 +874,7 @@ void MIPURCHandle(void)
 							 SET_MENU_STATUS(4,0,0,3);
 						 }
 					 }
+					 sjfNowStatus = tt808.L1Lockstatus;
 				 }
 				 else if(nowMac2 == WbscLmac && L2bd)//解锁L2
 				 {
@@ -884,6 +891,7 @@ void MIPURCHandle(void)
 							 SET_MENU_STATUS(5,0,0,3);
 						 }
 					 }
+					 sjfNowStatus = tt808.L2Lockstatus;
 				 }
 				 else if(nowMac3 == WbscLmac && L3bd)//解锁L3
 				 {
@@ -900,6 +908,7 @@ void MIPURCHandle(void)
 							 SET_MENU_STATUS(6,0,0,3);
 						 }
 					 }
+					 sjfNowStatus = tt808.L3Lockstatus;
 				 }
 				 else if(nowMac4 == WbscLmac && L4bd)//解锁L4
 				 {
@@ -916,6 +925,7 @@ void MIPURCHandle(void)
 							 SET_MENU_STATUS(7,0,0,3);
 						 }
 					 }
+					 sjfNowStatus = tt808.L4Lockstatus;
 				 }
 				 else
 				 {
@@ -928,6 +938,10 @@ void MIPURCHandle(void)
 			 {
 				 printf("@得到平台绑定MAC数据\r\n");
 				 genghaunmac=true;
+				 
+					locDw =false;
+					XTflag = false;
+				 
 			 }
 		 }
 

+ 1 - 1
MDK-ARM/dtu.uvoptx

@@ -355,7 +355,7 @@
       <GroupNumber>2</GroupNumber>
       <FileNumber>10</FileNumber>
       <FileType>1</FileType>
-      <tvExp>0</tvExp>
+      <tvExp>1</tvExp>
       <tvExpOptDlg>0</tvExpOptDlg>
       <bDave2>0</bDave2>
       <PathWithFileName>../Core/Src/main.c</PathWithFileName>

Файловите разлики са ограничени, защото са твърде много
+ 3368 - 3352
Output/dtu.hex