summaryrefslogtreecommitdiff
path: root/components
diff options
context:
space:
mode:
authorBernard Xiong <[email protected]>2020-11-03 10:47:13 +0800
committerGitHub <[email protected]>2020-11-03 10:47:13 +0800
commitac6da8d4cfe40f85c5cef3f311bd3ad63f275e48 (patch)
tree22e5627f38e92851c6d69b485042f21df1ea47e6 /components
parentcce66c4bce26c7bafc8658e75f1f3cfb672cbe1f (diff)
parentdb0880bd2675cfb097d15147940a32e272db1c89 (diff)
Merge pull request #4006 from qiyongzhong0/fix_at_client
fix at_client, avoid creating the same client repeatedly and prevent …
Diffstat (limited to 'components')
-rw-r--r--components/net/at/src/at_client.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/components/net/at/src/at_client.c b/components/net/at/src/at_client.c
index ba4009738d..788549392d 100644
--- a/components/net/at/src/at_client.c
+++ b/components/net/at/src/at_client.c
@@ -917,6 +917,11 @@ int at_client_init(const char *dev_name, rt_size_t recv_bufsz)
RT_ASSERT(dev_name);
RT_ASSERT(recv_bufsz > 0);
+ if (at_client_get(dev_name) != RT_NULL)
+ {
+ return result;
+ }
+
for (idx = 0; idx < AT_CLIENT_NUM_MAX && at_client_table[idx].device; idx++);
if (idx >= AT_CLIENT_NUM_MAX)