fix: 4g通讯

This commit is contained in:
2026-07-31 13:59:48 +08:00
parent abbf30d7c0
commit 3fcd38f417
2 changed files with 41 additions and 7 deletions
+7 -6
View File
@@ -76,10 +76,11 @@ class ATClient:
"""
expect_b = expect.encode() if isinstance(expect, str) else expect
with self._cmd_lock:
# 初始化等待
self._waiting = True
self._expect = expect_b
self._resp = b""
with self._q_lock:
# 初始化等待
self._waiting = True
self._expect = expect_b
self._resp = b""
# 发送
if cmd:
@@ -300,8 +301,8 @@ class ATClient:
if len(self._rx) > 512 * 1024:
self._rx = self._rx[-256 * 1024:]
else:
if len(self._rx) > 16384:
self._rx = self._rx[-4096:]
if len(self._rx) > 32768:
self._rx = self._rx[-16384:]