From 32b21394d6837f355ede963f728c117f8ba572b5 Mon Sep 17 00:00:00 2001 From: chenyong <1521761801@qq.com> Date: Wed, 11 Sep 2019 09:46:46 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E4=BF=AE=E5=A4=8D=E3=80=91=E8=AE=BE?= =?UTF-8?q?=E5=A4=87=E6=8E=A5=E6=94=B6=E6=95=B0=E6=8D=AE=E8=BF=87=E7=9F=AD?= =?UTF-8?q?=E5=AF=BC=E8=87=B4=E4=B8=B2=E5=8F=A3=E6=8E=A5=E6=94=B6=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E8=B6=85=E6=97=B6=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: chenyong <1521761801@qq.com> --- class/ec20/at_socket_ec20.c | 4 ++-- class/esp8266/at_socket_esp8266.c | 4 ++-- class/m26/at_socket_m26.c | 4 ++-- class/mw31/at_socket_mw31.c | 4 ++-- class/rw007/at_socket_rw007.c | 4 ++-- class/sim800c/at_socket_sim800c.c | 4 ++-- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/class/ec20/at_socket_ec20.c b/class/ec20/at_socket_ec20.c index a6459b9..83ef66c 100644 --- a/class/ec20/at_socket_ec20.c +++ b/class/ec20/at_socket_ec20.c @@ -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) { diff --git a/class/esp8266/at_socket_esp8266.c b/class/esp8266/at_socket_esp8266.c index f82acdd..71ebd9d 100644 --- a/class/esp8266/at_socket_esp8266.c +++ b/class/esp8266/at_socket_esp8266.c @@ -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; diff --git a/class/m26/at_socket_m26.c b/class/m26/at_socket_m26.c index b30e77b..89e5013 100644 --- a/class/m26/at_socket_m26.c +++ b/class/m26/at_socket_m26.c @@ -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) { diff --git a/class/mw31/at_socket_mw31.c b/class/mw31/at_socket_mw31.c index 218feea..ffdb71c 100644 --- a/class/mw31/at_socket_mw31.c +++ b/class/mw31/at_socket_mw31.c @@ -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; diff --git a/class/rw007/at_socket_rw007.c b/class/rw007/at_socket_rw007.c index 9362d12..2f6a20b 100644 --- a/class/rw007/at_socket_rw007.c +++ b/class/rw007/at_socket_rw007.c @@ -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) { diff --git a/class/sim800c/at_socket_sim800c.c b/class/sim800c/at_socket_sim800c.c index 036c706..48cf9ce 100644 --- a/class/sim800c/at_socket_sim800c.c +++ b/class/sim800c/at_socket_sim800c.c @@ -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) {