Hey Everybody ,
I have some issues about getting an ip for a socket server.
I tried several method i'm struggling on solve this issue. After some reading i understood the best approach is to actually set a static ip for the netduino.
I was wondering if anybody would be kind enough to provide me an example or a step by step explanation ?
I tried by myself to set the Ip/Mac
NetworkInterface networkInterface = NetworkInterface.GetAllNetworkInterfaces()[0];
networkInterface.PhysicalAddress = new byte[] { 0x5C, 0x86, 0x4A, 0x00, 0x00, 0x00 };
networkInterface.EnableStaticIP("192.168.0.75", "255.255.255.0", "192.168.1.2");
I tried to parse an Ipad as well but nothing seems to work.
Thanks !
Pxl
Socket and DCHP
Started by pxl357, Aug 31 2011 04:31 AM
1 reply to this topic
#1
Posted 31 August 2011 - 04:31 AM
#2
Posted 31 August 2011 - 06:32 AM
NetworkInterface networkInterface = NetworkInterface.GetAllNetworkInterfaces()[0]; //networkInterface.PhysicalAddress = new byte[] { 0x5C, 0x86, 0x4A, 0x00, 0x00, 0x00 }; networkInterface.EnableStaticIP("192.168.0.75", "255.255.255.0", "192.168.1.2");
Try that; PhysicalAddress is read only, if I'm not mistaken. The rest looks good to go - just remember not to set it on every run, rather check for differences in the value, and set if required.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users