mirror of
https://github.com/eclipse-openvehicle-api/openvehicle-api.git
synced 2026-04-18 18:48:16 +00:00
Update sdv_packager (#6)
This commit is contained in:
@@ -1,5 +1,18 @@
|
||||
#*******************************************************************************
|
||||
# Copyright (c) 2025-2026 ZF Friedrichshafen AG
|
||||
#
|
||||
# This program and the accompanying materials are made available under the
|
||||
# terms of the Apache License Version 2.0 which is available at
|
||||
# https://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
# Contributors:
|
||||
# Sudipta Durjoy - initial API and implementation
|
||||
#*******************************************************************************
|
||||
|
||||
# Only build on MSVC/Windows or 64-bit Linux (not ARM)
|
||||
if((WIN32 AND NOT MSVC) OR (UNIX AND CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64"))
|
||||
if((WIN32 AND MSVC) OR (UNIX AND CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64"))
|
||||
|
||||
# Define project
|
||||
project(can_com_silkit VERSION 1.0 LANGUAGES CXX)
|
||||
|
||||
@@ -1,80 +1,47 @@
|
||||
/********************************************************************************
|
||||
* Copyright (c) 2025-2026 ZF Friedrichshafen AG
|
||||
*
|
||||
* This program and the accompanying materials are made available under the
|
||||
* terms of the Apache License Version 2.0 which is available at
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Contributors:
|
||||
* Sudipta Durjoy - initial API and implementation
|
||||
* Thomas Pfleiderer - refactored and finalized
|
||||
********************************************************************************/
|
||||
|
||||
#include "can_com_silkit.h"
|
||||
#include <support/toml.h>
|
||||
#include <bitset>
|
||||
|
||||
void CCANSilKit::Initialize(const sdv::u8string& rssObjectConfig)
|
||||
bool CCANSilKit::OnInitialize()
|
||||
{
|
||||
std::string silKitNetwork = "";
|
||||
std::string silKitJSONConfigContent = "";
|
||||
std::string silKitRegistryUri = "";
|
||||
try
|
||||
{
|
||||
sdv::toml::CTOMLParser config(rssObjectConfig.c_str());
|
||||
sdv::toml::CNode nodeSilKitConfig = config.GetDirect("SilKitConfig");
|
||||
if (nodeSilKitConfig.GetType() == sdv::toml::ENodeType::node_string)
|
||||
{
|
||||
silKitJSONConfigContent = static_cast<std::string>(nodeSilKitConfig.GetValue());
|
||||
}
|
||||
|
||||
sdv::toml::CNode nodeSilKitParticipant = config.GetDirect("SilKitParticipantName");
|
||||
if (nodeSilKitParticipant.GetType() == sdv::toml::ENodeType::node_string)
|
||||
{
|
||||
m_SilKitParticipantName = static_cast<std::string>(nodeSilKitParticipant.GetValue());
|
||||
}
|
||||
|
||||
sdv::toml::CNode nodeSilKitNetwork = config.GetDirect("CanSilKitNetwork");
|
||||
if (nodeSilKitNetwork.GetType() == sdv::toml::ENodeType::node_string)
|
||||
{
|
||||
silKitNetwork = static_cast<std::string>(nodeSilKitNetwork.GetValue());
|
||||
}
|
||||
|
||||
sdv::toml::CNode nodeSilKitRegistryURI = config.GetDirect("RegistryURI");
|
||||
if (nodeSilKitRegistryURI.GetType() == sdv::toml::ENodeType::node_string)
|
||||
{
|
||||
silKitRegistryUri = static_cast<std::string>(nodeSilKitRegistryURI.GetValue());
|
||||
}
|
||||
|
||||
sdv::toml::CNode nodeSilKitSyncMode = config.GetDirect("SyncMode");
|
||||
if (nodeSilKitSyncMode.GetType() == sdv::toml::ENodeType::node_boolean)
|
||||
{
|
||||
m_SilKitIsSynchronousMode = static_cast<bool>(nodeSilKitSyncMode.GetValue());
|
||||
}
|
||||
}
|
||||
catch (const sdv::toml::XTOMLParseException& e)
|
||||
{
|
||||
SDV_LOG_ERROR("Configuration could not be read: ", e.what());
|
||||
m_eStatus = sdv::EObjectStatus::initialization_failure;
|
||||
return;
|
||||
}
|
||||
|
||||
m_TimerSimulationStep = sdv::core::GetObject<sdv::core::ITimerSimulationStep>("SimulationTaskTimerService");
|
||||
|
||||
if (!ValidateConfiguration(silKitJSONConfigContent, silKitNetwork, silKitRegistryUri))
|
||||
if (!ValidateConfiguration())
|
||||
{
|
||||
m_eStatus = sdv::EObjectStatus::initialization_failure;
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!CreateSilKitConnection(silKitJSONConfigContent, silKitNetwork, silKitRegistryUri))
|
||||
if (!CreateSilKitConnection())
|
||||
{
|
||||
SDV_LOG_ERROR("Error createing SilKit connection, probably invalid JSON content");
|
||||
m_eStatus = sdv::EObjectStatus::initialization_failure;
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
|
||||
// Update status only if initialization was successful
|
||||
m_eStatus = sdv::EObjectStatus::initialized;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CCANSilKit::ValidateConfiguration(const std::string& ssSilKitJSONConfigContent, const std::string& ssSilKitNetwork, const std::string& ssSilKitRegistryUri)
|
||||
bool CCANSilKit::ValidateConfiguration()
|
||||
{
|
||||
bool success = true;
|
||||
SDV_LOG_INFO("SilKit connecting to network: ", ssSilKitNetwork.c_str());
|
||||
SDV_LOG_INFO("SilKit registry URI: ", ssSilKitRegistryUri.c_str());
|
||||
SDV_LOG_INFO("SilKit connecting to network: ", m_SilKitNetwork.c_str());
|
||||
SDV_LOG_INFO("SilKit registry URI: ", m_SilKitRegistryUri.c_str());
|
||||
m_SilKitIsSynchronousMode ? SDV_LOG_INFO("SilKit is running in synchronous mode.") : SDV_LOG_INFO("SilKit is running in asynchronous mode.");
|
||||
m_TimerSimulationStep ? SDV_LOG_WARNING("Run simulation with simulation timer service.") : SDV_LOG_WARNING("Run simulation with real time service.");
|
||||
|
||||
if (ssSilKitJSONConfigContent.empty())
|
||||
if (m_SilKitJSONConfigContent.empty())
|
||||
{
|
||||
SDV_LOG_ERROR("Error reading config file content for SilKit, missing 'SilKitConfig'.");
|
||||
success = false;
|
||||
@@ -84,23 +51,23 @@ bool CCANSilKit::ValidateConfiguration(const std::string& ssSilKitJSONConfigCont
|
||||
SDV_LOG_ERROR("SilKit CAN participant is not found in configuration, missing 'SilKitParticipantName'.");
|
||||
success = false;
|
||||
}
|
||||
if (ssSilKitNetwork.empty())
|
||||
if (m_SilKitNetwork.empty())
|
||||
{
|
||||
SDV_LOG_ERROR("Error reading SilKit network name, missing 'CanSilKitNetwork'.");
|
||||
success = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
SDV_LOG_INFO("SilKit connecting to network: ", ssSilKitNetwork.c_str());
|
||||
SDV_LOG_INFO("SilKit connecting to network: ", m_SilKitNetwork.c_str());
|
||||
}
|
||||
if (ssSilKitRegistryUri.empty())
|
||||
if (m_SilKitRegistryUri.empty())
|
||||
{
|
||||
SDV_LOG_ERROR("Error reading SilKit registry URI, missing 'RegistryURI'.");
|
||||
success = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
SDV_LOG_INFO("SilKit registry URI: ", ssSilKitRegistryUri.c_str());
|
||||
SDV_LOG_INFO("SilKit registry URI: ", m_SilKitRegistryUri.c_str());
|
||||
}
|
||||
|
||||
if (!m_TimerSimulationStep)
|
||||
@@ -120,68 +87,41 @@ bool CCANSilKit::ValidateConfiguration(const std::string& ssSilKitJSONConfigCont
|
||||
return success;
|
||||
}
|
||||
|
||||
sdv::EObjectStatus CCANSilKit::GetStatus() const
|
||||
void CCANSilKit::OnShutdown()
|
||||
{
|
||||
return m_eStatus;
|
||||
}
|
||||
|
||||
void CCANSilKit::SetOperationMode(sdv::EOperationMode eMode)
|
||||
{
|
||||
switch (eMode)
|
||||
{
|
||||
case sdv::EOperationMode::configuring:
|
||||
if (m_eStatus == sdv::EObjectStatus::running || m_eStatus == sdv::EObjectStatus::initialized)
|
||||
m_eStatus = sdv::EObjectStatus::configuring;
|
||||
break;
|
||||
case sdv::EOperationMode::running:
|
||||
if (m_eStatus == sdv::EObjectStatus::configuring || m_eStatus == sdv::EObjectStatus::initialized)
|
||||
m_eStatus = sdv::EObjectStatus::running;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void CCANSilKit::Shutdown()
|
||||
{
|
||||
SDV_LOG_INFO("Initiating shutdown process...");
|
||||
|
||||
m_eStatus = sdv::EObjectStatus::shutdown_in_progress;
|
||||
|
||||
try
|
||||
{
|
||||
if (m_SilKitLifeCycleService)
|
||||
{
|
||||
SDV_LOG_INFO("Stopping SilKit Lifecycle Service...");
|
||||
m_SilKitLifeCycleService->Stop("Shutdown requested.");
|
||||
m_SilKitLifeCycleService = nullptr;
|
||||
}
|
||||
|
||||
if (m_SilKitCanController)
|
||||
{
|
||||
SDV_LOG_INFO("Stopping SilKit CAN Controller...");
|
||||
m_SilKitCanController->Stop();
|
||||
m_SilKitCanController = nullptr;
|
||||
}
|
||||
|
||||
if (m_SilKitParticipant)
|
||||
{
|
||||
SDV_LOG_INFO("Resetting SilKit Participant...");
|
||||
m_SilKitParticipant.reset();
|
||||
m_SilKitParticipant = nullptr;
|
||||
}
|
||||
}
|
||||
catch (const SilKit::SilKitError& e)
|
||||
{
|
||||
SDV_LOG_ERROR("SilKit exception occurred during shutdown: ", e.what());
|
||||
m_eStatus = sdv::EObjectStatus::runtime_error;
|
||||
}
|
||||
catch (const std::exception& e)
|
||||
{
|
||||
SDV_LOG_ERROR("Unknown exception occurred during shutdown: ", e.what());
|
||||
m_eStatus = sdv::EObjectStatus::runtime_error;
|
||||
}
|
||||
|
||||
m_SilKitLifeCycleService = nullptr;
|
||||
m_SilKitCanController = nullptr;
|
||||
m_SilKitParticipant = nullptr;
|
||||
|
||||
std::lock_guard<std::mutex> lock(m_QueueMutex);
|
||||
while (!m_MessageQueue.empty())
|
||||
{
|
||||
@@ -191,12 +131,13 @@ void CCANSilKit::Shutdown()
|
||||
|
||||
void CCANSilKit::RegisterReceiver(/*in*/ sdv::can::IReceive* pReceiver)
|
||||
{
|
||||
if (m_eStatus != sdv::EObjectStatus::configuring)
|
||||
if (GetObjectState() != sdv::EObjectState::configuring)
|
||||
return;
|
||||
|
||||
if (!pReceiver)
|
||||
{
|
||||
SDV_LOG_ERROR("No CAN receiver available.");
|
||||
SetObjectIntoConfigErrorState();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -234,7 +175,7 @@ void CCANSilKit::UnregisterReceiver(/*in*/ sdv::can::IReceive* pReceiver)
|
||||
sdv::sequence<sdv::u8string> CCANSilKit::GetInterfaces() const
|
||||
{
|
||||
sdv::sequence<sdv::u8string> seqIfcNames;
|
||||
if (m_eStatus != sdv::EObjectStatus::running) return seqIfcNames;
|
||||
if (GetObjectState() != sdv::EObjectState::running) return seqIfcNames;
|
||||
|
||||
seqIfcNames.push_back(m_SilKitParticipantName);
|
||||
|
||||
@@ -249,6 +190,7 @@ std::shared_ptr<SilKit::Config::IParticipantConfiguration> CCANSilKit::GetSilKit
|
||||
if (silKitParticipantCconfig == nullptr)
|
||||
{
|
||||
SDV_LOG_ERROR("Error parsing the SilKit config content: ", ssSilKitJSONConfigContent.c_str());
|
||||
SetObjectIntoConfigErrorState();
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@@ -261,6 +203,7 @@ std::unique_ptr<SilKit::IParticipant> CCANSilKit::CreateParticipantFromJSONConfi
|
||||
if (silKitParticipantConfig == nullptr)
|
||||
{
|
||||
SDV_LOG_ERROR("The SilKit configuaration file could not be opened.");
|
||||
SetObjectIntoConfigErrorState();
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@@ -322,23 +265,24 @@ bool CCANSilKit::SetHandlerFunctions(SilKit::Services::Orchestration::ILifecycle
|
||||
try
|
||||
{
|
||||
// Set a SilKit Stop Handler
|
||||
silKitLifeCycleService->SetStopHandler([this]()
|
||||
silKitLifeCycleService->SetStopHandler(
|
||||
[this]()
|
||||
{
|
||||
m_eStatus = sdv::EObjectStatus::runtime_error;
|
||||
SetObjectIntoRuntimeErrorState();
|
||||
SDV_LOG_INFO("SilKit StopHandlerhandler called");
|
||||
});
|
||||
|
||||
// Set a Shutdown Handler
|
||||
silKitLifeCycleService->SetShutdownHandler([this]()
|
||||
{
|
||||
m_eStatus = sdv::EObjectStatus::runtime_error;
|
||||
SetObjectIntoRuntimeErrorState();
|
||||
SDV_LOG_INFO("SilKit Shutdown handler called");
|
||||
});
|
||||
|
||||
// Set a Shutdown Handler
|
||||
silKitLifeCycleService->SetAbortHandler([this](auto /*participantState*/)
|
||||
{
|
||||
m_eStatus = sdv::EObjectStatus::runtime_error;
|
||||
SetObjectIntoRuntimeErrorState();
|
||||
SDV_LOG_INFO("SilKit Abort handler called");
|
||||
});
|
||||
|
||||
@@ -363,18 +307,18 @@ bool CCANSilKit::SetHandlerFunctions(SilKit::Services::Orchestration::ILifecycle
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CCANSilKit::CreateSilKitConnection(const std::string& ssSilKitJSONConfigContent, const std::string& ssSilKitNetwork, const std::string& ssSilKitRegistryUri)
|
||||
bool CCANSilKit::CreateSilKitConnection()
|
||||
{
|
||||
try
|
||||
{
|
||||
m_SilKitParticipant = CreateParticipantFromJSONConfig(ssSilKitJSONConfigContent, ssSilKitRegistryUri);
|
||||
m_SilKitParticipant = CreateParticipantFromJSONConfig(m_SilKitJSONConfigContent, m_SilKitRegistryUri);
|
||||
if (m_SilKitParticipant == nullptr)
|
||||
{
|
||||
SDV_LOG_ERROR("SilKit COM adapter is not available.");
|
||||
return false;
|
||||
}
|
||||
|
||||
m_SilKitCanController = CreateController(ssSilKitNetwork);
|
||||
m_SilKitCanController = CreateController(m_SilKitNetwork);
|
||||
if (m_SilKitCanController == nullptr)
|
||||
{
|
||||
SDV_LOG_ERROR("SilKit CAN controller is not available.");
|
||||
@@ -416,7 +360,7 @@ bool CCANSilKit::CreateSilKitConnection(const std::string& ssSilKitJSONConfigCon
|
||||
|
||||
void CCANSilKit::SilKitReceiveMessageHandler(const SilKit::Services::Can::CanFrame& rsSilKitCanFrame)
|
||||
{
|
||||
if (m_eStatus != sdv::EObjectStatus::running)
|
||||
if (GetObjectState() != sdv::EObjectState::running)
|
||||
return;
|
||||
|
||||
if (rsSilKitCanFrame.dlc > m_maxCanDataLength)
|
||||
@@ -461,7 +405,7 @@ void CCANSilKit::SilKitTransmitAcknowledgeHandler(const SilKit::Services::Can::C
|
||||
|
||||
void CCANSilKit::Send(/*in*/ const sdv::can::SMessage& sSDVCanMessage, /*in*/ uint32_t)
|
||||
{
|
||||
if (m_eStatus != sdv::EObjectStatus::running)
|
||||
if (GetObjectState() != sdv::EObjectState::running)
|
||||
return;
|
||||
|
||||
if(sSDVCanMessage.bCanFd)
|
||||
|
||||
@@ -1,3 +1,17 @@
|
||||
/********************************************************************************
|
||||
* Copyright (c) 2025-2026 ZF Friedrichshafen AG
|
||||
*
|
||||
* This program and the accompanying materials are made available under the
|
||||
* terms of the Apache License Version 2.0 which is available at
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Contributors:
|
||||
* Sudipta Durjoy - initial API and implementation
|
||||
* Thomas Pfleiderer - refactored and finalized
|
||||
********************************************************************************/
|
||||
|
||||
#ifndef CAN_COM_SILKIT_H
|
||||
#define CAN_COM_SILKIT_H
|
||||
|
||||
@@ -18,46 +32,54 @@
|
||||
/**
|
||||
* @brief Component to establish Socket CAN communication between VAPI and external application
|
||||
*/
|
||||
class CCANSilKit : public sdv::CSdvObject, public sdv::IObjectControl, public sdv::can::IRegisterReceiver,
|
||||
public sdv::can::ISend, sdv::can::IInformation
|
||||
class CCANSilKit : public sdv::CSdvObject, public sdv::can::IRegisterReceiver, public sdv::can::ISend, sdv::can::IInformation
|
||||
{
|
||||
public:
|
||||
|
||||
// Interface map
|
||||
BEGIN_SDV_INTERFACE_MAP()
|
||||
SDV_INTERFACE_ENTRY(sdv::IObjectControl)
|
||||
SDV_INTERFACE_ENTRY(sdv::can::IRegisterReceiver)
|
||||
SDV_INTERFACE_ENTRY(sdv::can::ISend)
|
||||
SDV_INTERFACE_ENTRY(sdv::can::IInformation)
|
||||
END_SDV_INTERFACE_MAP()
|
||||
|
||||
DECLARE_OBJECT_CLASS_TYPE(sdv::EObjectType::Device)
|
||||
DECLARE_OBJECT_CLASS_TYPE(sdv::EObjectType::vehicle_bus)
|
||||
DECLARE_OBJECT_CLASS_NAME("CAN_Com_SilKit")
|
||||
DECLARE_DEFAULT_OBJECT_NAME("CAN_Communication_Object")
|
||||
DECLARE_OBJECT_SINGLETON()
|
||||
|
||||
/**
|
||||
* @brief Initialize the object. Overload of sdv::IObjectControl::Initialize.
|
||||
* @param[in] ssObjectConfig Optional configuration string.
|
||||
*/
|
||||
virtual void Initialize(const sdv::u8string& ssObjectConfig) override;
|
||||
BEGIN_SDV_PARAM_MAP()
|
||||
SDV_PARAM_ENABLE_LOCKING()
|
||||
SDV_PARAM_ENTRY(m_SilKitJSONConfigContent, "SilKitConfig", "", "", "SilKit Config JSON.")
|
||||
SDV_PARAM_ENTRY(m_SilKitParticipantName, "SilKitParticipantName", "", "", "Name of the participant.")
|
||||
SDV_PARAM_ENTRY(m_SilKitNetwork, "CanSilKitNetwork", "", "", "Declaration of SilKit CAN network.")
|
||||
SDV_PARAM_ENTRY(m_SilKitRegistryUri, "RegistryURI", "", "", "SilKit Registry URI.")
|
||||
SDV_PARAM_ENTRY(m_SilKitIsSynchronousMode, "SyncMode", "", "", "Enable synchronization mode.")
|
||||
SDV_PARAM_ENTRY(m_SilKitDebugInfo, "DebugInfo", "", "", "Enable debug information.")
|
||||
END_SDV_PARAM_MAP()
|
||||
|
||||
/**
|
||||
* @brief Get the current status of the object. Overload of sdv::IObjectControl::GetStatus.
|
||||
* @return Return the current status of the object.
|
||||
* @brief Initialization event, called after object configuration was loaded. Overload of sdv::CSdvObject::OnInitialize.
|
||||
* @details The CAN_Com_SilKit uses the following configuration:
|
||||
* @code
|
||||
* DebugInfo = true
|
||||
* SyncMode = true
|
||||
* SilKitParticipantName = "can_writer"
|
||||
* CanSilKitNetwork = "PrivateCAN"
|
||||
* RegistryURI = "silkit://localhost:8500"
|
||||
* SilKitConfig = """{
|
||||
* "Logging": {
|
||||
* "Sinks": [ { "Type": "Stdout", "Level": "Info" } ]
|
||||
* },
|
||||
* }"""
|
||||
* @endcode
|
||||
* @return Returns 'true' when the initialization was successful, 'false' when not.
|
||||
*/
|
||||
virtual sdv::EObjectStatus GetStatus() const override;
|
||||
virtual bool OnInitialize() override;
|
||||
|
||||
/**
|
||||
* @brief Set the component operation mode. Overload of sdv::IObjectControl::SetOperationMode.
|
||||
* @param[in] eMode The operation mode, the component should run in.
|
||||
* @brief Shutdown the object. Overload of sdv::CSdvObject::OnShutdown.
|
||||
*/
|
||||
void SetOperationMode(sdv::EOperationMode eMode) override;
|
||||
|
||||
/**
|
||||
* @brief Shutdown called before the object is destroyed. Overload of sdv::IObjectControl::Shutdown.
|
||||
*/
|
||||
virtual void Shutdown() override;
|
||||
virtual void OnShutdown() override;
|
||||
|
||||
/**
|
||||
* @brief Register a CAN message receiver. Overload of sdv::can::IRegisterReceiver::RegisterReceiver.
|
||||
@@ -136,16 +158,13 @@ private:
|
||||
* @param[in] ssSilKitNetwork SilKit network.
|
||||
* @return SilKit::Services::Can::ICanController, nullptr on failure.
|
||||
*/
|
||||
SilKit::Services::Can::ICanController* CreateController(const std::string& ssSilKitNetwork);
|
||||
SilKit::Services::Can::ICanController* CreateController(const std::string& ssSilKitNetwork);
|
||||
|
||||
/**
|
||||
* @brief Validate if the configuration includes all required settings
|
||||
* @param[in] ssSilKitJSONConfigContent SilKit JSON config file.
|
||||
* @param[in] ssSilKitNetwork Declaration of SilKit CAN network.
|
||||
* @param[in] ssSilKitRegistryUri SilKit Registry URI.
|
||||
* @return Return true if required settings are available
|
||||
*/
|
||||
bool ValidateConfiguration(const std::string& ssSilKitJSONConfigContent, const std::string& ssSilKitNetwork, const std::string& ssSilKitRegistryUri);
|
||||
bool ValidateConfiguration();
|
||||
|
||||
/**
|
||||
* @brief Function for SilKit Timesyncservice creation and to set simulation step handler.
|
||||
@@ -154,12 +173,9 @@ private:
|
||||
|
||||
/**
|
||||
* @brief Function to setup CAN interfaces.
|
||||
* @param[in] ssSilKitJSONConfigContent SilKit JSON config file.
|
||||
* @param[in] ssSilKitNetwork Declaration of SilKit CAN network.
|
||||
* @param[in] ssSilKitRegistryUri SilKit Registry URI.
|
||||
* @return Return true if CAN interfaces are setup successfully
|
||||
*/
|
||||
bool CreateSilKitConnection(const std::string& ssSilKitJSONConfigContent, const std::string& ssSilKitNetwork, const std::string& ssSilKitRegistryUri);
|
||||
bool CreateSilKitConnection();
|
||||
|
||||
/**
|
||||
* @brief Create lifecycle service.
|
||||
@@ -185,21 +201,24 @@ private:
|
||||
*/
|
||||
void SilKitTransmitAcknowledgeHandler(const SilKit::Services::Can::CanFrameTransmitEvent& rsSilKitTransmitAcknowledge);
|
||||
|
||||
std::mutex m_ReceiversMtx; ///< Protect the receiver set.
|
||||
std::set<sdv::can::IReceive*> m_SetReceivers; ///< Set with receiver interfaces.
|
||||
std::mutex m_ReceiversMtx; ///< Protect the receiver set.
|
||||
std::set<sdv::can::IReceive*> m_SetReceivers; ///< Set with receiver interfaces.
|
||||
|
||||
std::queue<sdv::can::SMessage> m_MessageQueue; ///< Map of the messages to be sent on SilKit.
|
||||
std::mutex m_QueueMutex; ///< Protection for message map.
|
||||
std::queue<sdv::can::SMessage> m_MessageQueue; ///< Map of the messages to be sent on SilKit.
|
||||
std::mutex m_QueueMutex; ///< Protection for message map.
|
||||
|
||||
SilKit::Services::Orchestration::ILifecycleService* m_SilKitLifeCycleService = nullptr; ///< SilKit lifecycle service.
|
||||
SilKit::Services::Can::ICanController* m_SilKitCanController = nullptr; ///< SilKit CAN1 Controller interface.
|
||||
sdv::core::ITimerSimulationStep* m_TimerSimulationStep = nullptr; ///< Timer simulation step.
|
||||
std::unique_ptr<SilKit::IParticipant> m_SilKitParticipant = nullptr; ///< SilKit participant.
|
||||
std::string m_SilKitParticipantName; ///< Configured SilKit participants.
|
||||
bool m_SilKitIsSynchronousMode = false; ///< SilKit sync mode when true.
|
||||
SilKit::Services::Orchestration::ILifecycleService* m_SilKitLifeCycleService = nullptr; ///< SilKit lifecycle service.
|
||||
SilKit::Services::Can::ICanController* m_SilKitCanController = nullptr; ///< SilKit CAN1 Controller interface.
|
||||
sdv::core::ITimerSimulationStep* m_TimerSimulationStep = nullptr; ///< Timer simulation step.
|
||||
std::unique_ptr<SilKit::IParticipant> m_SilKitParticipant = nullptr; ///< SilKit participant.
|
||||
std::string m_SilKitParticipantName; ///< Configured SilKit participants.
|
||||
bool m_SilKitIsSynchronousMode = false; ///< SilKit sync mode when true.
|
||||
bool m_SilKitDebugInfo = false; ///< SilKit debug information when true.
|
||||
|
||||
uint32_t m_maxCanDataLength = 8; ///< maximum size of the CAN message.
|
||||
std::atomic<sdv::EObjectStatus> m_eStatus = sdv::EObjectStatus::initialization_pending; ///< Object status.
|
||||
uint32_t m_maxCanDataLength = 8; ///< maximum size of the CAN message.
|
||||
std::string m_SilKitNetwork; ///< Declaration of SilKit CAN network.
|
||||
std::string m_SilKitJSONConfigContent; ///< SilKit config JSON.
|
||||
std::string m_SilKitRegistryUri;
|
||||
};
|
||||
|
||||
DEFINE_SDV_OBJECT(CCANSilKit)
|
||||
|
||||
Reference in New Issue
Block a user