Skip to content

Commit a478557

Browse files
author
brentru
committed
speed up initialization, send_check_reply only checks reply (not reply AND buffer
1 parent 9d85377 commit a478557

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

adafruit_fona/adafruit_fona.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ def _init_fona(self):
157157

158158
if self._debug:
159159
print("Attempting to open comm with ATs")
160-
timeout = 7
160+
timeout = 7000
161161
while timeout > 0:
162162
if self._send_check_reply(CMD_AT, reply=REPLY_OK):
163163
break
@@ -793,7 +793,6 @@ def _get_reply(
793793
print("\t---> {}{}".format(prefix, suffix))
794794
self._uart.write(prefix + suffix + b"\r\n")
795795

796-
self._buf = b""
797796
line = self._read_line(timeout)
798797

799798
if self._debug:
@@ -882,8 +881,9 @@ def _send_check_reply(
882881
else:
883882
if not self._get_reply(send, timeout=timeout):
884883
return False
884+
885885
# validate response
886-
if not reply in self._buf:
886+
if not reply:
887887
return False
888888

889889
return True

0 commit comments

Comments
 (0)