diff --git a/branches/follower/wiz810mj/src/demo/WizDemo4/WizDemo4.pde b/branches/follower/wiz810mj/src/demo/WizDemo4/WizDemo4.pde index 832b251..770a506 100644 --- a/branches/follower/wiz810mj/src/demo/WizDemo4/WizDemo4.pde +++ b/branches/follower/wiz810mj/src/demo/WizDemo4/WizDemo4.pde @@ -215,6 +215,33 @@ void Wiz810MjDevice::setMac(byte b0, byte b1, byte b2, byte b3, byte b4, byte b5 /* ----------------------- */ +/* -- NetworkInterface -- */ + +class NetworkInterface { + + public: + NetworkInterface(Wiz810MjDevice& networkDevice); + + Wiz810MjDevice& device; // TODO: Make this a generic "network device" interface +}; + +NetworkInterface::NetworkInterface(Wiz810MjDevice& networkDevice) : device (networkDevice) { + /* + + Note: The "weirdness" in this function declaration is a "initalization list", + i.e. this bit: + + ) : device (networkDevice) { + + it is needed to give the 'device' Reference a value supplied to the method + rather than having a new 'Wiz810MjDevice' instance created. + */ +}; + +// NetworkInterface Network = NetworkInterface(...); // TODO: Make this a global + +/* ----------------------- */ + // #define PIN_RESET 9 // WIZnet module /RESET @@ -238,10 +265,14 @@ void setup () { WIZ810MJ.setMac(0x02,0xDE,0xAD,0xBE,0xEF,0x00); - WIZ810MJ.setIp(192,168,2,105); + // WIZ810MJ.setIp(192,168,2,105); WIZ810MJ.setMask(255,255,255,0); WIZ810MJ.setGateway(192,168,2,101); + NetworkInterface Network = NetworkInterface(WIZ810MJ); + + Network.device.setIp(192,168,2,105); + Serial.println("End test W5100 configuration...");