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 7028abe..aa5943c 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.sip_xab b/si4/soft_gsm_main.si4project/soft_gsm_main.sip_xab index 07ba9d5..26f302a 100644 Binary files a/si4/soft_gsm_main.si4project/soft_gsm_main.sip_xab and b/si4/soft_gsm_main.si4project/soft_gsm_main.sip_xab differ diff --git a/si4/soft_gsm_main.si4project/soft_gsm_main.sip_xad b/si4/soft_gsm_main.si4project/soft_gsm_main.sip_xad index f327e0e..2b98549 100644 Binary files a/si4/soft_gsm_main.si4project/soft_gsm_main.sip_xad and b/si4/soft_gsm_main.si4project/soft_gsm_main.sip_xad differ diff --git a/si4/soft_gsm_main.si4project/soft_gsm_main.sip_xc b/si4/soft_gsm_main.si4project/soft_gsm_main.sip_xc index 6e46b1c..a4a2671 100644 Binary files a/si4/soft_gsm_main.si4project/soft_gsm_main.sip_xc and b/si4/soft_gsm_main.si4project/soft_gsm_main.sip_xc differ diff --git a/si4/soft_gsm_main.si4project/soft_gsm_main.sip_xf b/si4/soft_gsm_main.si4project/soft_gsm_main.sip_xf index 5e58743..198c9af 100644 Binary files a/si4/soft_gsm_main.si4project/soft_gsm_main.sip_xf and b/si4/soft_gsm_main.si4project/soft_gsm_main.sip_xf differ diff --git a/si4/soft_gsm_main.si4project/soft_gsm_main.sip_xm b/si4/soft_gsm_main.si4project/soft_gsm_main.sip_xm index ce6efda..b2b1393 100644 Binary files a/si4/soft_gsm_main.si4project/soft_gsm_main.sip_xm and b/si4/soft_gsm_main.si4project/soft_gsm_main.sip_xm differ diff --git a/si4/soft_gsm_main.si4project/soft_gsm_main.sip_xr b/si4/soft_gsm_main.si4project/soft_gsm_main.sip_xr index c35d4ea..25fbf87 100644 Binary files a/si4/soft_gsm_main.si4project/soft_gsm_main.sip_xr and b/si4/soft_gsm_main.si4project/soft_gsm_main.sip_xr differ diff --git a/si4/soft_gsm_main.si4project/soft_gsm_main.sip_xsb b/si4/soft_gsm_main.si4project/soft_gsm_main.sip_xsb index 957d9dd..aff8aa7 100644 Binary files a/si4/soft_gsm_main.si4project/soft_gsm_main.sip_xsb and b/si4/soft_gsm_main.si4project/soft_gsm_main.sip_xsb differ diff --git a/si4/soft_gsm_main.si4project/soft_gsm_main.sip_xsd b/si4/soft_gsm_main.si4project/soft_gsm_main.sip_xsd index f52d3db..fe48855 100644 Binary files a/si4/soft_gsm_main.si4project/soft_gsm_main.sip_xsd and b/si4/soft_gsm_main.si4project/soft_gsm_main.sip_xsd differ diff --git a/source/app/app_common.c b/source/app/app_common.c index 11a085b..1d86ec7 100644 --- a/source/app/app_common.c +++ b/source/app/app_common.c @@ -105,7 +105,8 @@ void Lu_register_init() G.ccmd_slaver_info[3].mask = 0; G.modbusstmp = 0; - G.flowStart = 0; + G.authed = 0; + G.flowStarted = 0; G._keyled = G._rfid = 0; } diff --git a/source/app/app_common.h b/source/app/app_common.h index 46274ec..1a4c210 100644 --- a/source/app/app_common.h +++ b/source/app/app_common.h @@ -200,7 +200,8 @@ typedef struct printer_maintenance_global CCMD_SLAVER_INFO ccmd_slaver_info[CCMD_SLAVER_INFO_MAX]; vU32 modbusstmp; - U16 flowStart; + U8 authed; + U8 flowStarted; U8 ccid[21]; //保存ccid卡号空间 20+'\0' TS_BoardStatus boardstatus; diff --git a/source/app/app_task_tcp.c b/source/app/app_task_tcp.c index aafca60..a1fe1e7 100644 --- a/source/app/app_task_tcp.c +++ b/source/app/app_task_tcp.c @@ -6,7 +6,7 @@ #define MODBUS_SLAVER_DW20_REG_START 0x02 #define MODBUS_SLAVER_DW20_REG_NUM 0x02 -#define MODBUS_SLAVER_RETRY_MAX_TIME 5 +#define MODBUS_SLAVER_RETRY_MAX_TIME 1 TS_tcp ts_tcp; @@ -50,7 +50,7 @@ void L3_task_tcp_handle(TS_tcp *s) 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 >= 300) + if(s_nos_tick.t_5ms - s->sendStamp >= 20) { if(s_uart4_tcp_rec.ok) { @@ -64,6 +64,20 @@ void L3_task_tcp_handle(TS_tcp *s) { G.ccmd_slaver_info[s->slaverIndex].mask = 0; } + + 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) + { + G.flowStarted = 1; + } + } } } else diff --git a/source/app/app_task_tcp_control.c b/source/app/app_task_tcp_control.c index e68de96..1cf079b 100644 --- a/source/app/app_task_tcp_control.c +++ b/source/app/app_task_tcp_control.c @@ -17,6 +17,47 @@ void L3_task_tcp_control_init(void) #define D_task_tcp_control_01 0x51 void L3_task_tcp_control_handle(TS_tcp_control *s) +{ + TTSS_Task_init(); + L2_task_go(D_task_tcp_control_01); + + TTSS_Task_step(D_task_tcp_control_01) + if(s->conn_ok_pool != g_at_send_status.conn_ok) + { + G.authed = 0; + s->conn_ok_pool = g_at_send_status.conn_ok; + } + + if(s->conn_ok_pool) + { + if(!G.authed) + { + //发送认证包 + G.ccmd_slaver_info[0].mask = 1; + } + else if(!G.flowStarted) + { + //发送流程开始包 + G.ccmd_slaver_info[2].mask = 1; + } + else + { + //3s一次发送数据包 + if(s_nos_tick.t_1s - ts_tcp_control.tcp_send_stmp >= 2) + { + G.ccmd_slaver_info[3].mask = 1; + ts_tcp_control.tcp_send_stmp = s_nos_tick.t_1s; + } + } + } + + L2_task_go(D_task_tcp_control_01); + + TTSS_Task_end(); +} + + +void L3_task_tcp_control_handle111(TS_tcp_control *s) { TTSS_Task_init(); L2_task_go(D_task_tcp_control_01); @@ -57,3 +98,4 @@ void L3_task_tcp_control_handle(TS_tcp_control *s) } +