mirror of
https://github.com/eclipse-openvehicle-api/openvehicle-api.git
synced 2026-04-21 11:38:16 +00:00
Update sdv_packager (#6)
This commit is contained in:
@@ -1,3 +1,16 @@
|
||||
/********************************************************************************
|
||||
* 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:
|
||||
* Erik Verhoeven - initial API and implementation
|
||||
********************************************************************************/
|
||||
|
||||
#include "com_ctrl.h"
|
||||
#include <interfaces/ipc.h>
|
||||
#include <support/toml.h>
|
||||
@@ -14,36 +27,13 @@ CCommunicationControl::CCommunicationControl()
|
||||
CCommunicationControl::~CCommunicationControl()
|
||||
{}
|
||||
|
||||
void CCommunicationControl::Initialize(const sdv::u8string& /*ssObjectConfig*/)
|
||||
bool CCommunicationControl::OnInitialize()
|
||||
{
|
||||
m_eObjectStatus = sdv::EObjectStatus::initialized;
|
||||
return true;
|
||||
}
|
||||
|
||||
sdv::EObjectStatus CCommunicationControl::GetStatus() const
|
||||
void CCommunicationControl::OnShutdown()
|
||||
{
|
||||
return m_eObjectStatus;
|
||||
}
|
||||
|
||||
void CCommunicationControl::SetOperationMode(sdv::EOperationMode eMode)
|
||||
{
|
||||
switch (eMode)
|
||||
{
|
||||
case sdv::EOperationMode::configuring:
|
||||
if (m_eObjectStatus == sdv::EObjectStatus::running || m_eObjectStatus == sdv::EObjectStatus::initialized)
|
||||
m_eObjectStatus = sdv::EObjectStatus::configuring;
|
||||
break;
|
||||
case sdv::EOperationMode::running:
|
||||
if (m_eObjectStatus == sdv::EObjectStatus::configuring || m_eObjectStatus == sdv::EObjectStatus::initialized)
|
||||
m_eObjectStatus = sdv::EObjectStatus::running;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void CCommunicationControl::Shutdown()
|
||||
{
|
||||
m_eObjectStatus = sdv::EObjectStatus::shutdown_in_progress;
|
||||
|
||||
// Wait for threads to terminate... in case one is still running
|
||||
// (use a copy to prevent circular access)
|
||||
@@ -64,8 +54,6 @@ void CCommunicationControl::Shutdown()
|
||||
lock.unlock();
|
||||
vecChannels.clear();
|
||||
mapStubObjects.clear();
|
||||
|
||||
m_eObjectStatus = sdv::EObjectStatus::destruction_pending;
|
||||
}
|
||||
|
||||
sdv::com::TConnectionID CCommunicationControl::CreateServerConnection(/*in*/ sdv::com::EChannelType eChannelType,
|
||||
|
||||
Reference in New Issue
Block a user