소스 검색

dlt645_07 packet data incomplete

haitao 1 년 전
부모
커밋
1eee178ec7
45개의 변경된 파일3662개의 추가작업 그리고 2899개의 파일을 삭제
  1. 4 0
      .gitignore
  2. 37 0
      app/App/device_alive.c
  3. 8 0
      app/App/device_alive.h
  4. 8 1
      app/App/device_message.c
  5. 2 0
      app/App/device_message.h
  6. 36 14
      app/App/ec800m.c
  7. 2 1
      app/App/ec800m.h
  8. 9 9
      app/App/main.c
  9. 0 1
      app/App/main.h
  10. 4 0
      app/App/mqttRecv.c
  11. 55 19
      app/App/parseDeviceMessage.c
  12. 1 1
      app/App/systick.c
  13. 1089 450
      app/Proj/JLinkLog.txt
  14. 963 929
      app/Proj/Listings/Ringzle.map
  15. BIN
      app/Proj/Objects/Ringzle.axf
  16. BIN
      app/Proj/Objects/Ringzle.bin
  17. 12 3
      app/Proj/Objects/Ringzle.build_log.htm
  18. 1077 1042
      app/Proj/Objects/Ringzle.htm
  19. 1 0
      app/Proj/Objects/Ringzle.lnp
  20. 35 25
      app/Proj/Objects/Ringzle_GD32F103C8T6.dep
  21. BIN
      app/Proj/Objects/device_message.crf
  22. 0 7
      app/Proj/Objects/dhcp.d
  23. BIN
      app/Proj/Objects/dlt645_port.crf
  24. 0 9
      app/Proj/Objects/dns.d
  25. BIN
      app/Proj/Objects/ec800m.crf
  26. 1 0
      app/Proj/Objects/ec800m.d
  27. BIN
      app/Proj/Objects/gd32f10x_it.crf
  28. BIN
      app/Proj/Objects/key.crf
  29. BIN
      app/Proj/Objects/main.crf
  30. 1 0
      app/Proj/Objects/main.d
  31. BIN
      app/Proj/Objects/mqttrecv.crf
  32. BIN
      app/Proj/Objects/otaevent.crf
  33. BIN
      app/Proj/Objects/parsedevicemessage.crf
  34. 1 0
      app/Proj/Objects/parsedevicemessage.d
  35. BIN
      app/Proj/Objects/pc.crf
  36. 0 39
      app/Proj/Objects/socket.d
  37. BIN
      app/Proj/Objects/systick.crf
  38. 2 0
      app/Proj/Objects/systick.d
  39. 0 38
      app/Proj/Objects/w5500.d
  40. 0 38
      app/Proj/Objects/wizchip_conf.d
  41. 195 195
      app/Proj/Ringzle.uvguix.16936
  42. 66 70
      app/Proj/Ringzle.uvoptx
  43. 5 0
      app/Proj/Ringzle.uvprojx
  44. 45 4
      app/dlt/port/dlt645_port.c
  45. 3 4
      版本信息.txt

+ 4 - 0
.gitignore

@@ -4,6 +4,10 @@
 *.ko
 *.obj
 *.elf
+*.d
+*.crf
+*.htm
+
 
 # Precompiled Headers
 *.gch

+ 37 - 0
app/App/device_alive.c

@@ -0,0 +1,37 @@
+
+
+#include "device_alive.h"
+#include "systick.h"
+uint32_t last_time;//上一次数据采集的时间 
+bool device_time_flag ;//只依据时间是否到达,可能存在时间抵达时已经在数据采集、后续采集结束再读时间到达时间的清除的情况出现
+//判断是否抵达预定的时间time则返回true
+bool time_arrive(uint32_t time )
+{
+	if(last_time==0)
+	{
+		last_time=gettick();
+		device_time_flag=1;                    //进入数据采集标志
+		return true;
+	}
+	else
+	{
+		if((gettick()-last_time)>time && device_time_flag ==0)
+		{
+			last_time=gettick();
+			device_time_flag=1;                    //进入数据采集标志
+			return true;
+		} 
+		else
+		{
+			return false;
+		}
+	}
+}
+
+void clear_time_flag()
+{
+	if(device_time_flag==1)
+	{
+		device_time_flag=0;
+	}
+}

+ 8 - 0
app/App/device_alive.h

@@ -0,0 +1,8 @@
+#ifndef DEVICE_ALIVE_H
+#define DEVICE_ALIVE_H
+#include <stdint.h>
+#include <stdbool.h>
+extern bool device_time_flag ;
+bool time_arrive(uint32_t time );
+void clear_time_flag();
+#endif

+ 8 - 1
app/App/device_message.c

