|
1 | 1 | # The MIT License (MIT)
|
2 | 2 | #
|
| 3 | +# Copyright (c) 2010 WIZnet |
| 4 | +# Copyright (c) 2010 Arduino LLC |
3 | 5 | # Copyright (c) 2008 Bjoern Hartmann
|
4 | 6 | # Copyright 2018 Paul Stoffregen
|
5 |
| -# Copyright (c) 2020 Brent Rubell for Adafruit Industries |
| 7 | +# Modified by Brent Rubell for Adafruit Industries, 2020 |
6 | 8 | #
|
7 | 9 | # Permission is hereby granted, free of charge, to any person obtaining a copy
|
8 | 10 | # of this software and associated documentation files (the "Software"), to deal
|
|
27 | 29 |
|
28 | 30 | Pure-Python interface for WIZNET 5k ethernet modules.
|
29 | 31 |
|
30 |
| -* Author(s): Bjoern Hartmann, Paul Stoffregen, Brent Rubell |
| 32 | +* Author(s): WIZnet, Arduino LLC, Bjoern Hartmann, Paul Stoffregen, Brent Rubell |
31 | 33 |
|
32 | 34 | Implementation Notes
|
33 | 35 | --------------------
|
@@ -288,9 +290,11 @@ def ifconfig(self):
|
288 | 290 | """Returns the network configuration as a tuple."""
|
289 | 291 | # set subnet and gateway addresses
|
290 | 292 | for octet in range(0, 4):
|
291 |
| - subnet_mask += self.read(REG_SUBR+octet, 0x04, subnet_mask[octet]) |
292 |
| - gw_addr += self.read(REG_GAR+octet, 0x04, gw_addr[octet]) |
293 |
| - params = (self.ip_address, subnet_mask, gw_addr, self._dns) |
| 293 | + self._pbuff += self.read(REG_SUBR+octet, 0x04) |
| 294 | + for octet in range(0, 4): |
| 295 | + self._pbuff[3+octet] += self.read(REG_GAR+octet, 0x04) |
| 296 | + |
| 297 | + params = (self.ip_address, self._pbuff[0:3], self._pbuff[3:7], self._dns) |
294 | 298 | return params
|
295 | 299 |
|
296 | 300 | @ifconfig.setter
|
@@ -413,6 +417,7 @@ def write(self, addr, callback, data):
|
413 | 417 |
|
414 | 418 | # Socket-Register API
|
415 | 419 | def udp_remaining(self):
|
| 420 | + """Returns amount of bytes remaining in a udp socket.""" |
416 | 421 | if self._debug:
|
417 | 422 | print("* UDP Bytes Remaining: ", UDP_SOCK['bytes_remaining'])
|
418 | 423 | return UDP_SOCK['bytes_remaining']
|
|
0 commit comments