2020-05-08 16:45:27 +02:00
|
|
|
/**
|
|
|
|
* IPrefresher library
|
|
|
|
* - start checking ip once
|
|
|
|
* - or in loop mode
|
|
|
|
*
|
|
|
|
* @author Lukas Heiligenbrunner
|
|
|
|
* @date 06.04.2019
|
|
|
|
*/
|
2019-08-02 22:44:42 +02:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2020-05-14 23:08:19 +02:00
|
|
|
namespace IPRefresher_Status_Code {
|
|
|
|
const int SUCCESS = 1;
|
|
|
|
const int ERROR = -1;
|
|
|
|
const int ERROR_NO_INTERNET = -2;
|
|
|
|
const int NOREFRESH = 0;
|
|
|
|
}
|
|
|
|
|
2019-08-02 22:44:42 +02:00
|
|
|
class IPRefresher {
|
|
|
|
public:
|
|
|
|
/**
|
|
|
|
* refresh ip address on Dynu server
|
|
|
|
*/
|
2020-05-14 23:08:19 +02:00
|
|
|
bool checkIPAdress(bool force);
|
2019-10-23 09:24:35 +02:00
|
|
|
|
2020-04-30 19:37:11 +02:00
|
|
|
/**
|
|
|
|
* default constructor
|
|
|
|
*/
|
2020-05-07 14:54:40 +02:00
|
|
|
IPRefresher() = default;
|
2020-04-30 12:16:29 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* start the service in loop mode
|
|
|
|
* every 5 minutes the ip is checked an refreshed (needed for .service)
|
|
|
|
* @param loop true->loopmode on
|
|
|
|
*/
|
2019-10-27 14:14:03 +01:00
|
|
|
explicit IPRefresher(bool loop);
|
2020-05-14 23:08:19 +02:00
|
|
|
};
|