phase 1
This commit is contained in:
@@ -111,7 +111,7 @@ bool UaAddressSpaceBuilder::buildFromModel(const softbus::core::ObjectModelTree&
|
||||
}
|
||||
}
|
||||
|
||||
softbus::core::Logger::instance().info("UaAddressSpaceBuilder", "Address space built for ", tree.site);
|
||||
SB_LOG_INFO("UaAddressSpaceBuilder", "Address space built for ", tree.site);
|
||||
return true;
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -11,25 +11,25 @@ UaEventBridge::UaEventBridge(UA_Server* server)
|
||||
|
||||
void UaEventBridge::emitHeartbeat(const std::string& objectRef)
|
||||
{
|
||||
softbus::core::Logger::instance().debug("UaEventBridge", "Heartbeat stub for ", objectRef);
|
||||
SB_LOG_DEBUG("UaEventBridge", "Heartbeat stub for ", objectRef);
|
||||
(void)server_;
|
||||
}
|
||||
|
||||
void UaEventBridge::emitDeviceOnline(const std::string& stableDeviceKey)
|
||||
{
|
||||
softbus::core::Logger::instance().info("UaEventBridge", "Device online stub: ", stableDeviceKey);
|
||||
SB_LOG_INFO("UaEventBridge", "Device online stub: ", stableDeviceKey);
|
||||
(void)server_;
|
||||
}
|
||||
|
||||
void UaEventBridge::emitDeviceOffline(const std::string& stableDeviceKey)
|
||||
{
|
||||
softbus::core::Logger::instance().info("UaEventBridge", "Device offline stub: ", stableDeviceKey);
|
||||
SB_LOG_INFO("UaEventBridge", "Device offline stub: ", stableDeviceKey);
|
||||
(void)server_;
|
||||
}
|
||||
|
||||
void UaEventBridge::emitParseError(const std::string& objectRef, const std::string& detail)
|
||||
{
|
||||
softbus::core::Logger::instance().warn("UaEventBridge", "Parse error at ", objectRef, ": ", detail);
|
||||
SB_LOG_WARN("UaEventBridge", "Parse error at ", objectRef, ": ", detail);
|
||||
(void)server_;
|
||||
}
|
||||
|
||||
|
||||
@@ -80,7 +80,7 @@ bool UaMethodBinder::dispatchCommand(const softbus::api::ExecuteCommand& command
|
||||
if (!handler_) {
|
||||
return false;
|
||||
}
|
||||
softbus::core::Logger::instance().infoTrace("UaMethodBinder", command.traceId,
|
||||
SB_LOG_INFO_TRACE("UaMethodBinder", command.traceId,
|
||||
"ExecuteCommand invoked via OPC UA method");
|
||||
return handler_(command);
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ bool UaModelBinder::bind(const softbus::core::DOMMessage& message)
|
||||
const std::string key = message.id.empty() ? message.sourceId : message.id;
|
||||
const auto it = pointNodes_.find(key);
|
||||
if (it == pointNodes_.end()) {
|
||||
softbus::core::Logger::instance().warnTrace("UaModelBinder", message.traceId,
|
||||
SB_LOG_WARN_TRACE("UaModelBinder", message.traceId,
|
||||
"No OPC UA node registered for ", key);
|
||||
return false;
|
||||
}
|
||||
@@ -57,12 +57,12 @@ bool UaModelBinder::bind(const softbus::core::DOMMessage& message)
|
||||
UA_Variant_clear(&variant);
|
||||
|
||||
if (status == UA_STATUSCODE_GOOD) {
|
||||
softbus::core::Logger::instance().infoTrace("UaModelBinder", message.traceId,
|
||||
SB_LOG_INFO_TRACE("UaModelBinder", message.traceId,
|
||||
"Bound DOMMessage to OPC UA node ", key, " value=", numericValue);
|
||||
return true;
|
||||
}
|
||||
|
||||
softbus::core::Logger::instance().errorTrace("UaModelBinder", message.traceId,
|
||||
SB_LOG_ERROR_TRACE("UaModelBinder", message.traceId,
|
||||
"Failed to write OPC UA node ", key);
|
||||
return false;
|
||||
#endif
|
||||
|
||||
@@ -22,12 +22,12 @@ bool UaServerEngine::start(uint16_t port, const std::string& applicationName, co
|
||||
(void)port;
|
||||
(void)applicationName;
|
||||
(void)security;
|
||||
softbus::core::Logger::instance().error("UaServerEngine", "OPC UA support not built in");
|
||||
SB_LOG_ERROR("UaServerEngine", "OPC UA support not built in");
|
||||
return false;
|
||||
#else
|
||||
security_ = security;
|
||||
if (security.enableTls) {
|
||||
softbus::core::Logger::instance().warn("UaServerEngine",
|
||||
SB_LOG_WARN("UaServerEngine",
|
||||
"TLS/mTLS requested but not enabled in Phase1 build");
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ bool UaServerEngine::start(uint16_t port, const std::string& applicationName, co
|
||||
UA_ServerConfig* config = UA_Server_getConfig(server_);
|
||||
UA_StatusCode status = UA_ServerConfig_setMinimal(config, port, nullptr);
|
||||
if (status != UA_STATUSCODE_GOOD) {
|
||||
softbus::core::Logger::instance().error("UaServerEngine", "Failed to configure server");
|
||||
SB_LOG_ERROR("UaServerEngine", "Failed to configure server");
|
||||
UA_Server_delete(server_);
|
||||
server_ = nullptr;
|
||||
return false;
|
||||
@@ -44,14 +44,14 @@ bool UaServerEngine::start(uint16_t port, const std::string& applicationName, co
|
||||
config->applicationDescription.applicationName = UA_LOCALIZEDTEXT_ALLOC("en-US", applicationName.c_str());
|
||||
status = UA_Server_run_startup(server_);
|
||||
if (status != UA_STATUSCODE_GOOD) {
|
||||
softbus::core::Logger::instance().error("UaServerEngine", "Failed to start server");
|
||||
SB_LOG_ERROR("UaServerEngine", "Failed to start server");
|
||||
UA_Server_delete(server_);
|
||||
server_ = nullptr;
|
||||
return false;
|
||||
}
|
||||
|
||||
running_ = true;
|
||||
softbus::core::Logger::instance().info("UaServerEngine", "OPC UA server started on port ", port);
|
||||
SB_LOG_INFO("UaServerEngine", "OPC UA server started on port ", port);
|
||||
return true;
|
||||
#endif
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user