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.
37 lines
691 B
37 lines
691 B
#include "at0d0a.h"
|
|
#include "../clib/clib.h"
|
|
|
|
void L1_s2b_0d0a(struct _s_PC1_0D0A_ *p)// reentrant
|
|
{
|
|
if(p->head == 0)
|
|
{
|
|
p->head = 1;
|
|
p->num = 0;
|
|
}
|
|
|
|
if(p->num >= D_s_SSTR_0D0A_len)//128
|
|
{
|
|
p->num = 0;
|
|
}
|
|
p->cashe[1] = p->cashe[0];
|
|
p->cashe[0] = p->reg;//
|
|
|
|
p->__buf[p->num++] = p->reg;
|
|
|
|
if ((p->cashe[0] == 0x0a) && (p->cashe[1] == 0x0d))// 0d0a
|
|
{
|
|
if((p->num > 2) && (p->__buf[p->num-3] != ':')) //排除掉 +CIPSTATUS(a9):
|
|
{
|
|
if(1 != p->ok)
|
|
{
|
|
p->buf[0] = p->num - 2; //去掉0d0a
|
|
Lc_buf_copy_uc(p->buf + 1,p->__buf,p->num-2);
|
|
p->ok = 1;//收到 命令结束,必须有个地方清0,否则无法再次接受报文
|
|
}
|
|
}
|
|
p->head = 0;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|