Browse Source

1. w600 station 基本流程测试通过

master
liyating 4 years ago
parent
commit
de4c82081e
  1. BIN
      si4/ps5ws.si4project/soft_ps5ws.sip_sym
  2. BIN
      si4/ps5ws.si4project/soft_ps5ws.sip_xab
  3. BIN
      si4/ps5ws.si4project/soft_ps5ws.sip_xad
  4. BIN
      si4/ps5ws.si4project/soft_ps5ws.sip_xc
  5. BIN
      si4/ps5ws.si4project/soft_ps5ws.sip_xf
  6. BIN
      si4/ps5ws.si4project/soft_ps5ws.sip_xm
  7. BIN
      si4/ps5ws.si4project/soft_ps5ws.sip_xr
  8. BIN
      si4/ps5ws.si4project/soft_ps5ws.sip_xsb
  9. BIN
      si4/ps5ws.si4project/soft_ps5ws.sip_xsd
  10. BIN
      si4/ps5ws.si4project/soft_ps5ws.siproj
  11. 2
      source/app/app_config.c
  12. 2
      source/app/main.c
  13. 20
      source/app/task_w600.c
  14. 7
      source/app/task_w600.h
  15. 1
      source/bsp/w600.h
  16. 1
      source/msp/UART2.h

BIN
si4/ps5ws.si4project/soft_ps5ws.sip_sym

Binary file not shown.

BIN
si4/ps5ws.si4project/soft_ps5ws.sip_xab

Binary file not shown.

BIN
si4/ps5ws.si4project/soft_ps5ws.sip_xad

Binary file not shown.

BIN
si4/ps5ws.si4project/soft_ps5ws.sip_xc

Binary file not shown.

BIN
si4/ps5ws.si4project/soft_ps5ws.sip_xf

Binary file not shown.

BIN
si4/ps5ws.si4project/soft_ps5ws.sip_xm

Binary file not shown.

BIN
si4/ps5ws.si4project/soft_ps5ws.sip_xr

Binary file not shown.

BIN
si4/ps5ws.si4project/soft_ps5ws.sip_xsb

Binary file not shown.

BIN
si4/ps5ws.si4project/soft_ps5ws.sip_xsd

Binary file not shown.

BIN
si4/ps5ws.si4project/soft_ps5ws.siproj

Binary file not shown.

2
source/app/app_config.c

@ -8,7 +8,7 @@ GlobalRegister R;
void L3_param_init(void) void L3_param_init(void)
{ {
G.debug = 1;
//station模式状态 //station模式状态
G.st_status = 0; //0:none 1:wifi_ok 2:tcp_connect_ok G.st_status = 0; //0:none 1:wifi_ok 2:tcp_connect_ok
//station模式sid //station模式sid

2
source/app/main.c

@ -120,7 +120,9 @@ void main(void)
//LED0 ^= 1; //LED0 ^= 1;
} }
L3_uart2_exp_protocol(&s_uart2_at);
L2_task_gm35_flow_handle(&s_task_gm35_flow); L2_task_gm35_flow_handle(&s_task_gm35_flow);
//寄存器值监控 //寄存器值监控
//L3_task_reglisten_handle(&s_task_reglisten); //L3_task_reglisten_handle(&s_task_reglisten);
//输出,响应485协议 //输出,响应485协议

20
source/app/task_w600.c

