|
@@ -273,30 +273,23 @@ static void dtu_thread_entry_recv(void *parameter)
|
|
|
{
|
|
{
|
|
|
//
|
|
//
|
|
|
// 从消息队列中获取被回调函数放入消息队列中的内容
|
|
// 从消息队列中获取被回调函数放入消息队列中的内容
|
|
|
- int result = rt_mq_recv(&rx_mq_dtu, &msg, sizeof(struct rx_msg), 50);
|
|
|
|
|
|
|
+ int result = rt_mq_recv(&rx_mq_dtu, &msg, sizeof(struct rx_msg), 100);
|
|
|
if (result != RT_EOK){
|
|
if (result != RT_EOK){
|
|
|
rx_err ++;
|
|
rx_err ++;
|
|
|
if(rx_err==15){
|
|
if(rx_err==15){
|
|
|
json_ctx.index = 0;
|
|
json_ctx.index = 0;
|
|
|
}
|
|
}
|
|
|
- if(rx_err==54000)//90分钟未接收到数据
|
|
|
|
|
- {
|
|
|
|
|
- if(device_status.version_type==6)
|
|
|
|
|
- {
|
|
|
|
|
- LOG_E("RK3399 transter Error!");
|
|
|
|
|
- ctr_photo(OFF);
|
|
|
|
|
- }
|
|
|
|
|
- else {
|
|
|
|
|
- ctr_RTU_DTU(OFF);
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- if (rx_err>54100&&device_status.bat_status==0)
|
|
|
|
|
- {
|
|
|
|
|
- LOG_W("通信中断,RTU重新上电");
|
|
|
|
|
- rx_err = 0;
|
|
|
|
|
- ctr_RTU_DTU(ON);
|
|
|
|
|
- ctr_photo(ON);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+// if(rx_err==54000)//90分钟未接收到数据
|
|
|
|
|
+// {
|
|
|
|
|
+// ctr_RTU_DTU(OFF);
|
|
|
|
|
+// }
|
|
|
|
|
+// if (rx_err>54100&&device_status.bat_status==0)
|
|
|
|
|
+// {
|
|
|
|
|
+// LOG_W("通信中断,RTU重新上电");
|
|
|
|
|
+// rx_err = 0;
|
|
|
|
|
+// ctr_RTU_DTU(ON);
|
|
|
|
|
+// ctr_photo(ON);
|
|
|
|
|
+// }
|
|
|
continue;
|
|
continue;
|
|
|
}
|
|
}
|
|
|
// 动态分配接收缓冲区
|
|
// 动态分配接收缓冲区
|