You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
57 lines
1.4 KiB
57 lines
1.4 KiB
#include "app_task_tcp_control.h"
|
|
#include "../msp/msp_uart0.h"
|
|
#include "../app/task_w600.h"
|
|
#include "../app/app_task_tcp.h"
|
|
#include "../asp/asp_oid.h"
|
|
|
|
TS_tcp_control ts_tcp_control;
|
|
|
|
void L3_task_tcp_control_init(void)
|
|
{
|
|
L1_task_init(&ts_tcp_control.task);
|
|
L3_task_s_go(ts_tcp_control,D_task_init);
|
|
ts_tcp_control.conn_ok_pool = 0;
|
|
ts_tcp_control.tcp_send_stmp = 0;
|
|
}
|
|
|
|
#define D_task_tcp_control_01 0x51
|
|
#define D_task_tcp_control_02 0x52
|
|
|
|
|
|
void L3_task_tcp_control_handle(TS_tcp_control *s)//判定是否抬笔/缓冲区满,调用读函数读取一段,从G->R, R.extra num 动态修改数量
|
|
|
|
{
|
|
TTSS_Task_init()
|
|
L2_task_go(D_task_tcp_control_01);
|
|
TTSS_Task_step(D_task_tcp_control_01)
|
|
if(s->conn_ok_pool != _s_task_w600_para.conn_ok)
|
|
{
|
|
G.authed = 0;
|
|
s->conn_ok_pool =_s_task_w600_para.conn_ok; //s->conn_ok_pool=1
|
|
}
|
|
L2_task_go(D_task_tcp_control_02);
|
|
TTSS_Task_step(D_task_tcp_control_02)//是否发认证包
|
|
if(_s_task_w600_para.conn_ok)
|
|
{
|
|
if(!G.authed)//authed == 0
|
|
{
|
|
//发送认证包
|
|
G.ccmd_slaver_info[0].mask = 1;
|
|
}
|
|
else if(ts_task_oid.can_send && G.authed)
|
|
{
|
|
ts_task_oid.can_send = 0;
|
|
G.ccmd_slaver_info[1].buf = (U8*)&points;
|
|
G.ccmd_slaver_info[1].extra_num = (ts_task_oid.extra)*5;
|
|
//L0_uart2_sendArray((U8 *)&points,ts_task_oid.extra*10);
|
|
ts_task_oid.extra = 0;
|
|
G.ccmd_slaver_info[1].mask = 1;
|
|
}
|
|
}
|
|
L2_task_go(D_task_tcp_control_01);
|
|
TTSS_Task_end();
|
|
}
|
|
|
|
|
|
|
|
|
|
|