I have the following code:
string ipAddress = "192.168.0.93";
string nsk = "xxxxxxxx";
void ProgramStarted()
{
try
{
wifi_RS21.Interface.Open();
wifi_RS21.Interface.WirelessConnectivityChanged += new WiFiRS9110.WirelessConnectivityChangedEventHandler(Interface_WirelessConnectivityChanged);
GHI.Premium.Net.NetworkInterfaceExtension.AssignNetworkingStackTo(wifi_RS21.Interface);
WiFiNetworkInfo[] scanResults = wifi_RS21.Interface.Scan();
WiFiNetworkInfo info = new WiFiNetworkInfo(scanResults[0]);
wifi_RS21.Interface.NetworkInterface.EnableStaticIP(ipAddress, "255.255.255.0", "192.168.0.1");
wifi_RS21.Interface.Join(info, nsk);
}
catch (Exception ex)
{
Debug.Print("ERRRRRRRRRRRR" + ex.Message);
}
Debug.Print("Program Started");
}
During the execution of wifi_RS21.Interface.Scan(); I think it resets itself; if I’m lucky it will pass the scan and reset at the wifi_RS21.Interface.Join(info, nsk); and if I’m really lucky (and lately happens extremely rare) it just works.
One more thing: No error is thrown.
So, am I doing something wrong? If so, why does it sometimes work?