ifw-ccf 4.0.0
Loading...
Searching...
No Matches
Namespaces | Macros
comAdptEnvision.cpp File Reference
#include <ccf/control/application.hpp>
#include <ccf/protocols/envision/comAdptEnvision.hpp>

Namespaces

namespace  ccf
 
namespace  ccf::protocols
 
namespace  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) || \
(err.find("BadSessionClosed") != std::string::npos) || \
(err.find("BadConnectionClosed") != 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; \
} \
}