Skip to content

Commit 91d1f31

Browse files
author
BiffoBear
committed
Add _read_socket_reservations and _read_sndport methods to aid trouble shooting.
1 parent 79668f4 commit 91d1f31

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

adafruit_wiznet5k/adafruit_wiznet5k.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1057,6 +1057,11 @@ def _check_link_status(self):
10571057
if not self.link_status:
10581058
raise ConnectionError("The Ethernet connection is down.")
10591059

1060+
@staticmethod
1061+
def _read_socket_reservations() -> list[int]:
1062+
"""Return the list of reserved sockets."""
1063+
return WIZNET5K._sockets_reserved
1064+
10601065
def _read_mr(self) -> int:
10611066
"""Read from the Mode Register (MR)."""
10621067
return int.from_bytes(self._read(_REG_MR[self._chip_type], 0x00), "big")
@@ -1182,6 +1187,10 @@ def _write_sndipr(self, sock: int, ip_addr: bytes) -> None:
11821187
sock, _REG_SNDIPR[self._chip_type] + offset, value
11831188
)
11841189

1190+
def _read_sndport(self, sock: int) -> int:
1191+
"""Read socket destination port."""
1192+
return self._read_two_byte_sock_reg(sock, _REG_SNDPORT[self._chip_type])
1193+
11851194
def _write_sndport(self, sock: int, port: int) -> None:
11861195
"""Write to socket destination port."""
11871196
self._write_two_byte_sock_reg(sock, _REG_SNDPORT[self._chip_type], port)

0 commit comments

Comments
 (0)