一、问题描述:
STM32F429作为at client,esp32c3作为 at server;
STM32F429通过at指令将esp32c3设置为透传模式,但是esp32c3发给STM32F429的透传数据,at client没有正常接收,
比如+IPD,0,3:123, at client 只接收了 +IPD,0,3: ,将透传数据123丢弃;
二、代码位置:
components\net\at\src\at_client.c,如下函数, 当解析到透传数据中存在IPD关键字,就直接break,后面的透传数据被丢弃;
static int at_recv_readline(at_client_t client)
{
rt_size_t read_len = 0;
char ch = 0, last_ch = 0;
rt_bool_t is_full = RT_FALSE;
rt_memset(client->recv_line_buf, 0x00, client->recv_bufsz);
client->recv_line_len = 0;
while (1)
{
at_client_getchar(client, &ch, RT_WAITING_FOREVER);
if (read_len < client->recv_bufsz)
{
client->recv_line_buf[read_len++] = ch;
client->recv_line_len = read_len;
}
else
{
is_full = RT_TRUE;
}
/* is newline or URC data */
if ((ch == '\n' && last_ch == '\r') || (client->end_sign != 0 && ch == client->end_sign)
|| get_urc_obj(client))
{
if (is_full)
{
LOG_E("read line failed. The line data length is out of buffer size(%d)!", client->recv_bufsz);
rt_memset(client->recv_line_buf, 0x00, client->recv_bufsz);
client->recv_line_len = 0;
return -RT_EFULL;
}
break;
}
last_ch = ch;
}
#ifdef AT_PRINT_RAW_CMD
at_print_raw_cmd("recvline", client->recv_line_buf, read_len);
#endif
return read_len;
}