Fix variable name in 'setIp' declaration. Add and convert to methods for configuring net mask and gateway.

git-svn-id: svn+ssh://oldsvn/home/mlalondesvn/svn/cral@93 3ee9b42a-b53c-0410-a25e-f0b6218d5d5b
master
follower 17 years ago
parent 0cc5fc9107
commit 0abd75b40c

@ -103,7 +103,9 @@ class Wiz810MjDevice {
public:
Wiz810MjDevice(int resetPin);
void setIp(byte b1, byte b2, byte b3, byte b4);
void setIp(byte b0, byte b1, byte b2, byte b3);
void setMask(byte b0, byte b1, byte b2, byte b3);
void setGateway(byte b0, byte b1, byte b2, byte b3);
private:
void _init(void);
@ -178,6 +180,21 @@ void Wiz810MjDevice::setIp(byte b0, byte b1, byte b2, byte b3) {
setSIPR(_packBuffer(b0, b1, b2, b3));
}
void Wiz810MjDevice::setMask(byte b0, byte b1, byte b2, byte b3) {
/*
*/
setSUBR(_packBuffer(b0, b1, b2, b3));
}
void Wiz810MjDevice::setGateway(byte b0, byte b1, byte b2, byte b3) {
/*
*/
setGAR(_packBuffer(b0, b1, b2, b3));
}
/* ----------------------- */
@ -206,10 +223,10 @@ void setup () {
byte config_mac_address[] = {0x02,0xDE,0xAD,0xBE,0xEF,0x00};
byte config_ip_address[] = {192,168,2,105};
setGAR(config_gateway);
setSUBR(config_subnet_mask);
setSHAR(config_mac_address);
setSHAR(config_mac_address);
WIZ810MJ.setIp(192,168,2,105);
WIZ810MJ.setMask(255,255,255,0);
WIZ810MJ.setGateway(192,168,2,101);
Serial.println("End test W5100 configuration...");

Loading…
Cancel
Save