Skip to content

Commit e18d925

Browse files
authored
Merge pull request #18 from nobitlost/develop
Fix an issue with DHCP client identifier (61) option
2 parents 57961fb + e1f0773 commit e18d925

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

DHCP/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
# Wiznet 5500 DHCP 2.0.0 #
1+
# Wiznet 5500 DHCP 2.0.1 #
22

33
This library class enables Dynamic Host Configuration Protocol (DHCP) functionality for the [Wiznet W5500 chip](http://wizwiki.net/wiki/lib/exe/fetch.php?media=products:w5500:w5500_ds_v106e_141230.pdf). It depends on the Wiznet W5500 library, so be sure to include the DHCP library after the W5500 library.
44

55
**To include this library in your project, add the following at the top of your device code:**
66

77
```squirrel
88
#require "W5500.device.lib.nut:2.2.0"
9-
#require "W5500.DHCP.device.lib.nut:2.0.0"
9+
#require "W5500.DHCP.device.lib.nut:2.0.1"
1010
```
1111

1212
## Class Usage ##

DHCP/W5500.DHCP.device.lib.nut

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ enum W5500_DHCP_OPTIONS {
143143

144144
class W5500.DHCP {
145145

146-
static VERSION = "2.0.0";
146+
static VERSION = "2.0.1";
147147

148148
_driver = null;
149149
_wiz = null;
@@ -751,6 +751,7 @@ class W5500.DHCP {
751751
for (local i = 0; i < _mac.len(); i++) {
752752
mac.writen(_mac[i], 'b');
753753
}
754+
mac.seek(0, 'b');
754755

755756
// OPTIONS
756757
// Client identifier
@@ -760,7 +761,7 @@ class W5500.DHCP {
760761
// Type
761762
options.writen(0x01, 'b');
762763
// Writes Mac Address
763-
options.writeblob(mac);
764+
options.writeblob(mac.readblob(6));
764765

765766
// Host Name
766767
options.writen(W5500_DHCP_OPTIONS.hostName, 'b');

examples/DHCP_Example.device.nut

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
// Include Libraries
2929
#require "W5500.device.lib.nut:2.2.0"
30-
#require "W5500.DHCP.device.lib.nut:2.0.0"
30+
#require "W5500.DHCP.device.lib.nut:2.0.1"
3131

3232
// Configure Echo Server Settings
3333
const ECHO_SERVER_IP = "192.168.42.3";

0 commit comments

Comments
 (0)