diff --git a/README.md b/README.md index 39944c5..5632d28 100644 --- a/README.md +++ b/README.md @@ -107,6 +107,12 @@ void setup() { Use this: EasyDDNS.client("domain", "username", "password"); */ EasyDDNS.client("12345.duckdns.org", "token"); // Enter your DDNS Domain & Token + + // Get Notified when your IP changes + EasyDDNS.onUpdate([&](const char* oldIP, const char* newIP){ + Serial.print("EasyDDNS - IP Change Detected: "); + Serial.println(newIP); + }); } void loop() { diff --git a/examples/DDNS_Client/DDNS_Client.ino b/examples/DDNS_Client/DDNS_Client.ino index d94d74d..0536cd9 100644 --- a/examples/DDNS_Client/DDNS_Client.ino +++ b/examples/DDNS_Client/DDNS_Client.ino @@ -46,6 +46,12 @@ void setup() { Use this: EasyDDNS.client("domain", "username", "password"); */ EasyDDNS.client("12345.duckdns.org", "token"); // Enter your DDNS Domain & Token + + // Get Notified when your IP changes + EasyDDNS.onUpdate([&](const char* oldIP, const char* newIP){ + Serial.print("EasyDDNS - IP Change Detected: "); + Serial.println(newIP); + }); } void loop() { diff --git a/examples/LocalIP_DDNS_Client/LocalIP_DDNS_Client.ino b/examples/LocalIP_DDNS_Client/LocalIP_DDNS_Client.ino index 700de11..62d6cae 100644 --- a/examples/LocalIP_DDNS_Client/LocalIP_DDNS_Client.ino +++ b/examples/LocalIP_DDNS_Client/LocalIP_DDNS_Client.ino @@ -51,6 +51,12 @@ void setup() { Use this: EasyDDNS.client("domain", "username", "password"); */ EasyDDNS.client("12345.duckdns.org", "token"); // Enter your DDNS Domain & Token + + // Get Notified when your IP changes + EasyDDNS.onUpdate([&](const char* oldIP, const char* newIP){ + Serial.print("EasyDDNS - IP Change Detected: "); + Serial.println(newIP); + }); } void loop() {