Skip to content

Commit

Permalink
add unpretty ip method
Browse files Browse the repository at this point in the history
  • Loading branch information
brentru committed Mar 12, 2020
1 parent e41dccf commit 892fa6d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions adafruit_wiznet5k/adafruit_wiznet5k.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,11 @@ def pretty_ip(self, ip): # pylint: disable=no-self-use, invalid-name
"""
return "%d.%d.%d.%d" % (ip[0], ip[1], ip[2], ip[3])

def unpretty_ip(self, ip): # pylint: disable=no-self-use, invalid-name
"""Converts a dotted-quad string to a bytearray IP address"""
octets = [int(x) for x in ip.split('.')]
return bytes(octets)

@property
def mac_address(self):
"""Returns the hardware's MAC address."""
Expand Down

0 comments on commit 892fa6d

Please sign in to comment.