17 #define TIMEOUT_CONNECT 10 18 #define TIMEOUT_REQUEST 10 19 #define RETRY_SLEEP_TIME 1 22 #define URL_GET_VERSION "/piwebapi/system" 36 void setAuthMethod (std::string& authMethod) {m_authMethod = authMethod; }
37 void setAuthBasicCredentials(std::string& authBasicCredentials) {m_authBasicCredentials = authBasicCredentials; }
39 int GetVersion(
const string& host,
string &version,
bool logMessage =
true);
40 string errorMessageHandler(
const string& msg);
43 string ExtractVersion(
const string& response);
44 string extractSection(
const string& msg,
const string& toSearch);
45 string extractMessageFromJSon(
const string& json);
48 string m_authBasicCredentials;
51 const vector<pair<string, string>> PIWEB_ERRORS = {
53 {
"Noroutetohost",
"The PI Web API server is not reachable, verify the network reachability"},
54 {
"No route to host",
"The PI Web API server is not reachable, verify the network reachability"},
Definition: asset_tracking.h:108
The PIWebAPI class.
Definition: piwebapi.h:27