Hello,
I have found a small bug that doesn't influence the compilation of the program:
When you load this small project into VM, at first, the function "toIpString" is underlined in red with the message: IntelliSense: cannot overload functions distinguished by return type alone.
When you compile the program, you still have this error.
When you click with the mouse cursor into the editor window, and you scroll the window up or down until the line with the error init disappears from the editor window, the red underscore line is gone.
I am using the latest beta version for the moment.(Arduino 1.0.1 for Visual Studio (1207.19))
struct WiFiSetupStruct
{ byte ipaddr[4]; // Device IP address
byte gwaddr[4]; // Device gateway address
byte snaddr[4]; // Device subnet mask
byte serveraddr[4]; // Device server address
} WiFiSetup = {
{192,168,1,245},
{192,168,1,1},
{255,255,255,0},
{192,168,1,200}
};
String toIpString(byte arg[], int len){
String S = NULL;
for(int i=0; i<len; i++)
{
S = S + String(arg[i]);
if(i < len - 1) S = S + ".";
}
return (String)S;
}
void setup()
{
Serial.begin(9600);
Serial.println(toIpString(WiFiSetup.ipaddr,(int)sizeof(WiFiSetup.ipaddr)));
Serial.println(toIpString(WiFiSetup.gwaddr,(int)sizeof(WiFiSetup.gwaddr)));
Serial.println(toIpString(WiFiSetup.snaddr,(int)sizeof(WiFiSetup.snaddr)));
));
}
void loop()
{
/* add main program code here */
}
Regards,
Marc