You can't compare different data types. This works.
#include <SPI.h>
#include <Ethernet.h>
IPAddress ip(192,168,0,2);
IPAddress ip2(192,168,0,2);
IPAddress ip3(192,168,0,3);
void setup() {
Serial.begin(115200);
// put your setup code here, to run once:
if(ip == ip2) Serial.println("ip2 match");
else Serial.println("ip2 no match");
if(ip == ip3) Serial.println("ip3 match");
else Serial.println("ip3 no match");
}
void loop() {
// put your main code here, to run repeatedly:
}
Serial.print and Serial.println convert the parameter to a string before printing.
Host computer has ip address of 192.168.1.47, client ip address is unknown.
When I get the value of the client ip address (client.remoteIP()); trying to compare it to see if value is the same as host computer ip address, if so exit.
Is there any way to do this?
My apologies Surfer Tim; I did too quick of a read of you code. Your handling of IPAddress was just what I was looking for, thank you!