Skip to content

Commit

Permalink
Merge pull request #165 from justmobilize/fix-inconsistencies
Browse files Browse the repository at this point in the history
Fix inconsistencies
  • Loading branch information
dhalbert authored Jun 23, 2024
2 parents 931299b + 75ee080 commit c63bf6b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
9 changes: 9 additions & 0 deletions adafruit_wiznet5k/adafruit_wiznet5k.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,15 @@ def ip_address(self) -> bytes:
"""
return self._read(_REG_SIPR[self._chip_type], 0x00, 4)

@property
def ipv4_address(self) -> str:
"""
Configured IP address for the WIZnet Ethernet hardware.
:return str: The IP address (a string of the form '255.255.255.255')
"""
return self.pretty_ip(self.ip_address)

@staticmethod
def pretty_ip(ipv4: bytes) -> str:
"""
Expand Down
4 changes: 2 additions & 2 deletions adafruit_wiznet5k/adafruit_wiznet5k_socketpool.py
Original file line number Diff line number Diff line change
Expand Up @@ -655,8 +655,8 @@ def recvfrom_into( # pylint: disable=unused-argument
return (
self.recv_into(buffer, nbytes),
(
self._interface.remote_ip(self._socknum),
self._interface.remote_port(self._socknum),
self._interface.pretty_ip(self._interface.udp_from_ip[self._socknum]),
self._interface.udp_from_port[self._socknum],
),
)

Expand Down

0 comments on commit c63bf6b

Please sign in to comment.