diff --git a/applications/cfg.ini b/applications/cfg.ini index 8493fdf..b652ccd 100644 --- a/applications/cfg.ini +++ b/applications/cfg.ini @@ -14,7 +14,8 @@ maxTTRetryCnt=3 minTTsinal=3 # TT状态检测周期数 minTTPeriCnt=2 -compressType=1 +# 压缩方式,0-不压缩 +compressType=0 # 加密方式,0-不加密 encrytType=1 # 开窗时间(UTC+8),持续时间(H)。以【,】为分隔符 diff --git a/applications/core.c b/applications/core.c index bf70f8b..b14e78b 100644 --- a/applications/core.c +++ b/applications/core.c @@ -315,7 +315,7 @@ static void chkAndSendFile_thread_entry() { LOG_W("第%d次尝试中TT准备失败,重试。", var + 1); deInitTT(); - rt_thread_mdelay(1000); + rt_thread_mdelay(15000); initTT(); } else { @@ -404,7 +404,7 @@ static void timeoutFunc(void *parameter) void initTT_thread_entry() { pwTT_thread_entry("1"); - + rt_thread_mdelay(15000);//wait TT to boot up while (1) { if (!isTTon()) { @@ -444,6 +444,9 @@ void initTT_thread_entry() } initThread=RT_NULL; + +// list_thread(); +// cmd_free(); } @@ -451,9 +454,10 @@ void deInitTT_thread_entry() { if (rt_sem_take(shuntDownTT, RT_WAITING_FOREVER) == RT_EOK) { + deinitThread =RT_NULL; tcpClose(); rt_hw_stm32_eth_deinit(); //qu激活网口 - +// rt_thread_mdelay(3000); pwTT_thread_entry("0"); // if (0&& tmrToPNTT) // { @@ -462,8 +466,12 @@ void deInitTT_thread_entry() // } LOG_W("shunt down TT DONE"); } + initThread=RT_NULL; deinitThread =RT_NULL; + +// list_thread(); +// cmd_free(); } /** diff --git a/applications/func/func.c b/applications/func/func.c index c70d359..b4a2316 100644 --- a/applications/func/func.c +++ b/applications/func/func.c @@ -147,9 +147,10 @@ void upSend_thread_entry(void* parameter) { SMSG* msg = RT_NULL; msg = (SMSG*) parameter; + LOG_D("1--%p",msg); +// LOG_HEX("--",16,msg->data,msg->len); - - +//check status uint8_t sta = 1; while (0 && !isTTjh()) //判断TT状态 { @@ -189,22 +190,18 @@ void upSend_thread_entry(void* parameter) // size_t rst = packMsg(&cfg, tmpmsg->data, msg->len, dout);//packMsgs LOG_HEX("upSend", 27, dout, rst); if (rst) - { - while (!isTCPok()) - { - rt_thread_mdelay(1000); - } + {LOG_D("2--%p",msg); if (sendMsg(dout, rst) == RT_EOK) { -// tcpClose(); LOG_I("send to TT Done."); } else//发送失败,实例不存在此种情况 - { + {LOG_D("3--%p",msg); LOG_E("send error, try to cache %d bytes data to file.",msg->len); cacheDataToFile(msg->data, msg->len); } } + list_thread(); return ; } /** @@ -221,7 +218,7 @@ RT_WEAK int upSend(uint8_t *din, size_t len) memset(&msg, 0, sizeof(SMSG)); memcpy(msg.data,din,len); msg.len=len; - + LOG_D("0--%p",&msg); /* 创建 serial 线程 */ rt_thread_t thread = rt_thread_create("upSend", upSend_thread_entry, (void *) &msg, 1024 * 5, 27, 10); /* 创建成功则启动线程 */ @@ -1018,6 +1015,7 @@ void parseTTData(uint8_t *din, size_t len) //数据 else { + resetTM();//非ACK信号才能触发延时逻辑 uint8_t rst = memcmp(ndin,head,10);//只比较到ftype if (rst) { diff --git a/applications/getinfo.c b/applications/getinfo.c index 8b1ada1..7f75a01 100644 --- a/applications/getinfo.c +++ b/applications/getinfo.c @@ -314,9 +314,10 @@ static int webclient_get_data(const char *url) LOG_D("webclient GET request response data :"); LOG_D("%s", buffer); - tt_parse(buffer); + if (buffer) { + tt_parse(buffer); web_free(buffer); } @@ -438,7 +439,10 @@ void repGetTT_thread_entry(void* parameter) strcpy(TTinfo->ele,"-"); break; } - web_free(url); + if (url) { + web_free(url); + } + // rt_thread_mdelay(100); //trans© new info to arrBuf diff --git a/applications/ttmsg/ttmsg.c b/applications/ttmsg/ttmsg.c index 2cf5200..b914586 100644 --- a/applications/ttmsg/ttmsg.c +++ b/applications/ttmsg/ttmsg.c @@ -454,10 +454,11 @@ void recTT_thread_entry() LOG_HEX("TTrec", 27, msg.data, msg.size); //此处调用处理函数 // LOG_D("try to parse data."); - resetTM(); +// resetTM(); parseTTData(msg.data,msg.size); } } + LOG_D("close recTT_thread_entry."); } //INIT_COMPONENT_EXPORT(recTT_thread_entry); diff --git a/drivers/drv_eth.c b/drivers/drv_eth.c index 6b5de78..94db512 100644 --- a/drivers/drv_eth.c +++ b/drivers/drv_eth.c @@ -673,8 +673,9 @@ __exit: void rt_hw_stm32_eth_deinit() { // HAL_ETH_DeInit(&EthHandle); -rt_timer_delete(stm32_eth_device.poll_link_timer); + rt_timer_delete(stm32_eth_device.poll_link_timer); eth_device_deinit(&(stm32_eth_device.parent)); + if (Rx_Buff) { rt_free(Rx_Buff);