@ -13,9 +13,8 @@
#include "task_w600.h" #include "task_w600.h"
#include "app_config.h" #include "app_config.h"
#include "../msp/uart0.h"
#include "../msp/uart2.h" #include "../msp/uart2.h"
#include "../tpc/at0d0a.h" #include "../msp/uart0.h"
struct _s_task_gm35_gprs_ s_task_gm35_flow; 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; 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; p->ok = 0;
} }
@ -132,7 +139,7 @@ void L3_task_gm35_flow_init(U8 mode)
#define TTSS_TASK_GM35_FLOW_AP_WAIT 0x21 #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_DATA_INTERVAL 300
#define GM35_SEND_HEART_INTERVAL 60 #define GM35_SEND_HEART_INTERVAL 60
#define GM35_SEND_CIPSTATUS_INTERVAL 5 #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) TTSS_Task_step(TTSS_TASK_GM35_FLOW_ST_WIFI)
L3_gm35_send_str(AT_INS_ST_WIFI); L3_gm35_send_str(AT_INS_ST_WIFI);
s->ins_ok = 0; s->ins_ok = 0;
s->wifi_ok = 0;
s->ins_stmp = s_nos_tick.t_1s; s->ins_stmp = s_nos_tick.t_1s;
L2_task_go_Tdelay(TTSS_TASK_GM35_FLOW_ST_WIFI_WAIT,D_Tdelay_300ms); L2_task_go_Tdelay(TTSS_TASK_GM35_FLOW_ST_WIFI_WAIT,D_Tdelay_300ms);
TTSS_Task_step(TTSS_TASK_GM35_FLOW_ST_WIFI_WAIT) 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); 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); L3_gm35_send_str(AT_INS_ST_TCP);
s->ins_ok = 0; s->ins_ok = 0;
s->ins_stmp = s_nos_tick.t_1s; 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) TTSS_Task_step(TTSS_TASK_GM35_FLOW_ST_TCP_WAIT)
if(1 == s->ins_ok) 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) TTSS_Task_step(TTSS_TASK_GM35_FLOW_ST_DATA)
L0_uart0_uc('A'); L0_uart0_uc('A');
L0_uart2_sendstr("abcdefg");
L2_task_go_Tdelay(TTSS_TASK_GM35_FLOW_ST_DATA,D_Tdelay_5s); 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) TTSS_Task_step(TTSS_TASK_GM35_FLOW_AP)
L0_uart0_uc('C'); L0_uart0_uc('C');
L0_uart2_sendstr("abcdefg");
L2_task_go_Tdelay(TTSS_TASK_GM35_FLOW_ST_WAIT,D_Tdelay_10s); L2_task_go_Tdelay(TTSS_TASK_GM35_FLOW_ST_WAIT,D_Tdelay_10s);
TTSS_Task_end(); TTSS_Task_end();

7
source/app/task_w600.h

@ -17,9 +17,10 @@
#include "../bsp/bsp_config.h" #include "../bsp/bsp_config.h"
#include "../bsp/w600.h" #include "../bsp/w600.h"
#include "../ctask/task.h" #include "../ctask/task.h"
#include "../tpc/at0d0a.h"
////<<<<<<<<<<<<<<<<<<< GM35模块 AT操作指令 <<<<<<<<<<<<<<<<<<<<<<<< ////<<<<<<<<<<<<<<<<<<< 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 "AT+CWMODE=1\r\n" //进入station模式
#define AT_INS_ST_WIFI "AT+CWJAP_DEF=\"ccsens\",\"ccsens123\"\r\n" //网络查询指令 #define AT_INS_ST_WIFI "AT+CWJAP_DEF=\"ccsens\",\"ccsens123\"\r\n" //网络查询指令
#define AT_INS_ST_CIPMUX0 "AT+CIPMUX=0\r\n" //GPRS操作指令 #define AT_INS_ST_CIPMUX0 "AT+CIPMUX=0\r\n" //GPRS操作指令
@ -38,6 +39,7 @@ struct _s_task_gm35_gprs_
TS_task task; TS_task task;
vU8 ins_ok; vU8 ins_ok;
vU8 wifi_ok;
vU8 mode; vU8 mode;
vU8 send_lock; 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 L3_task_gm35_flow_init(U8 mode);
extern void L2_task_gm35_flow_handle(struct _s_task_gm35_gprs_ *s); extern void L2_task_gm35_flow_handle(struct _s_task_gm35_gprs_ *s);
extern void L3_uart2_exp_protocol(TS_Handle_0d0a *p);
#endif #endif

1
source/bsp/w600.h

@ -7,7 +7,6 @@
#define W600_DISABLE() W600_VBAT_EN = 0 #define W600_DISABLE() W600_VBAT_EN = 0
#define W600_ENABLE() W600_VBAT_EN = 1 #define W600_ENABLE() W600_VBAT_EN = 1
extern void L2_w600_init(); extern void L2_w600_init();
extern void L2_w600_enable(); extern void L2_w600_enable();
extern void L2_w600_disable(); extern void L2_w600_disable();

1
source/msp/UART2.h

@ -80,6 +80,7 @@ void uart2_Handdle(void) ;
#define L0_uart2_sendstr(buf) L0_uartN_sendstr(uNum2,buf) #define L0_uart2_sendstr(buf) L0_uartN_sendstr(uNum2,buf)
extern TP_Handler_X s_uart2_rec; extern TP_Handler_X s_uart2_rec;
extern TS_PH4_modbus s_uart2_ack; extern TS_PH4_modbus s_uart2_ack;
extern struct _s_PC1_0D0A_ s_uart2_at;
#endif //#ifndef _uart2_H #endif //#ifndef _uart2_H

Loading…
Cancel
Save