hi.
I’m using spider and ethernet module. I wrote in addition an emulator project. so I can run my project either on spider or with the emulator.
the problem is with the following code:
_ethernet= new EthernetBuiltIn();
try
{
_ethernet.Open();
if (!_ethernet.IsOpen || !_ethernet.IsActivated)
{
throw new NetworkException("Problems with the initialize of the ethernet module");
}
}
catch (NotSupportedException e)
{
Debug.Print(e.Message );
_mode = Mode.Emulator;
}
the _ethernet.Open will throw a not supported exception if this is running on the emulator (no ethernet there)
is there any better way to differentiate if the network module is connected or not?
thanks!