@@ -21,7 +21,10 @@ int addGatewayParams(char *gatewayString)
 {
 	  parseStringField(gatewayString, "\"commandTopic\":\"", (char *)&gateway_config_params.commandTopic);
 		parseStringField(gatewayString, "\"messageTopic\":\"", (char *)&gateway_config_params.messageTopic);
-
+	  parseStringField(gatewayString,"\"username\":\"",(char *)&gateway_config_params.mqttUserName);
+		parseStringField(gatewayString,"\"password\":\"",(char *)&gateway_config_params.mqttPassword);
+		
+	 
     parseStringField(gatewayString, "\"deviceId\":\"", (char *)&gateway_config_params.deviceId);
     parseStringField(gatewayString, "\"host\":\"", (char *)&gateway_config_params.host);
     gateway_config_params.port = parseIntField(gatewayString, "\"port\":");
@@ -217,6 +220,10 @@ int parseIntField(const char *data, const char *field)
 // ÌáÈ¡string×Ö·û´®
 void parseStringField(const char *data, const char *field, char *value)
 {
+		if(strstr(data, field)==NULL)
+		{
+			value=NULL;
+		}
     char *ptr = strstr(data, field) + strlen(field);
     sscanf(ptr, "%[^\"],", value);
 }

+ 2 - 0
app/App/device_message.h

@@ -76,6 +76,8 @@ typedef struct _GATEWAY_PARAMS
 	uint16_t port;			  // MQTT服务器端口号
 	uint8_t messageTopic[50]; // MQTT消息主题
 	uint8_t commandTopic[50]; // MQTT指令主题
+	uint8_t mqttUserName[20]; //mqtt用户姓名
+	uint8_t mqttPassword[20]; //mqtt 密码
 	uint8_t deviceId[25];	  // 设备ID
 	uint32_t pollTime;		  // 轮询时间
 	uint32_t inboundTime;

+ 36 - 14
app/App/ec800m.c

@@ -5,7 +5,7 @@
 #include "string.h"
 #include "log.h"
 #include "systick.h"
-
+#include "main.h"
 
 void EC800MPwoerOn(void)
 {
@@ -105,6 +105,13 @@ void EC800MSetPDP()
 }
 
 
+#define AT_Open "AT+QFOPEN=\"http.txt\",2 \r\n"
+#define AT_SEEK "AT+QFSEEK=1,0,0\r\n"
+#define AT_128SEEK "AT+QFSEEK=1,128,0\r\n"
+#define AT_128Read "AT+QFREAD=1,128\r\n"
+#define AT_LIST    "AT+QFLST=*\r\n"
+#define AT_QFLDS   "AT+QFLDS=\"UFS\"\r\n"
+//分包宏
 
 
 /*
@@ -117,6 +124,7 @@ void EC800MSetPDP()
 bool EC800MGetUrl(char *url,char *dmaBuffer,uint32_t bufferSize)
 {
 	// Set url
+	
 	char command[100];
 	sprintf(command, CMD_SET_URL, strlen(url)); // CMD_SET_URL "%d\r\n"
 
@@ -142,14 +150,16 @@ bool EC800MGetUrl(char *url,char *dmaBuffer,uint32_t bufferSize)
 
 	// get data from UFS
 	delay_1ms(1000);
-
 	dma_config_change(dmaBuffer,bufferSize);
 	delay_1ms(1000);
 	EC800MSendCmd(CMD_READ_FILE, strlen(CMD_READ_FILE)); //"AT+QFDWL=http.txt\r\n"
 	delay_1ms(6000);
-
+	
 	return true;
+	
 }
+
+
 /*
  *  函数名:void ConnectMQTTSever(uint8_t *host, uint16_t port, uint8_t keepalive, uint8_t *clientid)
  *  输入参数:host:mqtt服务器IP port:mqtt端口,keepalive mqtt心跳时间,clientid设备id
@@ -157,12 +167,12 @@ bool EC800MGetUrl(char *url,char *dmaBuffer,uint32_t bufferSize)
  *  返回值:无
 *  函数作用:与服务器建立连接
  */
-void ConnectMQTTSever(uint8_t *host, uint16_t port, uint8_t keepalive, uint8_t *clientid)
+uint32_t try_connect; //记录尝试与平台建立连接的次数,每次1s当计数到1小时后重启设备
+void ConnectMQTTSever(uint8_t *host, uint16_t port, uint8_t keepalive, uint8_t *clientid,uint8_t *mqttUserName,uint8_t *mqttPassword)
 {
 	char cmd[150];
 	bool success = false;
-	int retry_count = 0;
-
+	try_connect=0;
 	// 主动断开连接
 	EC800MSendCmd(CMD_MQTT_DISCONNECT, 0);
 
@@ -174,26 +184,38 @@ void ConnectMQTTSever(uint8_t *host, uint16_t port, uint8_t keepalive, uint8_t *
 	EC800MSendCmd(cmd, strlen(cmd));
 	WaitResponse(RSP_OK, 0);
 	// EC800MSendCmd(CMD_MQTT_DISCONNECT, 0);
-
+	
 	sprintf(cmd, "AT+QMTOPEN=0,\"%s\",%d\r\n", host, port);
 
 	do
 	{
 		EC800MSendCmd(cmd, strlen(cmd));
 		success = WaitResponse("QMTOPEN: 0,0", 1000);
-		retry_count++;
-	} while (!success && retry_count < 3);
+		delay_1ms(1000);
+		task_fwdgt_reload();
+		try_connect++;
+		if(try_connect==60*60){NVIC_SystemReset();}
+	} while (!success);
 
 	if (success)
 	{
-		retry_count = 0;
-		sprintf(cmd, "AT+QMTCONN=0,\"%s\",\"%s\",\"%s\"\r\n", clientid, "", ""); // 后两个为username password
+		if(mqttUserName==NULL)
+		{
+			sprintf(cmd, "AT+QMTCONN=0,\"%s\",\"%s\",\"%s\"\r\n", clientid, "", ""); // 后两个为username password
+		}
+		else 
+		{
+			sprintf(cmd, "AT+QMTCONN=0,\"%s\",\"%s\",\"%s\"\r\n", clientid, mqttUserName, mqttPassword); // 后两个为username password
+		}
 		do
 		{
 			EC800MSendCmd(cmd, strlen(cmd));
 			success = WaitResponse("QMTCONN: 0,0,0", 1000);
-			retry_count++;
-		} while (!success && retry_count < 3);
+			delay_1ms(1000);
+			task_fwdgt_reload();
+			try_connect++;
+			if(try_connect==60*60){NVIC_SystemReset();}
+		} while (!success);
 	}
 }
 
