【修复】设备接收数据过短导致串口接收数据超时问题

Signed-off-by: chenyong <1521761801@qq.com>
This commit is contained in:
chenyong 2019-09-11 09:46:46 +08:00
parent 9587a1fc2f
commit 32b21394d6
6 changed files with 12 additions and 12 deletions

View File

@ -836,8 +836,8 @@ static void urc_recv_func(struct at_client *client, const char *data, rt_size_t
/* get the current socket and receive buffer size by receive data */
sscanf(data, "+QIURC: \"recv\",%d,%d", &device_socket, (int *) &bfsz);
/* get receive timeout by receive buffer length */
timeout = bfsz;
/* set receive timeout by receive buffer length, not less than 10 ms */
timeout = bfsz > 10 ? bfsz : 10;
if (device_socket < 0 || bfsz == 0)
{

View File

@ -480,8 +480,8 @@ static void urc_recv_func(struct at_client *client, const char *data, rt_size_t
/* get the at deveice socket and receive buffer size by receive data */
sscanf(data, "+IPD,%d,%d:", &device_socket, (int *) &bfsz);
/* get receive timeout by receive buffer length */
timeout = bfsz;
/* set receive timeout by receive buffer length, not less than 10ms */
timeout = bfsz > 10 ? bfsz : 10;
if (device_socket < 0 || bfsz == 0)
return;

View File

@ -608,8 +608,8 @@ static void urc_recv_func(struct at_client *client, const char *data, rt_size_t
/* get the current socket and receive buffer size by receive data */
sscanf(data, "+RECEIVE: %d, %d", &device_socket, (int *) &bfsz);
/* get receive timeout by receive buffer length */
timeout = bfsz;
/* set receive timeout by receive buffer length, not less than 10 ms */
timeout = bfsz > 10 ? bfsz : 10;
if (device_socket < 0 || bfsz == 0)
{

View File

@ -400,8 +400,8 @@ static void urc_recv_func(struct at_client *client, const char *data, rt_size_t
sscanf(temp, "%ld,", &bfsz);
LOG_D("socket:%d, size:%ld\n", device_socket, bfsz);
/* get receive timeout by receive buffer length */
timeout = bfsz;
/* set receive timeout by receive buffer length, not less than 10 ms */
timeout = bfsz > 10 ? bfsz : 10;
if (device_socket < 0 || bfsz == 0)
return;

View File

@ -479,8 +479,8 @@ static void urc_recv_func(struct at_client *client, const char *data, rt_size_t
/* get the current socket and receive buffer size by receive data */
sscanf(data, "+IPD,%d,%d:", &device_socket, (int *) &bfsz);
/* get receive timeout by receive buffer length */
timeout = bfsz;
/* set receive timeout by receive buffer length, not less than 10 ms */
timeout = bfsz > 10 ? bfsz : 10;
if (device_socket < 0 || bfsz == 0)
{

View File

@ -557,8 +557,8 @@ static void urc_recv_func(struct at_client *client, const char *data, rt_size_t
/* get the current socket and receive buffer size by receive data */
sscanf(data, "+RECEIVE,%d,%d:", &device_socket, (int *) &bfsz);
/* get receive timeout by receive buffer length */
timeout = bfsz;
/* set receive timeout by receive buffer length, not less than 10 ms */
timeout = bfsz > 10 ? bfsz : 10;
if (device_socket < 0 || bfsz == 0)
{