ifw-ccf  3.0.0-pre2
Namespaces | Macros
comAdptEnvision.cpp File Reference
#include <ccf/protocols/envision/comAdptEnvision.hpp>

Namespaces

 ccf
 
 ccf::protocols
 
 ccf::protocols::envision
 

Macros

#define OPCUA_INVOKE_TMP(NAME, CMD)
 

Macro Definition Documentation

◆ OPCUA_INVOKE_TMP

#define OPCUA_INVOKE_TMP (   NAME,
  CMD 
)
Value:
int8_t attempts = 0; \
bool run = true; \
while (run) { \
try { \
CMD; \
run = false; \
break; \
} catch (...) { \
std::string err = boost::current_exception_diagnostic_information(); \
if (err.find("BadSessionIdInvalid") != std::string::npos) { \
LOG4CPLUS_INFO(Logger(), fmt::format("{}: OPC UA Connection lost - trying to " \
"reconnect ... ({}/10)", NAME, (attempts + 1))); \
if (++attempts <= 10) { \
sleep(1); \
m_opcua_client.Disconnect(); \
m_opcua_client.Connect("CAMERA#1", GetDeviceAddress()); \
continue; \
} \
} \
throw; \
} \
}
log4cplus::Logger & Logger()
Definition: base.cpp:9