namespace for IPRefresher instead of class

This commit is contained in:
2020-05-15 13:57:09 +02:00
parent 3b32f60190
commit b5b352f83d
6 changed files with 74 additions and 62 deletions

View File

@@ -9,29 +9,25 @@
#pragma once
namespace IPRefresher_Status_Code {
const int SUCCESS = 1;
const int ERROR = -1;
const int ERROR_NO_INTERNET = -2;
const int NOREFRESH = 0;
}
namespace IPRefresher {
/**
* Status return-codes for startUpService
*/
namespace Status_Code {
const int SUCCESS = 1;
const int ERROR = -1;
const int ERROR_NO_INTERNET = -2;
const int NOREFRESH = 0;
}
class IPRefresher {
public:
/**
* refresh ip address on Dynu server
*/
bool checkIPAdress(bool force);
/**
* default constructor
*/
IPRefresher() = default;
/**
* start the service in loop mode
* every 5 minutes the ip is checked an refreshed (needed for .service)
* @param loop true->loopmode on
*/
explicit IPRefresher(bool loop);
};
void startUpService(int interval = 300);
}