【修复】设备接收数据过短导致串口接收数据超时问题
Signed-off-by: chenyong <1521761801@qq.com>
This commit is contained in:
parent
9587a1fc2f
commit
32b21394d6
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue