Merge pull request #69 from Lawlieta/master

【修复】设备接收数据过短导致串口接收数据超时问题
This commit is contained in:
朱天龙 (Armink) 2019-09-11 10:42:34 +08:00 committed by GitHub
commit 614881c818
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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)
{