更新 tcpRecMQ 和接收线程 退出逻辑
This commit is contained in:
parent
c83440e33a
commit
2c8ddb1cef
@ -69,4 +69,4 @@ void sys_log_file_backend_init(void)
|
||||
ulog_file_backend_enable(file_be); //必须使能才能有效
|
||||
}
|
||||
MSH_CMD_EXPORT(sys_log_file_backend_init,log2file);
|
||||
//INIT_APP_EXPORT(sys_log_file_backend_init);
|
||||
INIT_APP_EXPORT(sys_log_file_backend_init);
|
||||
|
@ -179,9 +179,10 @@ void tcpRecMQ_thread_entry(void)
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG_E("received error.");
|
||||
msg.size=0;//收到数据长度为0表示tcp断开
|
||||
rt_mq_send(&TTrx_mq, &msg, sizeof(msg));
|
||||
LOG_E("tcp error, close.");
|
||||
break;
|
||||
// return -RT_ERROR;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -540,6 +540,9 @@ void recTT_thread_entry()
|
||||
if (rt_mq_recv(&TTrx_mq, &msg, sizeof(msg), RT_WAITING_FOREVER) == RT_EOK)
|
||||
{
|
||||
// LOG_D("%d Bytes received...",msg.size);
|
||||
if (!msg.size) {//收到数据长度为0表示tcp断开
|
||||
break;
|
||||
}
|
||||
LOG_HEX("tcpTT", 16, msg.data, msg.size);
|
||||
//此处处理接收到数据
|
||||
rt_uint8_t rec_good[] = { 0x88, 0xAA, 0xBB, 0x88 };//前四字节
|
||||
@ -548,9 +551,6 @@ void recTT_thread_entry()
|
||||
LOG_I("ack is good.");
|
||||
}
|
||||
}
|
||||
if (!isTCPok()) {//TCP断开
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
//INIT_COMPONENT_EXPORT(recTT_thread_entry);
|
||||
|
Loading…
Reference in New Issue
Block a user