diff --git a/si4/soft_gsm_main.si4project/soft_gsm_main.sip_sym b/si4/soft_gsm_main.si4project/soft_gsm_main.sip_sym index 6f18835..789c675 100644 Binary files a/si4/soft_gsm_main.si4project/soft_gsm_main.sip_sym and b/si4/soft_gsm_main.si4project/soft_gsm_main.sip_sym differ diff --git a/si4/soft_gsm_main.si4project/soft_gsm_main.siwork b/si4/soft_gsm_main.si4project/soft_gsm_main.siwork index b32481a..1e8d4e8 100644 Binary files a/si4/soft_gsm_main.si4project/soft_gsm_main.siwork and b/si4/soft_gsm_main.si4project/soft_gsm_main.siwork differ diff --git a/source/app/app_common.c b/source/app/app_common.c index 1afd5fa..6a8f6ed 100644 --- a/source/app/app_common.c +++ b/source/app/app_common.c @@ -109,6 +109,7 @@ void Lu_register_init() G.flowStarted = 0; G._keyled = G._rfid = 0; + G.tcpLastRecvStamp = 0; } void L3_protocol_handler_uart4_fun(U8 *pPara) diff --git a/source/app/app_common.h b/source/app/app_common.h index 1a4c210..eb9d57e 100644 --- a/source/app/app_common.h +++ b/source/app/app_common.h @@ -200,13 +200,14 @@ typedef struct printer_maintenance_global CCMD_SLAVER_INFO ccmd_slaver_info[CCMD_SLAVER_INFO_MAX]; vU32 modbusstmp; - U8 authed; - U8 flowStarted; + U16 authed; + U16 flowStarted; U8 ccid[21]; //保存ccid卡号空间 20+'\0' TS_BoardStatus boardstatus; U8 _keyled; U8 _rfid; + U32 tcpLastRecvStamp; }PMGlobal; diff --git a/source/app/app_task_tcp.c b/source/app/app_task_tcp.c index 17ca18a..af4fbfb 100644 --- a/source/app/app_task_tcp.c +++ b/source/app/app_task_tcp.c @@ -47,10 +47,14 @@ void L3_task_tcp_handle(TS_tcp *s) L0_uart0_sendArray((U8*)&s->loopPkg,s->pkglen); L3_gm35_send((U8*)&s->loopPkg,s->pkglen); s->sendStamp = s_nos_tick.t_5ms; + if(G.ccmd_slaver_info[s->slaverIndex].mask == 1) + { + G.ccmd_slaver_info[s->slaverIndex].mask = 0; + } L2_task_go(D_task_tcp_wait_modbus_ack); TTSS_Task_step(D_task_tcp_wait_modbus_ack) - if(s_nos_tick.t_5ms - s->sendStamp >= 20) + if(s_nos_tick.t_5ms - s->sendStamp >= 300) { if(s_uart4_tcp_rec.ok) { @@ -60,17 +64,12 @@ void L3_task_tcp_handle(TS_tcp *s) if(s->pAckPkg->slaver == G.ccmd_slaver_info[s->slaverIndex].slaver) { s->ackFlag = 1; - if(G.ccmd_slaver_info[s->slaverIndex].mask == 1) - { - G.ccmd_slaver_info[s->slaverIndex].mask = 0; - } - + G.tcpLastRecvStamp = s_nos_tick.t_1s; if(s->pAckPkg->oper == MODBUS_OPER_WRITE_M) { U16 reg = (U16)(s->pAckPkg->buf[0]) << 8 | (U16)(s->pAckPkg->buf[1]); if(reg == G.ccmd_slaver_info[0].reg) { - //收到认证包ack G.authed = 1; } else if(reg == G.md_slaver_info[2].reg) diff --git a/source/app/app_task_tcp_control.c b/source/app/app_task_tcp_control.c index 2361d61..c62030c 100644 --- a/source/app/app_task_tcp_control.c +++ b/source/app/app_task_tcp_control.c @@ -15,6 +15,7 @@ void L3_task_tcp_control_init(void) } #define D_task_tcp_control_01 0x51 +#define D_task_tcp_control_02 0x52 void L3_task_tcp_control_handle(TS_tcp_control *s) { @@ -51,8 +52,17 @@ void L3_task_tcp_control_handle(TS_tcp_control *s) ts_tcp_control.tcp_send_stmp = s_nos_tick.t_1s; } - L2_task_go(D_task_tcp_control_01); + L2_task_go(D_task_tcp_control_02); + TTSS_Task_step(D_task_tcp_control_02) + if(g_at_send_status.conn_ok) + { + if(s_nos_tick.t_1s - G.tcpLastRecvStamp >= 20) + { + g_at_send_status.conn_ok = 0; + } + } + L2_task_go(D_task_tcp_control_01); TTSS_Task_end(); }