Skip to content

Commit

Permalink
Merge pull request #1 from Lagavulin9/main
Browse files Browse the repository at this point in the history
fix:commonapi version, cmake
  • Loading branch information
kianwasabi authored Dec 13, 2023
2 parents fe8156b + 1841550 commit 521b9b1
Show file tree
Hide file tree
Showing 16 changed files with 55 additions and 35 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/codegenerator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ jobs:
- name: 2) Download CommonAPI Core Generator.
run: |
wget https://github.com/COVESA/capicxx-core-tools/releases/download/3.2.0.1/commonapi_core_generator.zip
wget https://github.com/COVESA/capicxx-core-tools/releases/download/3.2.14/commonapi_core_generator.zip
unzip commonapi_core_generator.zip -d ${{ github.workspace }}/core-generator
- name: 3) Download CommonAPI vSOME/IP Generator.
run: |
wget https://github.com/COVESA/capicxx-someip-tools/releases/download/3.2.0.1/commonapi_someip_generator.zip
wget https://github.com/COVESA/capicxx-someip-tools/releases/download/3.2.14/commonapi_someip_generator.zip
unzip commonapi_someip_generator.zip -d ${{ github.workspace }}/someip-generator
- name: 4) Generate CommonAPI Code from Core Generator.
Expand Down
42 changes: 26 additions & 16 deletions car_control/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
### SETUP ###
cmake_minimum_required (VERSION 3.0)
set(PROJ_NAME Car_Control)
set(PROJ_NAME Car_Control VERSION 0.1 LANGUAGES CXX)
project(${PROJ_NAME})
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}-pthread -std=c++11 -fsanitize=thread -g ")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread -std=c++11")

### PACKAGES ###
find_package(Python3 COMPONENTS Development)
find_package(Boost REQUIRED COMPONENTS python3)
find_package(Boost 1.55 REQUIRED COMPONENTS python3 system thread log)
find_package(CommonAPI REQUIRED)
find_package(CommonAPI-SomeIP REQUIRED)

Expand All @@ -21,38 +21,40 @@ set(SOMEIP_RUNTIME_DIR ~/capicxx-someip-runtime)
set(VSOMEIP_DIR ~/vsomeip)
set(COMMONAPI_INTERFACE_VER v0/commonapi)