@@ -321,7 +343,7 @@ void MQTTPublish(void)
 __END__WHILE:
 	if(strlen(payload_out)>40)//小于这个值组成的字符串证明没有数据采集到、就不进行发布
 	{
-		sprintf(payload_out+strlen(payload_out)-1,"]}");
+		sprintf(payload_out+strlen(payload_out)-1,"]}\0");
 		sprintf((char *)mqtt_publish, "AT+QMTPUBEX=0,0,0,0,\"%s\",%d\r\n", gateway->messageTopic, strlen(payload_out));
 		EC800MSendCmd(mqtt_publish, strlen(mqtt_publish));
 		WaitResponse("QMTPUBEX", 1000);	

+ 2 - 1
app/App/ec800m.h

@@ -51,6 +51,7 @@
 #define AT_CMD_T 		"ATI\r\n"
 
 
+
 #define true 1
 #define false 0
 
@@ -60,7 +61,7 @@ void EC800MSendCmd(char *buf, uint16_t len);
 void EC800MWaitReady(void);
 
 bool WaitResponse(char * expectStr, int timeout);
-void ConnectMQTTSever(uint8_t *host,uint16_t port,uint8_t keepalive,uint8_t *clientid);
+void ConnectMQTTSever(uint8_t *host, uint16_t port, uint8_t keepalive, uint8_t *clientid,uint8_t *mqttUserName,uint8_t *mqttPassword);
 void EC800MSetPDP(void);
 
 bool EC800MGetUrl(char *url,char *dmaBuffer,uint32_t bufferSize);

+ 9 - 9
app/App/main.c

@@ -51,23 +51,22 @@ OF SUCH DAMAGE.
 #include "systick.h"
 #include "w25q32.h"
 #include "key.h"
+#include "device_alive.h"
 #define UNIQUE_ID 0x1FFFF7E8
 
 
-#define VERSION "V1.0.1" // 版本号写死、通过人工手动控制
+#define VERSION "V1.2.0" // 版本号写死、通过人工手动控制
 
 #define GATEWAYNAME "DTU"
 #define GATEWAYMODE "4G" // 后续此mode可以切换4g
 
 
-void MQTT_Alarm_clock(uint32_t time, GATEWAY_PARAMS *gateway);
+void MQTT_Alarm_clock(int32_t time, GATEWAY_PARAMS *gateway);
 void readID(char *strId);
 void http_load_config(uint8_t *httpURL);
 void fwdgt_init();
 void task_fwdgt_reload();
 
-
-
 int main(void)
   {
 	/* configure systick */
@@ -117,12 +116,12 @@ int main(void)
 	gd_485_DE_pin_init();
 	gd_485_DE_tx();
 
-	ConnectMQTTSever(gateway->host, gateway->port, 60, gateway->deviceId);
+	ConnectMQTTSever(gateway->host, gateway->port, 60, gateway->deviceId,gateway->mqttUserName,gateway->mqttPassword);
 	MQTTSubTopic(gateway->commandTopic);
 
 	ring_buffer_init(&mqttRecv);
 	mmodbus_init(1);
-	dlt645_init(1);
+	dlt645_init(10);
 
 	//开启看门狗
 //	fwdgt_init();
@@ -140,11 +139,11 @@ int main(void)
  *  函数作用:按照设定好时间进行执行,在未到达指定时间之前重复做led反转、MQTT订阅的主题是否有下发主题信息判断
  * 	当time为0时进行数据采集和数据上传
  */
-void MQTT_Alarm_clock(uint32_t time, GATEWAY_PARAMS *gateway)
+void MQTT_Alarm_clock(int32_t time, GATEWAY_PARAMS *gateway)
 {
 	while (1)
 	{
-		if (time <= 0)
+		if (time <= 0 || time_arrive(15*60*1000))
 		{
 			Read_Data();
 			MQTTPublish();
@@ -155,6 +154,7 @@ void MQTT_Alarm_clock(uint32_t time, GATEWAY_PARAMS *gateway)
 			gd_eval_led_toggle(LED1);
 			parseMQTTData(gateway);
 			check_ota_event();
+			clear_time_flag();
 		}
 		delay_1ms(1000);
 		time-=1000; 
@@ -223,7 +223,7 @@ void http_load_config(uint8_t *httpURL)
 			delay_1ms(1000);
 			EC800MSendCmd(CMD_READ_FILE, strlen(CMD_READ_FILE)); //"AT+QFDWL=http.txt\r\n"
 			delay_1ms(3000);
-			WaitForUpData(dmabuffer);
+			if(WaitForUpData(dmabuffer)==false) goto __LOAD_CONFIG;
 	}
 	dma_config();
 	free(dmabuffer);

+ 0 - 1
app/App/main.h

@@ -48,5 +48,4 @@ OF SUCH DAMAGE.
 void task_fwdgt_reload(void);
 
 
-
 #endif /* MAIN_H */

+ 4 - 0
app/App/mqttRecv.c

@@ -16,6 +16,10 @@ void Receive_MQTT_DataPack(void)
 {
     if (strstr((const char *)UART0_RX_BUF, "QMTRECV") != NULL)
     {
+			if(strstr((const char *)UART0_RX_BUF,"reboot"))
+			{
+				NVIC_SystemReset();//收到了重启标志进行重启
+			}
         UART0_RX_MQTT_SUB_STAT = 1; // MQTT信息标志位
         int i = 0;
         while (UART0_RX_BUF[i] != '{')

+ 55 - 19
app/App/parseDeviceMessage.c

@@ -8,7 +8,7 @@
 #include "log.h"
 #include "ec800m.h"
 #include "main.h"
-
+#include "device_alive.h"
 #define MQTT_SUB_CMD_WRITE 0
 #define MQTT_SUB_CMD_READ 1
 ring_buffer mqttRecv;
@@ -231,18 +231,40 @@ __START__WHILE:
 					{
 						if (rs <= 4)
 						{
-							memcpy(read_dlt645_command->data, read_buf, 4);
-							read_dlt645_command->rxLen = 4;
+							
+							if(memcmp(read_dlt645_command->data,read_buf,4)!=0|| device_time_flag==1)
+							{
+								memcpy(read_dlt645_command->data,read_buf,4);
+								read_dlt645_command->rxLen = 4;
+							}
+							else
+							{
+								read_dlt645_command->rxLen = 0;
+							}
 						}
 						else if (rs == 5)
 						{
-							memcpy(read_dlt645_command->data, read_buf, 5);
-							read_dlt645_command->rxLen = 5;
+							if(memcmp(read_dlt645_command->data,read_buf,5)!=0 || device_time_flag==1) 
+							{
+								memcpy(read_dlt645_command->data,read_buf,5);
+								read_dlt645_command->rxLen = 5;
+							}
+							else
+							{
+								read_dlt645_command->rxLen = 0;
+							}
 						}
 						else if (rs > 5)
 						{
-							memcpy(read_dlt645_command->data, read_buf, 9);
-							read_dlt645_command->rxLen = 9;
+							if(memcmp(read_dlt645_command->data,read_buf,9)!=0|| device_time_flag==1)
+							{
+								memcpy(read_dlt645_command->data,read_buf,9);
+								read_dlt645_command->rxLen = 9;
+							}
+							else
+							{
+								read_dlt645_command->rxLen = 0;
+							}
 						}
 					}
 					else
@@ -280,11 +302,26 @@ __START__WHILE:
 								if(read_modbus_command->decimalPoint!=0)
 								{
 									float convertedValue =(float)value/pow(10,read_modbus_command->decimalPoint);
-									memcpy(read_modbus_command->value,&convertedValue,4);
+									
+									if(memcmp(read_modbus_command->value,&convertedValue,4)!=0|| device_time_flag==1)
+								  {
+										memcpy(read_modbus_command->value,&convertedValue,4);
+								  }
+									else
+									{
+										read_modbus_command->rxLen=0;
+									}
 								}
 								else
 								{
-									memcpy(read_modbus_command->value,&value,4);
+									if(memcmp(read_modbus_command->value,&value,4)!=0|| device_time_flag==1)
+									{
+											memcpy(read_modbus_command->value,&value,4);
+									}
+									else
+									{
+										read_modbus_command->rxLen=0;
+									}
 								}
 							}
 							else
@@ -304,7 +341,14 @@ __START__WHILE:
 						{
 							read_modbus_command->rxLen=4;
 							uint32_t value = (uint32_t)data[0] << 8 | data[1];
-							memcpy(read_modbus_command->value,&value,4);
+							if(memcmp(read_modbus_command->value,&value,4)!=0|| device_time_flag==1)
+							{
+									memcpy(read_modbus_command->value,&value,4);
+							}
+							else
+							{
+								read_modbus_command->rxLen=0;
+							}
 						}
 						else
 						{
@@ -319,6 +363,7 @@ __START__WHILE:
 			}
 				break;
 		}
+		parseMQTTData(gateway);//是否有下发数据有下发优先处理
 		switch(currentDevice->protocol)
 		{
 		  case DLT645_07:
@@ -671,12 +716,3 @@ static uint16_t checksum(const char *str, uint16_t len)
   // 返回校验和
   return sum;
 }
-//比较本次数据和上次数据是否相同如果相同则不进行数据的更新
-int compareWithLastData(char *old_data,const char* new_data,uint8_t dataLen) {
-    if (memcmp(new_data, old_data,dataLen) == 0) {
-        return 0;
-    } else {
-        memcpy(old_data,&new_data,dataLen);;
-        return 1;
-    }
-}

+ 1 - 1
app/App/systick.c

@@ -37,7 +37,7 @@ OF SUCH DAMAGE.
 
 #include "gd32f10x.h"
 #include "systick.h"
-
+#include "device_alive.h"
 volatile static uint32_t delay;
 volatile static int32_t runtime=0;
 /*!

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 1089 - 450
app/Proj/JLinkLog.txt


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 963 - 929
app/Proj/Listings/Ringzle.map


BIN
app/Proj/Objects/Ringzle.axf


BIN
app/Proj/Objects/Ringzle.bin


+ 12 - 3
app/Proj/Objects/Ringzle.build_log.htm

@@ -22,13 +22,22 @@ Dialog DLL:      TCM.DLL V1.36.5.0
  
 <h2>Project:</h2>
 D:\Project\dtu_gateway\app\Proj\Ringzle.uvprojx
-Project File Date:  09/20/2023
+Project File Date:  10/16/2023
 
 <h2>Output:</h2>
 *** Using Compiler 'V5.06 update 6 (build 750)', folder: 'D:\workSoftware\stm32Software\mdk\mdkcore\ARM\ARMCC\Bin'
 Build target 'GD32F103C8T6'
+compiling dlt645_port.c...
+..\dlt\port\dlt645_port.c(125): warning:  #223-D: function "memcpy" declared implicitly
+  			memcpy(msg, &(dlt645_port.rxBuf[4]), len-4);
+..\dlt\port\dlt645_port.c(144): warning:  #223-D: function "memset" declared implicitly
+  	memset(dlt645_port.rxBuf, 0, DLT_RXSIZE);
+..\dlt\port\dlt645_port.c: 2 warnings, 0 errors
+linking...
+Program Size: Code=31968 RO-data=1692 RW-data=236 ZI-data=83260  
+FromELF: creating hex file...
 After Build - User command #1: fromelf --bin --output ./Objects/Ringzle.bin ./Objects/Ringzle.axf
-".\Objects\Ringzle.axf" - 0 Error(s), 0 Warning(s).
+".\Objects\Ringzle.axf" - 0 Error(s), 2 Warning(s).
 
 <h2>Software Packages used:</h2>
 
@@ -42,7 +51,7 @@ Package Vendor: GigaDevice
   D:\workSoftware\stm32Software\mdk\mdkpack\GigaDevice\GD32F10x_DFP\2.0.3\Device\Include
 
 <h2>Collection of Component Files used:</h2>
-Build Time Elapsed:  00:00:00
+Build Time Elapsed:  00:00:01
 </pre>
 </body>
 </html>

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 1077 - 1042
app/Proj/Objects/Ringzle.htm


+ 1 - 0
app/Proj/Objects/Ringzle.lnp

@@ -12,6 +12,7 @@
 ".\objects\main.o"
 ".\objects\pc.o"
 ".\objects\otaevent.o"
+".\objects\device_alive.o"
 ".\objects\gd32f10x_adc.o"
 ".\objects\gd32f10x_bkp.o"
 ".\objects\gd32f10x_can.o"

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 35 - 25
app/Proj/Objects/Ringzle_GD32F103C8T6.dep


BIN
app/Proj/Objects/device_message.crf


+ 0 - 7
app/Proj/Objects/dhcp.d

@@ -1,7 +0,0 @@
-.\objects\dhcp.o: ..\internet\W5500\dhcp.c
-.\objects\dhcp.o: ..\internet\W5500\socket.h
-.\objects\dhcp.o: ..\internet\W5500\wizchip_conf.h
-.\objects\dhcp.o: D:\workSoftware\stm32Software\mdk\mdkcore\ARM\ARMCC\Bin\..\include\stdint.h
-.\objects\dhcp.o: ..\internet\W5500\w5500.h
-.\objects\dhcp.o: ..\internet\W5500\wizchip_conf.h
-.\objects\dhcp.o: ..\internet\W5500\dhcp.h

BIN
app/Proj/Objects/dlt645_port.crf


+ 0 - 9
app/Proj/Objects/dns.d

@@ -1,9 +0,0 @@
-.\objects\dns.o: ..\internet\W5500\dns.c
-.\objects\dns.o: D:\workSoftware\stm32Software\mdk\mdkcore\ARM\ARMCC\Bin\..\include\string.h
-.\objects\dns.o: D:\workSoftware\stm32Software\mdk\mdkcore\ARM\ARMCC\Bin\..\include\stdlib.h
-.\objects\dns.o: ..\internet\W5500\socket.h
-.\objects\dns.o: ..\internet\W5500\wizchip_conf.h
-.\objects\dns.o: D:\workSoftware\stm32Software\mdk\mdkcore\ARM\ARMCC\Bin\..\include\stdint.h
-.\objects\dns.o: ..\internet\W5500\w5500.h
-.\objects\dns.o: ..\internet\W5500\wizchip_conf.h
-.\objects\dns.o: ..\internet\W5500\dns.h

BIN
app/Proj/Objects/ec800m.crf


+ 1 - 0
app/Proj/Objects/ec800m.d

@@ -40,3 +40,4 @@
 .\objects\ec800m.o: D:\workSoftware\stm32Software\mdk\mdkcore\ARM\ARMCC\Bin\..\include\string.h
 .\objects\ec800m.o: ..\App\log.h
 .\objects\ec800m.o: D:\workSoftware\stm32Software\mdk\mdkcore\ARM\ARMCC\Bin\..\include\stdarg.h
+.\objects\ec800m.o: ..\App\main.h

BIN
app/Proj/Objects/gd32f10x_it.crf


BIN
app/Proj/Objects/key.crf


BIN
app/Proj/Objects/main.crf


+ 1 - 0
app/Proj/Objects/main.d

@@ -52,3 +52,4 @@
 .\objects\main.o: ..\App\otaEvent.h
 .\objects\main.o: ..\bsp\w25q32.h
 .\objects\main.o: ..\bsp\key.h
+.\objects\main.o: ..\App\device_alive.h

BIN
app/Proj/Objects/mqttrecv.crf


BIN
app/Proj/Objects/otaevent.crf


BIN
app/Proj/Objects/parsedevicemessage.crf


+ 1 - 0
app/Proj/Objects/parsedevicemessage.d

@@ -53,3 +53,4 @@
 .\objects\parsedevicemessage.o: ..\App\mqttRecv.h
 .\objects\parsedevicemessage.o: ..\App\ec800m.h
 .\objects\parsedevicemessage.o: ..\App\main.h
+.\objects\parsedevicemessage.o: ..\App\device_alive.h

BIN
app/Proj/Objects/pc.crf


+ 0 - 39
app/Proj/Objects/socket.d

@@ -1,39 +0,0 @@
-.\objects\socket.o: ..\internet\W5500\socket.c
-.\objects\socket.o: ..\App\main.h
-.\objects\socket.o: D:\workSoftware\stm32Software\mdk\mdkcore\ARM\ARMCC\Bin\..\include\stdint.h
-.\objects\socket.o: ..\bsp\usart.h
-.\objects\socket.o: ..\CMSIS\gd32f10x.h
-.\objects\socket.o: ..\CMSIS\core_cm3.h
-.\objects\socket.o: ..\CMSIS\core_cmInstr.h
-.\objects\socket.o: ..\CMSIS\core_cmFunc.h
-.\objects\socket.o: ..\CMSIS\system_gd32f10x.h
-.\objects\socket.o: ..\CMSIS\gd32f10x_libopt.h
-.\objects\socket.o: ..\Firmware\Include\gd32f10x_fmc.h
-.\objects\socket.o: ..\CMSIS\gd32f10x.h
-.\objects\socket.o: ..\Firmware\Include\gd32f10x_pmu.h
-.\objects\socket.o: ..\Firmware\Include\gd32f10x_bkp.h
-.\objects\socket.o: ..\Firmware\Include\gd32f10x_rcu.h
-.\objects\socket.o: ..\Firmware\Include\gd32f10x_exti.h
-.\objects\socket.o: ..\Firmware\Include\gd32f10x_gpio.h
-.\objects\socket.o: ..\Firmware\Include\gd32f10x_crc.h
-.\objects\socket.o: ..\Firmware\Include\gd32f10x_dma.h
-.\objects\socket.o: ..\Firmware\Include\gd32f10x_dbg.h
-.\objects\socket.o: ..\Firmware\Include\gd32f10x_adc.h
-.\objects\socket.o: ..\Firmware\Include\gd32f10x_dac.h
-.\objects\socket.o: ..\Firmware\Include\gd32f10x_fwdgt.h
-.\objects\socket.o: ..\Firmware\Include\gd32f10x_wwdgt.h
-.\objects\socket.o: ..\Firmware\Include\gd32f10x_rtc.h
-.\objects\socket.o: ..\Firmware\Include\gd32f10x_timer.h
-.\objects\socket.o: ..\Firmware\Include\gd32f10x_usart.h
-.\objects\socket.o: ..\Firmware\Include\gd32f10x_i2c.h
-.\objects\socket.o: ..\Firmware\Include\gd32f10x_spi.h
-.\objects\socket.o: ..\Firmware\Include\gd32f10x_sdio.h
-.\objects\socket.o: ..\Firmware\Include\gd32f10x_exmc.h
-.\objects\socket.o: ..\Firmware\Include\gd32f10x_can.h
-.\objects\socket.o: ..\Firmware\Include\gd32f10x_enet.h
-.\objects\socket.o: D:\workSoftware\stm32Software\mdk\mdkcore\ARM\ARMCC\Bin\..\include\stdlib.h
-.\objects\socket.o: ..\Firmware\Include\gd32f10x_misc.h
-.\objects\socket.o: ..\internet\W5500\socket.h
-.\objects\socket.o: ..\internet\W5500\wizchip_conf.h
-.\objects\socket.o: ..\internet\W5500\w5500.h
-.\objects\socket.o: ..\internet\W5500\wizchip_conf.h

BIN
app/Proj/Objects/systick.crf


+ 2 - 0
app/Proj/Objects/systick.d

@@ -32,3 +32,5 @@
 .\objects\systick.o: D:\workSoftware\stm32Software\mdk\mdkcore\ARM\ARMCC\Bin\..\include\stdlib.h
 .\objects\systick.o: ..\Firmware\Include\gd32f10x_misc.h
 .\objects\systick.o: ..\App\systick.h
+.\objects\systick.o: ..\App\device_alive.h
+.\objects\systick.o: D:\workSoftware\stm32Software\mdk\mdkcore\ARM\ARMCC\Bin\..\include\stdbool.h

+ 0 - 38
app/Proj/Objects/w5500.d

@@ -1,38 +0,0 @@
-.\objects\w5500.o: ..\internet\W5500\w5500.c
-.\objects\w5500.o: ..\App\main.h
-.\objects\w5500.o: D:\workSoftware\stm32Software\mdk\mdkcore\ARM\ARMCC\Bin\..\include\stdint.h
-.\objects\w5500.o: ..\internet\W5500\w5500.h
-.\objects\w5500.o: ..\internet\W5500\wizchip_conf.h
-.\objects\w5500.o: ..\internet\W5500\w5500.h
-.\objects\w5500.o: D:\workSoftware\stm32Software\mdk\mdkcore\ARM\ARMCC\Bin\..\include\stdio.h
-.\objects\w5500.o: ..\CMSIS\gd32f10x.h
-.\objects\w5500.o: ..\CMSIS\core_cm3.h
-.\objects\w5500.o: ..\CMSIS\core_cmInstr.h
-.\objects\w5500.o: ..\CMSIS\core_cmFunc.h
-.\objects\w5500.o: ..\CMSIS\system_gd32f10x.h
-.\objects\w5500.o: ..\CMSIS\gd32f10x_libopt.h
-.\objects\w5500.o: ..\Firmware\Include\gd32f10x_fmc.h
-.\objects\w5500.o: ..\CMSIS\gd32f10x.h
-.\objects\w5500.o: ..\Firmware\Include\gd32f10x_pmu.h
-.\objects\w5500.o: ..\Firmware\Include\gd32f10x_bkp.h
-.\objects\w5500.o: ..\Firmware\Include\gd32f10x_rcu.h
-.\objects\w5500.o: ..\Firmware\Include\gd32f10x_exti.h
-.\objects\w5500.o: ..\Firmware\Include\gd32f10x_gpio.h
-.\objects\w5500.o: ..\Firmware\Include\gd32f10x_crc.h
-.\objects\w5500.o: ..\Firmware\Include\gd32f10x_dma.h
-.\objects\w5500.o: ..\Firmware\Include\gd32f10x_dbg.h
-.\objects\w5500.o: ..\Firmware\Include\gd32f10x_adc.h
-.\objects\w5500.o: ..\Firmware\Include\gd32f10x_dac.h
-.\objects\w5500.o: ..\Firmware\Include\gd32f10x_fwdgt.h
-.\objects\w5500.o: ..\Firmware\Include\gd32f10x_wwdgt.h
-.\objects\w5500.o: ..\Firmware\Include\gd32f10x_rtc.h
-.\objects\w5500.o: ..\Firmware\Include\gd32f10x_timer.h
-.\objects\w5500.o: ..\Firmware\Include\gd32f10x_usart.h
-.\objects\w5500.o: ..\Firmware\Include\gd32f10x_i2c.h
-.\objects\w5500.o: ..\Firmware\Include\gd32f10x_spi.h
-.\objects\w5500.o: ..\Firmware\Include\gd32f10x_sdio.h
-.\objects\w5500.o: ..\Firmware\Include\gd32f10x_exmc.h
-.\objects\w5500.o: ..\Firmware\Include\gd32f10x_can.h
-.\objects\w5500.o: ..\Firmware\Include\gd32f10x_enet.h
-.\objects\w5500.o: D:\workSoftware\stm32Software\mdk\mdkcore\ARM\ARMCC\Bin\..\include\stdlib.h
-.\objects\w5500.o: ..\Firmware\Include\gd32f10x_misc.h

+ 0 - 38
app/Proj/Objects/wizchip_conf.d

@@ -1,38 +0,0 @@
-.\objects\wizchip_conf.o: ..\internet\W5500\wizchip_conf.c
-.\objects\wizchip_conf.o: D:\workSoftware\stm32Software\mdk\mdkcore\ARM\ARMCC\Bin\..\include\stddef.h
-.\objects\wizchip_conf.o: ..\bsp\usart.h
-.\objects\wizchip_conf.o: ..\CMSIS\gd32f10x.h
-.\objects\wizchip_conf.o: ..\CMSIS\core_cm3.h
-.\objects\wizchip_conf.o: D:\workSoftware\stm32Software\mdk\mdkcore\ARM\ARMCC\Bin\..\include\stdint.h
-.\objects\wizchip_conf.o: ..\CMSIS\core_cmInstr.h
-.\objects\wizchip_conf.o: ..\CMSIS\core_cmFunc.h
-.\objects\wizchip_conf.o: ..\CMSIS\system_gd32f10x.h
-.\objects\wizchip_conf.o: ..\CMSIS\gd32f10x_libopt.h
-.\objects\wizchip_conf.o: ..\Firmware\Include\gd32f10x_fmc.h
-.\objects\wizchip_conf.o: ..\CMSIS\gd32f10x.h
-.\objects\wizchip_conf.o: ..\Firmware\Include\gd32f10x_pmu.h
-.\objects\wizchip_conf.o: ..\Firmware\Include\gd32f10x_bkp.h
-.\objects\wizchip_conf.o: ..\Firmware\Include\gd32f10x_rcu.h
-.\objects\wizchip_conf.o: ..\Firmware\Include\gd32f10x_exti.h
-.\objects\wizchip_conf.o: ..\Firmware\Include\gd32f10x_gpio.h
-.\objects\wizchip_conf.o: ..\Firmware\Include\gd32f10x_crc.h
-.\objects\wizchip_conf.o: ..\Firmware\Include\gd32f10x_dma.h
-.\objects\wizchip_conf.o: ..\Firmware\Include\gd32f10x_dbg.h
-.\objects\wizchip_conf.o: ..\Firmware\Include\gd32f10x_adc.h
-.\objects\wizchip_conf.o: ..\Firmware\Include\gd32f10x_dac.h
-.\objects\wizchip_conf.o: ..\Firmware\Include\gd32f10x_fwdgt.h
-.\objects\wizchip_conf.o: ..\Firmware\Include\gd32f10x_wwdgt.h
-.\objects\wizchip_conf.o: ..\Firmware\Include\gd32f10x_rtc.h
-.\objects\wizchip_conf.o: ..\Firmware\Include\gd32f10x_timer.h
-.\objects\wizchip_conf.o: ..\Firmware\Include\gd32f10x_usart.h
-.\objects\wizchip_conf.o: ..\Firmware\Include\gd32f10x_i2c.h
-.\objects\wizchip_conf.o: ..\Firmware\Include\gd32f10x_spi.h
-.\objects\wizchip_conf.o: ..\Firmware\Include\gd32f10x_sdio.h
-.\objects\wizchip_conf.o: ..\Firmware\Include\gd32f10x_exmc.h
-.\objects\wizchip_conf.o: ..\Firmware\Include\gd32f10x_can.h
-.\objects\wizchip_conf.o: ..\Firmware\Include\gd32f10x_enet.h
-.\objects\wizchip_conf.o: D:\workSoftware\stm32Software\mdk\mdkcore\ARM\ARMCC\Bin\..\include\stdlib.h
-.\objects\wizchip_conf.o: ..\Firmware\Include\gd32f10x_misc.h
-.\objects\wizchip_conf.o: ..\internet\W5500\wizchip_conf.h
-.\objects\wizchip_conf.o: ..\internet\W5500\w5500.h
-.\objects\wizchip_conf.o: ..\internet\W5500\wizchip_conf.h

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 195 - 195
app/Proj/Ringzle.uvguix.16936


+ 66 - 70
app/Proj/Ringzle.uvoptx

@@ -157,73 +157,57 @@
         <Bp>
           <Number>0</Number>
           <Type>0</Type>
-          <LineNumber>374</LineNumber>
+          <LineNumber>124</LineNumber>
           <EnabledFlag>1</EnabledFlag>
-          <Address>134261490</Address>
+          <Address>134256344</Address>
           <ByteObject>0</ByteObject>
           <HtxType>0</HtxType>
           <ManyObjects>0</ManyObjects>
           <SizeOfObject>0</SizeOfObject>
           <BreakByAccess>0</BreakByAccess>
           <BreakIfRCount>1</BreakIfRCount>
-          <Filename>..\App\parseDeviceMessage.c</Filename>
+          <Filename>..\dlt\port\dlt645_port.c</Filename>
           <ExecCommand></ExecCommand>
-          <Expression>\\Ringzle\../App/parseDeviceMessage.c\374</Expression>
+          <Expression>\\Ringzle\../dlt/port/dlt645_port.c\124</Expression>
         </Bp>
         <Bp>
           <Number>1</Number>
           <Type>0</Type>
-          <LineNumber>110</LineNumber>
+          <LineNumber>419</LineNumber>
           <EnabledFlag>1</EnabledFlag>
-          <Address>134259474</Address>
+          <Address>134261850</Address>
           <ByteObject>0</ByteObject>
           <HtxType>0</HtxType>
           <ManyObjects>0</ManyObjects>
           <SizeOfObject>0</SizeOfObject>
           <BreakByAccess>0</BreakByAccess>
           <BreakIfRCount>1</BreakIfRCount>
-          <Filename>..\App\main.c</Filename>
+          <Filename>..\App\parseDeviceMessage.c</Filename>
           <ExecCommand></ExecCommand>
-          <Expression>\\Ringzle\../App/main.c\110</Expression>
+          <Expression>\\Ringzle\../App/parseDeviceMessage.c\419</Expression>
         </Bp>
         <Bp>
           <Number>2</Number>
           <Type>0</Type>
-          <LineNumber>149</LineNumber>
+          <LineNumber>123</LineNumber>
           <EnabledFlag>1</EnabledFlag>
-          <Address>134245918</Address>
+          <Address>0</Address>
           <ByteObject>0</ByteObject>
           <HtxType>0</HtxType>
           <ManyObjects>0</ManyObjects>
           <SizeOfObject>0</SizeOfObject>
           <BreakByAccess>0</BreakByAccess>
-          <BreakIfRCount>1</BreakIfRCount>
-          <Filename>..\App\main.c</Filename>
+          <BreakIfRCount>0</BreakIfRCount>
+          <Filename>..\dlt\port\dlt645_port.c</Filename>
           <ExecCommand></ExecCommand>
-          <Expression>\\Ringzle\../App/main.c\149</Expression>
-        </Bp>
-        <Bp>
-          <Number>3</Number>
-          <Type>0</Type>
-          <LineNumber>94</LineNumber>
-          <EnabledFlag>1</EnabledFlag>
-          <Address>134259392</Address>
-          <ByteObject>0</ByteObject>
-          <HtxType>0</HtxType>
-          <ManyObjects>0</ManyObjects>
-          <SizeOfObject>0</SizeOfObject>
-          <BreakByAccess>0</BreakByAccess>
-          <BreakIfRCount>1</BreakIfRCount>
-          <Filename>..\App\main.c</Filename>
-          <ExecCommand></ExecCommand>
-          <Expression>\\Ringzle\../App/main.c\94</Expression>
+          <Expression></Expression>
         </Bp>
       </Breakpoint>
       <MemoryWindow1>
         <Mm>
           <WinNumber>1</WinNumber>
-          <SubType>8</SubType>
-          <ItemText>dmaBuffer</ItemText>
+          <SubType>3</SubType>
+          <ItemText>&amp;dlt645_port.index</ItemText>
           <AccSizeX>0</AccSizeX>
         </Mm>
       </MemoryWindow1>
@@ -314,7 +298,7 @@
 
   <Group>
     <GroupName>App</GroupName>
-    <tvExp>0</tvExp>
+    <tvExp>1</tvExp>
     <tvExpOptDlg>0</tvExpOptDlg>
     <cbSel>0</cbSel>
     <RteFlg>0</RteFlg>
@@ -450,6 +434,18 @@
       <RteFlg>0</RteFlg>
       <bShared>0</bShared>
     </File>
+    <File>
+      <GroupNumber>3</GroupNumber>
+      <FileNumber>14</FileNumber>
+      <FileType>1</FileType>
+      <tvExp>0</tvExp>
+      <tvExpOptDlg>0</tvExpOptDlg>
+      <bDave2>0</bDave2>
+      <PathWithFileName>..\App\device_alive.c</PathWithFileName>
+      <FilenameWithoutPath>device_alive.c</FilenameWithoutPath>
+      <RteFlg>0</RteFlg>
+      <bShared>0</bShared>
+    </File>
   </Group>
 
   <Group>
@@ -460,7 +456,7 @@
     <RteFlg>0</RteFlg>
     <File>
       <GroupNumber>4</GroupNumber>
-      <FileNumber>14</FileNumber>
+      <FileNumber>15</FileNumber>
       <FileType>1</FileType>
       <tvExp>0</tvExp>
       <tvExpOptDlg>0</tvExpOptDlg>
@@ -472,7 +468,7 @@
     </File>
     <File>
       <GroupNumber>4</GroupNumber>
-      <FileNumber>15</FileNumber>
+      <FileNumber>16</FileNumber>
       <FileType>1</FileType>
       <tvExp>0</tvExp>
       <tvExpOptDlg>0</tvExpOptDlg>
@@ -484,7 +480,7 @@
     </File>
     <File>
       <GroupNumber>4</GroupNumber>
-      <FileNumber>16</FileNumber>
+      <FileNumber>17</FileNumber>
       <FileType>1</FileType>
       <tvExp>0</tvExp>
       <tvExpOptDlg>0</tvExpOptDlg>
@@ -496,7 +492,7 @@
     </File>
     <File>
       <GroupNumber>4</GroupNumber>
-      <FileNumber>17</FileNumber>
+      <FileNumber>18</FileNumber>
       <FileType>1</FileType>
       <tvExp>0</tvExp>
       <tvExpOptDlg>0</tvExpOptDlg>
@@ -508,7 +504,7 @@
     </File>
     <File>
       <GroupNumber>4</GroupNumber>
-      <FileNumber>18</FileNumber>
+      <FileNumber>19</FileNumber>
       <FileType>1</FileType>
       <tvExp>0</tvExp>
       <tvExpOptDlg>0</tvExpOptDlg>
@@ -520,7 +516,7 @@
     </File>
     <File>
       <GroupNumber>4</GroupNumber>
-      <FileNumber>19</FileNumber>
+      <FileNumber>20</FileNumber>
       <FileType>1</FileType>
       <tvExp>0</tvExp>
       <tvExpOptDlg>0</tvExpOptDlg>
@@ -532,7 +528,7 @@
     </File>
     <File>
       <GroupNumber>4</GroupNumber>
-      <FileNumber>20</FileNumber>
+      <FileNumber>21</FileNumber>
       <FileType>1</FileType>
       <tvExp>0</tvExp>
       <tvExpOptDlg>0</tvExpOptDlg>
@@ -544,7 +540,7 @@
     </File>
     <File>
       <GroupNumber>4</GroupNumber>
-      <FileNumber>21</FileNumber>
+      <FileNumber>22</FileNumber>
       <FileType>1</FileType>
       <tvExp>0</tvExp>
       <tvExpOptDlg>0</tvExpOptDlg>
@@ -556,7 +552,7 @@
     </File>
     <File>
       <GroupNumber>4</GroupNumber>
-      <FileNumber>22</FileNumber>
+      <FileNumber>23</FileNumber>
       <FileType>1</FileType>
       <tvExp>0</tvExp>
       <tvExpOptDlg>0</tvExpOptDlg>
@@ -568,7 +564,7 @@
     </File>
     <File>
       <GroupNumber>4</GroupNumber>
-      <FileNumber>23</FileNumber>
+      <FileNumber>24</FileNumber>
       <FileType>1</FileType>
       <tvExp>0</tvExp>
       <tvExpOptDlg>0</tvExpOptDlg>
@@ -580,7 +576,7 @@
     </File>
     <File>
       <GroupNumber>4</GroupNumber>
-      <FileNumber>24</FileNumber>
+      <FileNumber>25</FileNumber>
       <FileType>1</FileType>
       <tvExp>0</tvExp>
       <tvExpOptDlg>0</tvExpOptDlg>
@@ -592,7 +588,7 @@
     </File>
     <File>
       <GroupNumber>4</GroupNumber>
-      <FileNumber>25</FileNumber>
+      <FileNumber>26</FileNumber>
       <FileType>1</FileType>
       <tvExp>0</tvExp>
       <tvExpOptDlg>0</tvExpOptDlg>
@@ -604,7 +600,7 @@
     </File>
     <File>
       <GroupNumber>4</GroupNumber>
-      <FileNumber>26</FileNumber>
+      <FileNumber>27</FileNumber>
       <FileType>1</FileType>
       <tvExp>0</tvExp>
       <tvExpOptDlg>0</tvExpOptDlg>
@@ -616,7 +612,7 @@
     </File>
     <File>
       <GroupNumber>4</GroupNumber>
-      <FileNumber>27</FileNumber>
+      <FileNumber>28</FileNumber>
       <FileType>1</FileType>
       <tvExp>0</tvExp>
       <tvExpOptDlg>0</tvExpOptDlg>
@@ -628,7 +624,7 @@
     </File>
     <File>
       <GroupNumber>4</GroupNumber>
-      <FileNumber>28</FileNumber>
+      <FileNumber>29</FileNumber>
       <FileType>1</FileType>
       <tvExp>0</tvExp>
       <tvExpOptDlg>0</tvExpOptDlg>
@@ -640,7 +636,7 @@
     </File>
     <File>
       <GroupNumber>4</GroupNumber>
-      <FileNumber>29</FileNumber>
+      <FileNumber>30</FileNumber>
       <FileType>1</FileType>
       <tvExp>0</tvExp>
       <tvExpOptDlg>0</tvExpOptDlg>
@@ -652,7 +648,7 @@
     </File>
     <File>
       <GroupNumber>4</GroupNumber>
-      <FileNumber>30</FileNumber>
+      <FileNumber>31</FileNumber>
       <FileType>1</FileType>
       <tvExp>0</tvExp>
       <tvExpOptDlg>0</tvExpOptDlg>
@@ -664,7 +660,7 @@
     </File>
     <File>
       <GroupNumber>4</GroupNumber>
-      <FileNumber>31</FileNumber>
+      <FileNumber>32</FileNumber>
       <FileType>1</FileType>
       <tvExp>0</tvExp>
       <tvExpOptDlg>0</tvExpOptDlg>
@@ -676,7 +672,7 @@
     </File>
     <File>
       <GroupNumber>4</GroupNumber>
-      <FileNumber>32</FileNumber>
+      <FileNumber>33</FileNumber>
       <FileType>1</FileType>
       <tvExp>0</tvExp>
       <tvExpOptDlg>0</tvExpOptDlg>
@@ -688,7 +684,7 @@
     </File>
     <File>
       <GroupNumber>4</GroupNumber>
-      <FileNumber>33</FileNumber>
+      <FileNumber>34</FileNumber>
       <FileType>1</FileType>
       <tvExp>0</tvExp>
       <tvExpOptDlg>0</tvExpOptDlg>
@@ -700,7 +696,7 @@
     </File>
     <File>
       <GroupNumber>4</GroupNumber>
-      <FileNumber>34</FileNumber>
+      <FileNumber>35</FileNumber>
       <FileType>1</FileType>
       <tvExp>0</tvExp>
       <tvExpOptDlg>0</tvExpOptDlg>
@@ -712,7 +708,7 @@
     </File>
     <File>
       <GroupNumber>4</GroupNumber>
-      <FileNumber>35</FileNumber>
+      <FileNumber>36</FileNumber>
       <FileType>1</FileType>
       <tvExp>0</tvExp>
       <tvExpOptDlg>0</tvExpOptDlg>
@@ -724,7 +720,7 @@
     </File>
     <File>
       <GroupNumber>4</GroupNumber>
-      <FileNumber>36</FileNumber>
+      <FileNumber>37</FileNumber>
       <FileType>1</FileType>
       <tvExp>0</tvExp>
       <tvExpOptDlg>0</tvExpOptDlg>
@@ -738,13 +734,13 @@
 
   <Group>
     <GroupName>bsp</GroupName>
-    <tvExp>0</tvExp>
+    <tvExp>1</tvExp>
     <tvExpOptDlg>0</tvExpOptDlg>
     <cbSel>0</cbSel>
     <RteFlg>0</RteFlg>
     <File>
       <GroupNumber>5</GroupNumber>
-      <FileNumber>37</FileNumber>
+      <FileNumber>38</FileNumber>
       <FileType>1</FileType>
       <tvExp>0</tvExp>
       <tvExpOptDlg>0</tvExpOptDlg>
@@ -756,7 +752,7 @@
     </File>
     <File>
       <GroupNumber>5</GroupNumber>
-      <FileNumber>38</FileNumber>
+      <FileNumber>39</FileNumber>
       <FileType>1</FileType>
       <tvExp>0</tvExp>
       <tvExpOptDlg>0</tvExpOptDlg>
@@ -768,7 +764,7 @@
     </File>
     <File>
       <GroupNumber>5</GroupNumber>
-      <FileNumber>39</FileNumber>
+      <FileNumber>40</FileNumber>
       <FileType>1</FileType>
       <tvExp>0</tvExp>
       <tvExpOptDlg>0</tvExpOptDlg>
@@ -780,7 +776,7 @@
     </File>
     <File>
       <GroupNumber>5</GroupNumber>
-      <FileNumber>40</FileNumber>
+      <FileNumber>41</FileNumber>
       <FileType>1</FileType>
       <tvExp>0</tvExp>
       <tvExpOptDlg>0</tvExpOptDlg>
@@ -792,7 +788,7 @@
     </File>
     <File>
       <GroupNumber>5</GroupNumber>
-      <FileNumber>41</FileNumber>
+      <FileNumber>42</FileNumber>
       <FileType>1</FileType>
       <tvExp>0</tvExp>
       <tvExpOptDlg>0</tvExpOptDlg>
@@ -804,7 +800,7 @@
     </File>
     <File>
       <GroupNumber>5</GroupNumber>
-      <FileNumber>42</FileNumber>
+      <FileNumber>43</FileNumber>
       <FileType>1</FileType>
       <tvExp>0</tvExp>
       <tvExpOptDlg>0</tvExpOptDlg>
@@ -824,7 +820,7 @@
     <RteFlg>0</RteFlg>
     <File>
       <GroupNumber>6</GroupNumber>
-      <FileNumber>43</FileNumber>
+      <FileNumber>44</FileNumber>
       <FileType>1</FileType>
       <tvExp>0</tvExp>
       <tvExpOptDlg>0</tvExpOptDlg>
@@ -838,13 +834,13 @@
 
   <Group>
     <GroupName>dlt</GroupName>
-    <tvExp>0</tvExp>
+    <tvExp>1</tvExp>
     <tvExpOptDlg>0</tvExpOptDlg>
     <cbSel>0</cbSel>
     <RteFlg>0</RteFlg>
     <File>
       <GroupNumber>7</GroupNumber>
-      <FileNumber>44</FileNumber>
+      <FileNumber>45</FileNumber>
       <FileType>1</FileType>
       <tvExp>0</tvExp>
       <tvExpOptDlg>0</tvExpOptDlg>
@@ -856,7 +852,7 @@
     </File>
     <File>
       <GroupNumber>7</GroupNumber>
-      <FileNumber>45</FileNumber>
+      <FileNumber>46</FileNumber>
       <FileType>1</FileType>
       <tvExp>0</tvExp>
       <tvExpOptDlg>0</tvExpOptDlg>
@@ -868,7 +864,7 @@
     </File>
     <File>
       <GroupNumber>7</GroupNumber>
-      <FileNumber>46</FileNumber>
+      <FileNumber>47</FileNumber>
       <FileType>1</FileType>
       <tvExp>0</tvExp>
       <tvExpOptDlg>0</tvExpOptDlg>
@@ -880,7 +876,7 @@
     </File>
     <File>
       <GroupNumber>7</GroupNumber>
-      <FileNumber>47</FileNumber>
+      <FileNumber>48</FileNumber>
       <FileType>1</FileType>
       <tvExp>0</tvExp>
       <tvExpOptDlg>0</tvExpOptDlg>
@@ -892,7 +888,7 @@
     </File>
     <File>
       <GroupNumber>7</GroupNumber>
-      <FileNumber>48</FileNumber>
+      <FileNumber>49</FileNumber>
       <FileType>1</FileType>
       <tvExp>0</tvExp>
       <tvExpOptDlg>0</tvExpOptDlg>
@@ -912,7 +908,7 @@
     <RteFlg>0</RteFlg>
     <File>
       <GroupNumber>8</GroupNumber>
-      <FileNumber>49</FileNumber>
+      <FileNumber>50</FileNumber>
       <FileType>5</FileType>
       <tvExp>0</tvExp>
       <tvExpOptDlg>0</tvExpOptDlg>

+ 5 - 0
app/Proj/Ringzle.uvprojx

@@ -457,6 +457,11 @@
               <FileType>1</FileType>
               <FilePath>..\App\otaEvent.c</FilePath>
             </File>
+            <File>
+              <FileName>device_alive.c</FileName>
+              <FileType>1</FileType>
+              <FilePath>..\App\device_alive.c</FilePath>
+            </File>
           </Files>
         </Group>
         <Group>

+ 45 - 4
app/dlt/port/dlt645_port.c

@@ -34,7 +34,7 @@ static dlt645_port_t dlt645_port;
 
 // dlt645 环境结构体
 dlt645_t dlt645;
-
+#if 1
 void dlt_callback()
 {
 	if (RESET != usart_interrupt_flag_get(DLT645_USART, USART_INT_FLAG_RBNE))
@@ -48,12 +48,20 @@ void dlt_callback()
 		{
 			usart_data_receive(DLT645_USART);
 		}
+		usart_interrupt_flag_clear(DLT645_USART, USART_INT_FLAG_RBNE);
 	}
 	if ((dlt645_port.index > 0) && RESET != usart_interrupt_flag_get(DLT645_USART, USART_INT_FLAG_IDLE))
 	{
 		usart_interrupt_flag_clear(DLT645_USART, USART_INT_FLAG_IDLE);
 		usart_data_receive(DLT645_USART);
-		dlt645_port.done = 1;
+		if(dlt645_port.rxBuf[dlt645_port.index-1]!=0x16)//增加一步结束符判断解决部分电表数据不连贯问题
+		{
+			dlt645_port.done=0;
+		}
+		else
+		{
+			dlt645_port.done = 1;
+		}
 		return;
 	}
 	else
@@ -61,9 +69,42 @@ void dlt_callback()
 		usart_interrupt_flag_clear(DLT645_USART, USART_INT_FLAG_RBNE);
 	}
 }
+#else
+//针对部分老电表发数据包中间出现卡断数据包做的特殊处理
+static uint32_t data_time;
+static uint32_t data_time_sum[10];
+	void dlt_callback()
+	{
+		if (RESET != usart_interrupt_flag_get(DLT645_USART, USART_INT_FLAG_RBNE))
+		{
+			data_time=gettick();//获取最后一次得到数据的时间
+			data_time_sum[dlt645_port.index]=data_time;
+			if (dlt645_port.index < DLT_RXSIZE - 1)
+			{
+					dlt645_port.rxBuf[dlt645_port.index] = usart_data_receive(DLT645_USART);
+					dlt645_port.index++;
+				}
+			usart_interrupt_flag_clear(DLT645_USART, USART_INT_FLAG_RBNE);
+		}
+	
+		if(gettick()-data_time>2000 && data_time!=0)
+		{
+			uint32_t nowtime=gettick();
+			data_time=0;
+			usart_interrupt_flag_clear(DLT645_USART, USART_INT_FLAG_IDLE);
+			usart_data_receive(DLT645_USART);
+			dlt645_port.done = 1;
+			return;
+		}
+		else
+		{
+			usart_interrupt_flag_clear(DLT645_USART, USART_INT_FLAG_RBNE);
+		}
+	}
+#endif
 /**
  * Name:    dlt645_hw_read
- * Brief:   dlt645 硬件层接收数据
+  * Brief:   dlt645 硬件层接收数据
  * Input:
  *  @ctx:   645运行环境
  *  @msg:   接收数据存放地址
@@ -99,7 +140,7 @@ static int dlt645_hw_read(dlt645_t *ctx, uint8_t *msg, uint16_t len)
  */
 static int dlt645_hw_write(dlt645_t *ctx, uint8_t *buf, uint16_t len)
 {
-
+	delay_1ms(1000);
 	memset(dlt645_port.rxBuf, 0, DLT_RXSIZE);
 	gpio_bit_set(DLT645_CTRL_GPIO, DLT645_CTRL_PIN);
 	for (uint16_t i = 0; i < len; i++)

+ 3 - 4
版本信息.txt

@@ -1,4 +1,3 @@
-1.1.0
-修改整体格式层级关系,
-以及减小dma空间占用量瞬时大空间获取后释放
-修改
+规则:三层级第一层为大更新,第二层为新功能增加,第三层为bug修改
+1.1.0:修改整体格式层级关系,以及减小dma空间占用量瞬时大空间获取后释放
+1.2.0:修改数据上发规则,每次读出新数据和上次数据进行匹配,只传突变数据,并增加设备心跳