提交 db0880bd 编写于 作者: Q qiyongzhong0

fix at_client, avoid creating the same client repeatedly and prevent working...

fix at_client, avoid creating the same client repeatedly and prevent working exceptions and memory leaks.
上级 60e98086
......@@ -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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册