FILE(GLOB PRJ_SOMEIP_LIB_SRCS ./src-gen/someip/v0/commonapi/*.cpp)

### DIRECTORIES ###
include_directories(
./include
./src-gen/core
./src-gen/someip
${Python3_INCLUDE_DIRS}
${CORE_GEN_SRC_DIR}
${SOMEIP_GEN_SRC_DIR}
${SOMEIP_RUNTIME_DIR}/include
${CORE_RUNTIME_DIR}/include
${VSOMEIP_DIR}/include
${COMMONAPI_INCLUDE_DIRS}
${COMMONAPI_SOMEIP_INCLUDE_DIRS}
)

link_directories(
${SOMEIP_RUNTIME_DIR}/build
${CORE_RUNTIME_DIR}/build
${VSOMEIP_DIR}/build
${COMMONAPI_LIBDIR}
${COMMONAPI_SOMEIP_CMAKE_DIR}/build
${Boost_LIBRARY_DIR}
# ${SOMEIP_RUNTIME_DIR}/build
# ${CORE_RUNTIME_DIR}/build
# ${VSOMEIP_DIR}/build
)

### BUILD ###
# Services
add_executable(CarControlService
add_executable(CarControlService
${PRJ_SRC_VAR}/GamePad.cpp
${PRJ_SRC_VAR}/PiRacer.cpp
${PRJ_SRC_VAR}/CarControlService.cpp
${PRJ_SRC_VAR}/CarControlStubImpl.cpp
${SOMEIP_GEN_SRC_DIR}/${COMMONAPI_INTERFACE_VER}/CarControlSomeIPStubAdapter.cpp
${SOMEIP_GEN_SRC_DIR}/${COMMONAPI_INTERFACE_VER}/CarControlSomeIPDeployment.cpp
)
target_link_libraries(CarControlService
target_link_libraries(CarControlService
CommonAPI
CommonAPI-SomeIP
vsomeip3
Python3::Python
Python3::Python
Boost::python
)
# Client
Expand All @@ -66,3 +68,11 @@ target_link_libraries(CarControlClient
CommonAPI-SomeIP
vsomeip3
)

add_library(CarControlService-someip
SHARED ${PRJ_SOMEIP_LIB_SRCS}
)
target_link_libraries(CarControlService-someip
CommonAPI
CommonAPI-SomeIP
)
2 changes: 1 addition & 1 deletion car_control/src-gen/core/v0/commonapi/CarControl.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* This file was generated by the CommonAPI Generators.
* Used org.genivi.commonapi.core 3.2.0.v202012010850.
* Used org.genivi.commonapi.core 3.2.14.v202310241605.
* Used org.franca.core 0.13.1.201807231814.
*
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
Expand Down
4 changes: 2 additions & 2 deletions car_control/src-gen/core/v0/commonapi/CarControlProxy.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* This file was generated by the CommonAPI Generators.
* Used org.genivi.commonapi.core 3.2.0.v202012010850.
* Used org.genivi.commonapi.core 3.2.14.v202310241605.
* Used org.franca.core 0.13.1.201807231814.
*
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
Expand Down Expand Up @@ -38,7 +38,7 @@ class CarControlProxy
CarControlProxy(std::shared_ptr<CommonAPI::Proxy> delegate);
~CarControlProxy();

typedef CarControl InterfaceType;
typedef ::v0::commonapi::CarControl InterfaceType;


/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* This file was generated by the CommonAPI Generators.
* Used org.genivi.commonapi.core 3.2.0.v202012010850.
* Used org.genivi.commonapi.core 3.2.14.v202310241605.
* Used org.franca.core 0.13.1.201807231814.
*
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
Expand Down
4 changes: 2 additions & 2 deletions car_control/src-gen/core/v0/commonapi/CarControlStub.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* This file was generated by the CommonAPI Generators.
* Used org.genivi.commonapi.core 3.2.0.v202012010850.
* Used org.genivi.commonapi.core 3.2.14.v202310241605.
* Used org.franca.core 0.13.1.201807231814.
*
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
Expand Down Expand Up @@ -152,7 +152,7 @@ class CarControlStub
typedef CommonAPI::Stub<CarControlStubAdapter, CarControlStubRemoteEvent>::StubAdapterType StubAdapterType;
typedef CommonAPI::Stub<CarControlStubAdapter, CarControlStubRemoteEvent>::RemoteEventHandlerType RemoteEventHandlerType;
typedef CarControlStubRemoteEvent RemoteEventType;
typedef CarControl StubInterface;
typedef ::v0::commonapi::CarControl StubInterface;
};

} // namespace commonapi
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* This file was generated by the CommonAPI Generators.
* Used org.genivi.commonapi.core 3.2.0.v202012010850.
* Used org.genivi.commonapi.core 3.2.14.v202310241605.
* Used org.franca.core 0.13.1.201807231814.
*
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"commonapi.CarControl" : {
"service_id": 4000,
"instances" : {
"commonapi.CarControl": 4001
}
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* This file was generated by the CommonAPI Generators.
* Used org.genivi.commonapi.someip 3.2.0.v202012010944.
* Used org.genivi.commonapi.someip 3.2.14.v202310241606.
* Used org.franca.core 0.13.1.201807231814.
*
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* This file was generated by the CommonAPI Generators.
* Used org.genivi.commonapi.someip 3.2.0.v202012010944.
* Used org.genivi.commonapi.someip 3.2.14.v202310241606.
* Used org.franca.core 0.13.1.201807231814.
*
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* This file was generated by the CommonAPI Generators.
* Used org.genivi.commonapi.someip 3.2.0.v202012010944.
* Used org.genivi.commonapi.someip 3.2.14.v202310241606.
* Used org.franca.core 0.13.1.201807231814.
*
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
Expand Down Expand Up @@ -53,7 +53,6 @@ CarControlSomeIPProxy::CarControlSomeIPProxy(
}

CarControlSomeIPProxy::~CarControlSomeIPProxy() {
completed_.set_value();
}

CarControlSomeIPProxy::IndicatorAttribute& CarControlSomeIPProxy::getIndicatorAttribute() {
Expand Down Expand Up @@ -128,7 +127,7 @@ void CarControlSomeIPProxy::getOwnVersion(uint16_t& ownVersionMajor, uint16_t& o
}

std::future<void> CarControlSomeIPProxy::getCompletionFuture() {
return completed_.get_future();
return CommonAPI::SomeIP::Proxy::getCompletionFuture();
}

} // namespace commonapi
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* This file was generated by the CommonAPI Generators.
* Used org.genivi.commonapi.someip 3.2.0.v202012010944.
* Used org.genivi.commonapi.someip 3.2.14.v202310241606.
* Used org.franca.core 0.13.1.201807231814.
*
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
Expand Down Expand Up @@ -71,7 +71,6 @@ class CarControlSomeIPProxy
CommonAPI::SomeIP::ObservableAttribute<CommonAPI::SomeIP::ReadonlyAttribute<IndicatorAttribute, CommonAPI::SomeIP::StringDeployment>> indicator_;
CommonAPI::SomeIP::ObservableAttribute<CommonAPI::SomeIP::ReadonlyAttribute<GearAttribute, CommonAPI::SomeIP::StringDeployment>> gear_;

std::promise<void> completed_;
};

} // namespace commonapi
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* This file was generated by the CommonAPI Generators.
* Used org.genivi.commonapi.someip 3.2.0.v202012010944.
* Used org.genivi.commonapi.someip 3.2.14.v202310241606.
* Used org.franca.core 0.13.1.201807231814.
*
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* This file was generated by the CommonAPI Generators.
* Used org.genivi.commonapi.someip 3.2.0.v202012010944.
* Used org.genivi.commonapi.someip 3.2.14.v202310241606.
* Used org.franca.core 0.13.1.201807231814.
*
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
Expand Down Expand Up @@ -111,7 +111,7 @@ class CarControlSomeIPStubAdapterInternal
CarControlSomeIPStubAdapterHelper::addStubDispatcher( { CommonAPI::SomeIP::method_id_t(0x1005) }, &getIndicatorAttributeStubDispatcher );
CarControlSomeIPStubAdapterHelper::addStubDispatcher( { CommonAPI::SomeIP::method_id_t(0x1069) }, &getGearAttributeStubDispatcher );
CarControlSomeIPStubAdapterHelper::addStubDispatcher( { CommonAPI::SomeIP::method_id_t(0x1068) }, &gearSelectionHeadUnitStubDispatcher );
std::shared_ptr<CommonAPI::SomeIP::ClientId> itsClient = std::make_shared<CommonAPI::SomeIP::ClientId>(0xFFFF, 0xFFFFFFFF, 0xFFFFFFFF);
std::shared_ptr<CommonAPI::SomeIP::ClientId> itsClient = std::make_shared<CommonAPI::SomeIP::ClientId>();

// Provided events/fields
if (_stub->hasElement(0)) {
Expand Down Expand Up @@ -175,10 +175,12 @@ void CarControlSomeIPStubAdapterInternal<_Stub, _Stubs...>::fireGearAttributeCha

template <typename _Stub, typename... _Stubs>
void CarControlSomeIPStubAdapterInternal<_Stub, _Stubs...>::registerSelectiveEventHandlers() {

}

template <typename _Stub, typename... _Stubs>
void CarControlSomeIPStubAdapterInternal<_Stub, _Stubs...>::unregisterSelectiveEventHandlers() {

}

template <typename _Stub = ::v0::commonapi::CarControlStub, typename... _Stubs>
Expand Down
1 change: 1 addition & 0 deletions car_control/src/CarControlClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include <cstdlib>
#include <CommonAPI/CommonAPI.hpp>
#include "../src-gen/core/v0/commonapi/CarControlProxy.hpp"
#include <thread>

using namespace v0::commonapi;

Expand Down
1 change: 1 addition & 0 deletions car_control/src/CarControlService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include <vector>
#include <unistd.h>
#include <Python.h>
#include <thread>

/* signal handler */
void signalHandler(int signum)
Expand Down

0 comments on commit 521b9b1

Please sign in to comment.