Skip to content

Commit 4002d57

Browse files
author
BiffoBear
committed
Converted read_sncr and read_snsr results to int so that they can actually be False.
1 parent df4efb2 commit 4002d57

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

adafruit_wiznet5k/adafruit_wiznet5k.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -909,21 +909,21 @@ def socket_close(self, socket_num: int) -> None:
909909
timeout = time.monotonic() + 5.0
910910
self.write_sncr(socket_num, _CMD_SOCK_CLOSE)
911911
debug_msg(" Waiting for close command to process…", self._debug)
912-
while self.read_sncr(socket_num):
912+
while self.read_sncr(socket_num)[0]:
913913
if time.monotonic() < timeout:
914914
raise RuntimeError(
915915
"Wiznet5k failed to complete command, status = {}.".format(
916-
self.read_sncr(socket_num)
916+
self.read_sncr(socket_num)[0]
917917
)
918918
)
919919
time.sleep(0.0001)
920920
debug_msg(" Waiting for socket to close…", self._debug)
921921
timeout = time.monotonic() + 5.0
922-
while self.read_snsr(socket_num) != SNSR_SOCK_CLOSED:
922+
while self.read_snsr(socket_num)[0] != SNSR_SOCK_CLOSED:
923923
if time.monotonic() > timeout:
924924
raise RuntimeError(
925925
"Wiznet5k failed to close socket, status = {}.".format(
926-
self.read_snsr(socket_num)
926+
self.read_snsr(socket_num)[0]
927927
)
928928
)
929929
time.sleep(0.0001)

0 commit comments

Comments
 (0)