Populate version in all cases to get correct OMF version set
@@ -878,12 +878,25 @@ uint32_t plugin_send(const PLUGIN_HANDLE handle,
return 0;
}
- // Until we know better assume OMF 1.2
+ // Above call does not always populate version
+ if (version.empty())
+ {
+ PIWebAPIGetVersion(connInfo, version, false);
+ }
+
+ Logger::getLogger()->info("Version is '%s'", version.c_str());
+
+ // Until we know better assume OMF 1.2 as this is the base base point
+ // to give us the flexible type support we need
connInfo->omfversion = "1.2";
if (version.find("2019") != std::string::npos)
{
connInfo->omfversion = "1.0";
}
+ else if (version.find("2020") != std::string::npos)
+ {
+ connInfo->omfversion = "1.1";
+ }
else if (version.find("2021") != std::string::npos)
{
connInfo->omfversion = "1.2";
@@ -1505,7 +1518,6 @@ int PIWebAPIGetVersion(CONNECTOR_INFO* connInfo, std::string &version, bool logM
_PIWebAPI->setAuthBasicCredentials(connInfo->PIWebAPICredentials);
int httpCode = _PIWebAPI->GetVersion(connInfo->hostAndPort, version, logMessage);
-
delete _PIWebAPI;
return httpCode;
