diff --git a/si4/ps5ws.si4project/soft_ps5ws.sip_sym b/si4/ps5ws.si4project/soft_ps5ws.sip_sym index cfe0fc8..3e50c3d 100644 Binary files a/si4/ps5ws.si4project/soft_ps5ws.sip_sym and b/si4/ps5ws.si4project/soft_ps5ws.sip_sym differ diff --git a/si4/ps5ws.si4project/soft_ps5ws.sip_xab b/si4/ps5ws.si4project/soft_ps5ws.sip_xab index 55c3347..ebda7a1 100644 Binary files a/si4/ps5ws.si4project/soft_ps5ws.sip_xab and b/si4/ps5ws.si4project/soft_ps5ws.sip_xab differ diff --git a/si4/ps5ws.si4project/soft_ps5ws.sip_xad b/si4/ps5ws.si4project/soft_ps5ws.sip_xad index 70984d1..426cc27 100644 Binary files a/si4/ps5ws.si4project/soft_ps5ws.sip_xad and b/si4/ps5ws.si4project/soft_ps5ws.sip_xad differ diff --git a/si4/ps5ws.si4project/soft_ps5ws.sip_xc b/si4/ps5ws.si4project/soft_ps5ws.sip_xc index 40b5d68..2f44ca7 100644 Binary files a/si4/ps5ws.si4project/soft_ps5ws.sip_xc and b/si4/ps5ws.si4project/soft_ps5ws.sip_xc differ diff --git a/si4/ps5ws.si4project/soft_ps5ws.sip_xf b/si4/ps5ws.si4project/soft_ps5ws.sip_xf index 4edd684..57ddca8 100644 Binary files a/si4/ps5ws.si4project/soft_ps5ws.sip_xf and b/si4/ps5ws.si4project/soft_ps5ws.sip_xf differ diff --git a/si4/ps5ws.si4project/soft_ps5ws.sip_xm b/si4/ps5ws.si4project/soft_ps5ws.sip_xm index e66a576..c299849 100644 Binary files a/si4/ps5ws.si4project/soft_ps5ws.sip_xm and b/si4/ps5ws.si4project/soft_ps5ws.sip_xm differ diff --git a/si4/ps5ws.si4project/soft_ps5ws.sip_xr b/si4/ps5ws.si4project/soft_ps5ws.sip_xr index c56b8be..b2ffd07 100644 Binary files a/si4/ps5ws.si4project/soft_ps5ws.sip_xr and b/si4/ps5ws.si4project/soft_ps5ws.sip_xr differ diff --git a/si4/ps5ws.si4project/soft_ps5ws.sip_xsb b/si4/ps5ws.si4project/soft_ps5ws.sip_xsb index c75fa25..b97f01b 100644 Binary files a/si4/ps5ws.si4project/soft_ps5ws.sip_xsb and b/si4/ps5ws.si4project/soft_ps5ws.sip_xsb differ diff --git a/si4/ps5ws.si4project/soft_ps5ws.sip_xsd b/si4/ps5ws.si4project/soft_ps5ws.sip_xsd index dfcc836..bd99620 100644 Binary files a/si4/ps5ws.si4project/soft_ps5ws.sip_xsd and b/si4/ps5ws.si4project/soft_ps5ws.sip_xsd differ diff --git a/si4/ps5ws.si4project/soft_ps5ws.siproj b/si4/ps5ws.si4project/soft_ps5ws.siproj index 0f459ad..077d503 100644 Binary files a/si4/ps5ws.si4project/soft_ps5ws.siproj and b/si4/ps5ws.si4project/soft_ps5ws.siproj differ diff --git a/source/app/app_config.c b/source/app/app_config.c index 8f495a9..b906984 100644 --- a/source/app/app_config.c +++ b/source/app/app_config.c @@ -8,7 +8,7 @@ GlobalRegister R; void L3_param_init(void) { - + G.debug = 1; //station模式状态 G.st_status = 0; //0:none 1:wifi_ok 2:tcp_connect_ok //station模式sid diff --git a/source/app/main.c b/source/app/main.c index d6266af..0d1a97a 100644 --- a/source/app/main.c +++ b/source/app/main.c @@ -120,7 +120,9 @@ void main(void) //LED0 ^= 1; } + L3_uart2_exp_protocol(&s_uart2_at); L2_task_gm35_flow_handle(&s_task_gm35_flow); + //寄存器值监控 //L3_task_reglisten_handle(&s_task_reglisten); //输出,响应485协议 diff --git a/source/app/task_w600.c b/source/app/task_w600.c index 2a91834..91884e0 100644 --- a/source/app/task_w600.c +++ b/source/app/task_w600.c @@ -13,9 +13,8 @@ #include "task_w600.h" #include "app_config.h" -#include "../msp/uart0.h" #include "../msp/uart2.h" -#include "../tpc/at0d0a.h" +#include "../msp/uart0.h" struct _s_task_gm35_gprs_ s_task_gm35_flow; @@ -74,6 +73,14 @@ void L3_uart2_exp_protocol(TS_Handle_0d0a *p) { s_task_gm35_flow.ins_ok = 1; } + if(Lc_strStartsWith(pPara,"WIFI GOT IP")) + { + s_task_gm35_flow.wifi_ok = 1; + } + if(Lc_strStartsWith(pPara,"CONNECT")) + { + s_task_gm35_flow.wifi_ok = 1; + } p->ok = 0; } @@ -132,7 +139,7 @@ void L3_task_gm35_flow_init(U8 mode) #define TTSS_TASK_GM35_FLOW_AP_WAIT 0x21 -#define INS_TIMEOUT 2 +#define INS_TIMEOUT 5 #define GM35_SEND_DATA_INTERVAL 300 #define GM35_SEND_HEART_INTERVAL 60 #define GM35_SEND_CIPSTATUS_INTERVAL 5 @@ -184,11 +191,12 @@ void L2_task_gm35_flow_handle(struct _s_task_gm35_gprs_ *s) TTSS_Task_step(TTSS_TASK_GM35_FLOW_ST_WIFI) L3_gm35_send_str(AT_INS_ST_WIFI); s->ins_ok = 0; + s->wifi_ok = 0; s->ins_stmp = s_nos_tick.t_1s; L2_task_go_Tdelay(TTSS_TASK_GM35_FLOW_ST_WIFI_WAIT,D_Tdelay_300ms); TTSS_Task_step(TTSS_TASK_GM35_FLOW_ST_WIFI_WAIT) - if(1 == s->ins_ok) + if(1 == s->ins_ok && 1 == s->wifi_ok) { L2_task_go_Tdelay(TTSS_TASK_GM35_FLOW_ST_CIPMUX0,0); } @@ -217,7 +225,7 @@ void L2_task_gm35_flow_handle(struct _s_task_gm35_gprs_ *s) L3_gm35_send_str(AT_INS_ST_TCP); s->ins_ok = 0; s->ins_stmp = s_nos_tick.t_1s; - L2_task_go_Tdelay(TTSS_TASK_GM35_FLOW_ST_TCP_WAIT,D_Tdelay_300ms); + L2_task_go_Tdelay(TTSS_TASK_GM35_FLOW_ST_TCP_WAIT,D_Tdelay_5s); TTSS_Task_step(TTSS_TASK_GM35_FLOW_ST_TCP_WAIT) if(1 == s->ins_ok) @@ -253,6 +261,7 @@ void L2_task_gm35_flow_handle(struct _s_task_gm35_gprs_ *s) TTSS_Task_step(TTSS_TASK_GM35_FLOW_ST_DATA) L0_uart0_uc('A'); + L0_uart2_sendstr("abcdefg"); L2_task_go_Tdelay(TTSS_TASK_GM35_FLOW_ST_DATA,D_Tdelay_5s); @@ -264,7 +273,6 @@ void L2_task_gm35_flow_handle(struct _s_task_gm35_gprs_ *s) TTSS_Task_step(TTSS_TASK_GM35_FLOW_AP) L0_uart0_uc('C'); - L0_uart2_sendstr("abcdefg"); L2_task_go_Tdelay(TTSS_TASK_GM35_FLOW_ST_WAIT,D_Tdelay_10s); TTSS_Task_end(); diff --git a/source/app/task_w600.h b/source/app/task_w600.h index 5a0e593..2982a33 100644 --- a/source/app/task_w600.h +++ b/source/app/task_w600.h @@ -17,9 +17,10 @@ #include "../bsp/bsp_config.h" #include "../bsp/w600.h" #include "../ctask/task.h" +#include "../tpc/at0d0a.h" ////<<<<<<<<<<<<<<<<<<< GM35模块 AT操作指令 <<<<<<<<<<<<<<<<<<<<<<<< -#define AT_INS_ATE0 "ATE0\r\n" //模块查询+关闭回显 +#define AT_INS_ATE0 "ATE1\r\n" //模块查询+关闭回显 #define AT_INS_ST "AT+CWMODE=1\r\n" //进入station模式 #define AT_INS_ST_WIFI "AT+CWJAP_DEF=\"ccsens\",\"ccsens123\"\r\n" //网络查询指令 #define AT_INS_ST_CIPMUX0 "AT+CIPMUX=0\r\n" //GPRS操作指令 @@ -38,6 +39,7 @@ struct _s_task_gm35_gprs_ TS_task task; vU8 ins_ok; + vU8 wifi_ok; vU8 mode; vU8 send_lock; @@ -75,6 +77,9 @@ extern struct _s_task_gm35_gprs_ s_task_gm35_flow; extern void L3_task_gm35_flow_init(U8 mode); extern void L2_task_gm35_flow_handle(struct _s_task_gm35_gprs_ *s); +extern void L3_uart2_exp_protocol(TS_Handle_0d0a *p); + + #endif diff --git a/source/bsp/w600.h b/source/bsp/w600.h index d471a68..c14efb9 100644 --- a/source/bsp/w600.h +++ b/source/bsp/w600.h @@ -7,7 +7,6 @@ #define W600_DISABLE() W600_VBAT_EN = 0 #define W600_ENABLE() W600_VBAT_EN = 1 - extern void L2_w600_init(); extern void L2_w600_enable(); extern void L2_w600_disable(); diff --git a/source/msp/UART2.h b/source/msp/UART2.h index 97cc20b..c381e2b 100644 --- a/source/msp/UART2.h +++ b/source/msp/UART2.h @@ -80,6 +80,7 @@ void uart2_Handdle(void) ; #define L0_uart2_sendstr(buf) L0_uartN_sendstr(uNum2,buf) extern TP_Handler_X s_uart2_rec; extern TS_PH4_modbus s_uart2_ack; +extern struct _s_PC1_0D0A_ s_uart2_at; #endif //#ifndef _uart2_H