├── .clang-format
├── .clang-tidy
├── .conan
└── profiles
│ ├── linux-aarch64
│ └── linux-x86_64
├── .devcontainer
├── Dockerfile
├── devcontainer.json
└── scripts
│ ├── configure-codespaces.sh
│ ├── configure-proxies.sh
│ ├── container-set.sh
│ ├── onCreateCommand.sh
│ ├── postStartCommand.sh
│ ├── reinstall-cmake.sh
│ ├── setup-dependencies.sh
│ ├── setup-git.sh
│ └── upgrade-cli.sh
├── .dockerignore
├── .gitattributes
├── .github
├── ISSUE_TEMPLATE
│ ├── bug-report.yml
│ ├── feature-request.yml
│ └── question.yml
├── PULL_REQUEST_TEMPLATE.md
├── scripts
│ ├── deploy_image_from_artifact.sh
│ └── junit.tpl
└── workflows
│ ├── check-licenses.yml
│ ├── check-updates.yml
│ ├── ci.yml
│ └── ensure-lifecycle.yml
├── .gitignore
├── .licensechecker.yml
├── .pre-commit-config.yaml
├── .scripts
├── common.sh
└── test_package.sh
├── .velocitas-lock.json
├── .velocitas.json
├── .vscode
├── c_cpp_properties.json
├── launch.json
└── tasks.json
├── CMakeLists.txt
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── CPPLINT.cfg
├── LICENSE
├── NOTICE-3RD-PARTY-CONTENT.md
├── NOTICE.md
├── README.md
├── SECURITY.md
├── build.sh
├── conanfile.py
├── examples
├── CMakeLists.txt
├── example_model
│ ├── CMakeLists.txt
│ └── vehicle
│ │ ├── Cabin
│ │ ├── Cabin.h
│ │ └── Seat
│ │ │ └── Seat.h
│ │ └── Vehicle.h
├── grpc_client
│ ├── AppManifest.json
│ ├── CMakeLists.txt
│ ├── README.md
│ └── src
│ │ ├── CMakeLists.txt
│ │ └── Launcher.cpp
├── grpc_server
│ ├── AppManifest.json
│ ├── CMakeLists.txt
│ ├── README.md
│ └── src
│ │ ├── CMakeLists.txt
│ │ ├── Launcher.cpp
│ │ ├── SeatsServiceImpl.cpp
│ │ └── SeatsServiceImpl.h
├── performance-subscribe
│ ├── AppManifest.json
│ ├── CMakeLists.txt
│ ├── README.md
│ ├── src
│ │ ├── Launcher.cpp
│ │ ├── PerformanceTestApp.cpp
│ │ └── PerformanceTestApp.h
│ └── subscription_signals.json
├── seat-adjuster
│ ├── AppManifest.json
│ ├── CMakeLists.txt
│ └── src
│ │ ├── SeatAdjusterApp.cpp
│ │ └── SeatAdjusterApp.h
└── set-data-points
│ ├── AppManifest.json
│ ├── CMakeLists.txt
│ └── src
│ └── SetDataPointsApp.cpp
├── gcovr.cfg
├── install_dependencies.sh
├── license_header.txt
├── requirements.txt
├── sdk
├── CMakeLists.txt
├── include
│ └── sdk
│ │ ├── AsyncResult.h
│ │ ├── DataPoint.h
│ │ ├── DataPointBatch.h
│ │ ├── DataPointReply.h
│ │ ├── DataPointValue.h
│ │ ├── Exceptions.h
│ │ ├── IPubSubClient.h
│ │ ├── Job.h
│ │ ├── Logger.h
│ │ ├── Model.h
│ │ ├── Node.h
│ │ ├── QueryBuilder.h
│ │ ├── Status.h
│ │ ├── ThreadPool.h
│ │ ├── Utils.h
│ │ ├── VehicleApp.h
│ │ ├── VehicleModelContext.h
│ │ ├── grpc
│ │ ├── AsyncGrpcFacade.h
│ │ ├── GrpcCall.h
│ │ └── GrpcClient.h
│ │ ├── middleware
│ │ └── Middleware.h
│ │ └── vdb
│ │ └── IVehicleDataBrokerClient.h
├── proto
│ ├── CMakeLists.txt
│ ├── kuksa
│ │ └── val
│ │ │ └── v2
│ │ │ ├── types.proto
│ │ │ └── val.proto
│ └── sdv
│ │ └── databroker
│ │ └── v1
│ │ ├── broker.proto
│ │ ├── collector.proto
│ │ └── types.proto
├── src
│ ├── CMakeLists.txt
│ └── sdk
│ │ ├── DataPoint.cpp
│ │ ├── DataPointValue.cpp
│ │ ├── Job.cpp
│ │ ├── Logger.cpp
│ │ ├── Model.cpp
│ │ ├── Node.cpp
│ │ ├── QueryBuilder.cpp
│ │ ├── ThreadPool.cpp
│ │ ├── Utils.cpp
│ │ ├── VehicleApp.cpp
│ │ ├── grpc
│ │ ├── AsyncGrpcFacade.cpp
│ │ └── GrpcClient.cpp
│ │ ├── middleware
│ │ ├── Middleware.cpp
│ │ ├── NativeMiddleware.cpp
│ │ └── NativeMiddleware.h
│ │ ├── pubsub
│ │ └── MqttPubSubClient.cpp
│ │ └── vdb
│ │ ├── DataPointBatch.cpp
│ │ ├── IVehicleDataBrokerClient.cpp
│ │ └── grpc
│ │ ├── common
│ │ ├── ChannelConfiguration.cpp
│ │ ├── ChannelConfiguration.h
│ │ ├── TypeConversions.cpp
│ │ └── TypeConversions.h
│ │ ├── kuksa_val_v2
│ │ ├── BrokerAsyncGrpcFacade.cpp
│ │ ├── BrokerAsyncGrpcFacade.h
│ │ ├── BrokerClient.cpp
│ │ ├── BrokerClient.h
│ │ ├── Metadata.cpp
│ │ ├── Metadata.h
│ │ ├── TypeConversions.cpp
│ │ └── TypeConversions.h
│ │ └── sdv_databroker_v1
│ │ ├── BrokerAsyncGrpcFacade.cpp
│ │ ├── BrokerAsyncGrpcFacade.h
│ │ ├── BrokerClient.cpp
│ │ ├── BrokerClient.h
│ │ ├── GrpcDataPointValueProvider.cpp
│ │ ├── GrpcDataPointValueProvider.h
│ │ └── IDataPointValueProvider.h
└── tests
│ ├── CMakeLists.txt
│ ├── mocks
│ └── VehicleDataBrokerClientMock.h
│ ├── model
│ └── Vehicle.h
│ └── unit
│ ├── AsyncResult_tests.cpp
│ ├── AsyncSubscription_tests.cpp
│ ├── CMakeLists.txt
│ ├── DataPointBatch_tests.cpp
│ ├── DataPointValue_tests.cpp
│ ├── DataPoint_tests.cpp
│ ├── Job_tests.cpp
│ ├── Logger_tests.cpp
│ ├── Middleware_tests.cpp
│ ├── NativeMiddleware_tests.cpp
│ ├── Node_tests.cpp
│ ├── PubSub_tests.cpp
│ ├── QueryBuilder_tests.cpp
│ ├── ScopedBoolInverter_tests.cpp
│ ├── TestBaseUsingEnvVars.cpp
│ ├── TestBaseUsingEnvVars.h
│ ├── ThreadPool_tests.cpp
│ ├── Utils_tests.cpp
│ ├── grpc
│ └── GrpcClient_tests.cpp
│ ├── testmain.cpp
│ └── vdb
│ └── grpc
│ ├── kuksa_val_v2
│ └── TypeConversions_tests.cpp
│ └── sdv_databroker_v1
│ └── BrokerClient_tests.cpp
├── test_package
├── CMakeLists.txt
├── conanfile.py
└── main.cpp
└── whitelisted-licenses.txt
/.clang-tidy:
--------------------------------------------------------------------------------
1 | ---
2 | Checks: 'clang-analyzer-*,
3 | cppcoreguidelines-*,
4 | modernize-*,
5 | readability-*,
6 | -google-readability-todo,
7 | -readability-convert-member-functions-to-static,
8 | -bugprone-branch-clone,
9 | -cppcoreguidelines-avoid-non-const-global-variables,
10 | -modernize-use-equals-default,
11 | -modernize-use-trailing-return-type,
12 | -readability-make-member-function-const'
13 | HeaderFilterRegex: 'include'
14 | WarningsAsErrors: 'clang-analyzer-*,
15 | modernize-*,
16 | cppcoreguidelines-*,
17 | readability-*,
18 | -google-readability-todo,
19 | -readability-convert-member-functions-to-static,
20 | -bugprone-branch-clone,
21 | -cppcoreguidelines-avoid-non-const-global-variables,
22 | -modernize-use-equals-default,
23 | -modernize-use-trailing-return-type,
24 | -readability-make-member-function-const'
25 | AnalyzeTemporaryDtors: false
26 | FormatStyle: file
27 | CheckOptions:
28 | - key: cert-dcl16-c.NewSuffixes
29 | value: 'L;LL;LU;LLU'
30 | - key: cert-oop54-cpp.WarnOnlyIfThisHasSuspiciousField
31 | value: '0'
32 | - key: cppcoreguidelines-explicit-virtual-functions.IgnoreDestructors
33 | value: '1'
34 | - key: cppcoreguidelines-non-private-member-variables-in-classes.IgnoreClassesWithAllMemberVariablesBeingPublic
35 | value: '1'
36 | - key: google-readability-braces-around-statements.ShortStatementLines
37 | value: '1'
38 | - key: google-readability-function-size.StatementThreshold
39 | value: '800'
40 | - key: google-readability-namespace-comments.ShortNamespaceLines
41 | value: '10'
42 | - key: google-readability-namespace-comments.SpacesBeforeComments
43 | value: '2'
44 | - key: modernize-loop-convert.MaxCopySize
45 | value: '16'
46 | - key: modernize-loop-convert.MinConfidence
47 | value: reasonable
48 | - key: modernize-loop-convert.NamingStyle
49 | value: CamelCase
50 | - key: modernize-pass-by-value.IncludeStyle
51 | value: llvm
52 | - key: modernize-replace-auto-ptr.IncludeStyle
53 | value: llvm
54 | - key: modernize-use-nullptr.NullMacros
55 | value: 'NULL'
56 | ...
57 |
--------------------------------------------------------------------------------
/.conan/profiles/linux-aarch64:
--------------------------------------------------------------------------------
1 | [settings]
2 | os=Linux
3 | arch=armv8
4 | compiler=gcc
5 | compiler.version=11
6 | compiler.cppstd=17
7 | compiler.libcxx=libstdc++11
8 |
9 | [buildenv]
10 | CC=aarch64-linux-gnu-gcc-11
11 | CXX=aarch64-linux-gnu-g++-11
12 | LD=aarch64-linux-gnu-ld
13 |
--------------------------------------------------------------------------------
/.conan/profiles/linux-x86_64:
--------------------------------------------------------------------------------
1 | [settings]
2 | os=Linux
3 | arch=x86_64
4 | compiler=gcc
5 | compiler.version=11
6 | compiler.cppstd=17
7 | compiler.libcxx=libstdc++11
8 |
9 | [buildenv]
10 | CC=x86_64-linux-gnu-gcc-11
11 | CXX=x86_64-linux-gnu-g++-11
12 | LD=x86_64-linux-gnu-ld
13 |
--------------------------------------------------------------------------------
/.devcontainer/Dockerfile:
--------------------------------------------------------------------------------
1 | # This file is maintained by velocitas CLI, do not modify manually. Change settings in .velocitas.json
2 | # Copyright (c) 2022-2025 Contributors to the Eclipse Foundation
3 | #
4 | # This program and the accompanying materials are made available under the
5 | # terms of the Apache License, Version 2.0 which is available at
6 | # https://www.apache.org/licenses/LICENSE-2.0.
7 | #
8 | # Unless required by applicable law or agreed to in writing, software
9 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
10 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
11 | # License for the specific language governing permissions and limitations
12 | # under the License.
13 | #
14 | # SPDX-License-Identifier: Apache-2.0
15 |
16 | FROM ghcr.io/eclipse-velocitas/devcontainer-base-images/cpp:v0.4
17 |
18 | ARG REINSTALL_CMAKE_VERSION_FROM_SOURCE
19 | ENV REINSTALL_CMAKE_VERSION_FROM_SOURCE="${REINSTALL_CMAKE_VERSION_FROM_SOURCE:-none}"
20 |
21 | COPY scripts/*.sh /tmp/scripts/
22 | RUN find /tmp/scripts/ -type f -iname "*.sh" -exec chmod +x {} \;
23 | RUN /bin/bash /tmp/scripts/configure-proxies.sh
24 |
--------------------------------------------------------------------------------
/.devcontainer/scripts/configure-codespaces.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # This file is maintained by velocitas CLI, do not modify manually. Change settings in .velocitas.json
3 | # Copyright (c) 2023-2025 Contributors to the Eclipse Foundation
4 | #
5 | # This program and the accompanying materials are made available under the
6 | # terms of the Apache License, Version 2.0 which is available at
7 | # https://www.apache.org/licenses/LICENSE-2.0.
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12 | # License for the specific language governing permissions and limitations
13 | # under the License.
14 | #
15 | # SPDX-License-Identifier: Apache-2.0
16 |
17 | if [ "${CODESPACES}" = "true" ]; then
18 | echo "#######################################################"
19 | echo "### Setup Access to Codespaces ###"
20 | echo "#######################################################"
21 |
22 | # restart Docker connection if in Codespaces
23 | # Workaround according to https://github.com/devcontainers/features/issues/671#issuecomment-1701754897
24 | sudo pkill dockerd && sudo pkill containerd
25 | /usr/local/share/docker-init.sh
26 |
27 | # Remove the default credential helper
28 | sudo sed -i -E 's/helper =.*//' /etc/gitconfig
29 |
30 | # Add one that just uses secrets available in the Codespace
31 | git config --global credential.helper '!f() { sleep 1; echo "username=${GITHUB_USER}"; echo "password=${MY_GH_TOKEN}"; }; f'
32 | fi
33 |
--------------------------------------------------------------------------------
/.devcontainer/scripts/container-set.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # This file is maintained by velocitas CLI, do not modify manually. Change settings in .velocitas.json
3 | # Copyright (c) 2022-2025 Contributors to the Eclipse Foundation
4 | #
5 | # This program and the accompanying materials are made available under the
6 | # terms of the Apache License, Version 2.0 which is available at
7 | # https://www.apache.org/licenses/LICENSE-2.0.
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12 | # License for the specific language governing permissions and limitations
13 | # under the License.
14 | #
15 | # SPDX-License-Identifier: Apache-2.0
16 |
17 | echo "#######################################################"
18 | echo "### Checking container creation ###"
19 | echo "#######################################################"
20 | useradd vscode --password vscode -m
21 | usermod -aG sudo vscode
22 |
--------------------------------------------------------------------------------
/.devcontainer/scripts/onCreateCommand.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # This file is maintained by velocitas CLI, do not modify manually. Change settings in .velocitas.json
3 | # Copyright (c) 2022-2025 Contributors to the Eclipse Foundation
4 | #
5 | # This program and the accompanying materials are made available under the
6 | # terms of the Apache License, Version 2.0 which is available at
7 | # https://www.apache.org/licenses/LICENSE-2.0.
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12 | # License for the specific language governing permissions and limitations
13 | # under the License.
14 | #
15 | # SPDX-License-Identifier: Apache-2.0
16 |
17 | sudo chmod +x .devcontainer/scripts/*.sh
18 |
19 | .devcontainer/scripts/setup-git.sh
20 |
21 | if [[ -z "${VELOCITAS_OFFLINE}" ]]; then
22 | .devcontainer/scripts/configure-codespaces.sh
23 | .devcontainer/scripts/upgrade-cli.sh
24 | fi
25 |
26 | # Call user initialization hook if present
27 | ON_CREATE_USER_HOOK_PATH=.devcontainer/scripts/onCreateUserHook.sh
28 | if [[ -x $ON_CREATE_USER_HOOK_PATH ]]; then
29 | $ON_CREATE_USER_HOOK_PATH
30 | fi
31 |
32 | echo "#######################################################"
33 | echo "### Run VADF Lifecycle Management ###"
34 | echo "#######################################################"
35 | velocitas init
36 | velocitas sync
37 |
38 | # Some setup might be required even in offline mode
39 | .devcontainer/scripts/setup-dependencies.sh
40 |
41 | echo "#######################################################"
42 | echo "### VADF package status ###"
43 | echo "#######################################################"
44 | velocitas upgrade --dry-run --ignore-bounds
45 |
46 | # Don't let container creation fail if lifecycle management fails
47 | echo "Done!"
48 |
--------------------------------------------------------------------------------
/.devcontainer/scripts/postStartCommand.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # This file is maintained by velocitas CLI, do not modify manually. Change settings in .velocitas.json
3 | # Copyright (c) 2024-2025 Contributors to the Eclipse Foundation
4 | #
5 | # This program and the accompanying materials are made available under the
6 | # terms of the Apache License, Version 2.0 which is available at
7 | # https://www.apache.org/licenses/LICENSE-2.0.
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12 | # License for the specific language governing permissions and limitations
13 | # under the License.
14 | #
15 | # SPDX-License-Identifier: Apache-2.0
16 |
17 | if [[ -z "${VELOCITAS_OFFLINE}" ]]; then
18 | .devcontainer/scripts/upgrade-cli.sh
19 | fi
20 |
21 | # Call user initialization hook if present
22 | POST_START_USER_HOOK_PATH=.devcontainer/scripts/onPostStartUserHook.sh
23 | if [[ -x $POST_START_USER_HOOK_PATH ]]; then
24 | $POST_START_USER_HOOK_PATH
25 | fi
26 |
--------------------------------------------------------------------------------
/.devcontainer/scripts/reinstall-cmake.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # This file is maintained by velocitas CLI, do not modify manually. Change settings in .velocitas.json
3 | # Copyright (c) 2023-2025 Contributors to the Eclipse Foundation
4 | #
5 | # This program and the accompanying materials are made available under the
6 | # terms of the Apache License, Version 2.0 which is available at
7 | # https://www.apache.org/licenses/LICENSE-2.0.
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12 | # License for the specific language governing permissions and limitations
13 | # under the License.
14 | #
15 | # SPDX-License-Identifier: Apache-2.0
16 |
17 | #-------------------------------------------------------------------------------------------------------------
18 | # Copyright (c) Microsoft Corporation. All rights reserved.
19 | # Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information.
20 | #-------------------------------------------------------------------------------------------------------------
21 | #
22 | set -e
23 |
24 | CMAKE_VERSION=${1:-"none"}
25 |
26 | if [ "${CMAKE_VERSION}" = "none" ]; then
27 | echo "No CMake version specified, skipping CMake reinstallation"
28 | exit 0
29 | fi
30 |
31 | # Cleanup temporary directory and associated files when exiting the script.
32 | cleanup() {
33 | EXIT_CODE=$?
34 | set +e
35 | if [[ -n "${TMP_DIR}" ]]; then
36 | echo "Executing cleanup of tmp files"
37 | rm -Rf "${TMP_DIR}"
38 | fi
39 | exit $EXIT_CODE
40 | }
41 | trap cleanup EXIT
42 |
43 |
44 | echo "Installing CMake..."
45 | apt-get -y purge --auto-remove cmake
46 | mkdir -p /opt/cmake
47 |
48 | architecture=$(dpkg --print-architecture)
49 | case "${architecture}" in
50 | arm64)
51 | ARCH=aarch64 ;;
52 | amd64)
53 | ARCH=x86_64 ;;
54 | *)
55 | echo "Unsupported architecture ${architecture}."
56 | exit 1
57 | ;;
58 | esac
59 |
60 | CMAKE_BINARY_NAME="cmake-${CMAKE_VERSION}-linux-${ARCH}.sh"
61 | CMAKE_CHECKSUM_NAME="cmake-${CMAKE_VERSION}-SHA-256.txt"
62 | TMP_DIR=$(mktemp -d -t cmake-XXXXXXXXXX)
63 |
64 | echo "${TMP_DIR}"
65 | cd "${TMP_DIR}"
66 |
67 | curl -sSL "https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/${CMAKE_BINARY_NAME}" -O
68 | curl -sSL "https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/${CMAKE_CHECKSUM_NAME}" -O
69 |
70 | sha256sum -c --ignore-missing "${CMAKE_CHECKSUM_NAME}"
71 | sh "${TMP_DIR}/${CMAKE_BINARY_NAME}" --prefix=/opt/cmake --skip-license
72 |
73 | ln -s /opt/cmake/bin/cmake /usr/local/bin/cmake
74 |
--------------------------------------------------------------------------------
/.devcontainer/scripts/setup-dependencies.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # This file is maintained by velocitas CLI, do not modify manually. Change settings in .velocitas.json
3 | # Copyright (c) 2022-2025 Contributors to the Eclipse Foundation
4 | #
5 | # This program and the accompanying materials are made available under the
6 | # terms of the Apache License, Version 2.0 which is available at
7 | # https://www.apache.org/licenses/LICENSE-2.0.
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12 | # License for the specific language governing permissions and limitations
13 | # under the License.
14 | #
15 | # SPDX-License-Identifier: Apache-2.0
16 |
17 | echo "#######################################################"
18 | echo "### Install Prerequisites and Tools ###"
19 | echo "#######################################################"
20 |
21 | if [[ -z "${VELOCITAS_OFFLINE}" ]]; then
22 | # Optionally install the cmake for vcpkg
23 | .devcontainer/scripts/reinstall-cmake.sh ${REINSTALL_CMAKE_VERSION_FROM_SOURCE}
24 |
25 | # Install python, conan and ccache
26 | sudo apt-get update
27 | sudo apt-get install -y python3
28 | sudo apt-get install -y python3-distutils
29 | curl -fsSL https://bootstrap.pypa.io/get-pip.py | sudo python3
30 | sudo apt-get -y install --no-install-recommends ccache
31 |
32 | build_arch=$(arch)
33 |
34 | # ensure we can always build for an arm target
35 | if [ "${build_arch}" != "aarch64" ]; then
36 | sudo apt-get install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu
37 | fi
38 |
39 | pip3 install -r ./requirements.txt
40 |
41 | # Install static analyzer tools
42 | sudo apt-get install -y cppcheck clang-format-14 clang-tidy-14
43 | sudo update-alternatives --install /usr/bin/clang-format clang-format /usr/bin/clang-format-14 100
44 | sudo update-alternatives --install /usr/bin/clang-tidy clang-tidy /usr/bin/clang-tidy-14 100
45 | fi
46 |
47 | echo "#######################################################"
48 | echo "### Install Dependencies ###"
49 | echo "#######################################################"
50 | ./install_dependencies.sh 2>&1 | tee -a $HOME/install_dependencies.log
51 |
--------------------------------------------------------------------------------
/.devcontainer/scripts/setup-git.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # This file is maintained by velocitas CLI, do not modify manually. Change settings in .velocitas.json
3 | # Copyright (c) 2022-2025 Contributors to the Eclipse Foundation
4 | #
5 | # This program and the accompanying materials are made available under the
6 | # terms of the Apache License, Version 2.0 which is available at
7 | # https://www.apache.org/licenses/LICENSE-2.0.
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12 | # License for the specific language governing permissions and limitations
13 | # under the License.
14 | #
15 | # SPDX-License-Identifier: Apache-2.0
16 |
17 | echo "#######################################################"
18 | echo "### Setup Git ###"
19 | echo "#######################################################"
20 | # Add git name and email from env variables
21 | if [[ -n "${GIT_CONFIG_NAME}" && -n "${GIT_CONFIG_EMAIL}" ]]; then
22 | git config --global user.name $GIT_CONFIG_NAME
23 | git config --global user.email $GIT_CONFIG_EMAIL
24 | fi
25 |
26 | git config --global --add safe.directory "*"
27 |
--------------------------------------------------------------------------------
/.devcontainer/scripts/upgrade-cli.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # This file is maintained by velocitas CLI, do not modify manually. Change settings in .velocitas.json
3 | # Copyright (c) 2023-2025 Contributors to the Eclipse Foundation
4 | #
5 | # This program and the accompanying materials are made available under the
6 | # terms of the Apache License, Version 2.0 which is available at
7 | # https://www.apache.org/licenses/LICENSE-2.0.
8 | #
9 | # Unless required by applicable law or agreed to in writing, software
10 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12 | # License for the specific language governing permissions and limitations
13 | # under the License.
14 | #
15 | # SPDX-License-Identifier: Apache-2.0
16 |
17 | echo "#######################################################"
18 | echo "### Auto-upgrade CLI ###"
19 | echo "#######################################################"
20 |
21 | ROOT_DIRECTORY=$( realpath "$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )/../.." )
22 | DESIRED_VERSION=$(cat $ROOT_DIRECTORY/.velocitas.json | jq .cliVersion | tr -d '"')
23 |
24 | # Get installed CLI version
25 | INSTALLED_VERSION=v$(velocitas --version | sed -E 's/velocitas-cli\/(\w+.\w+.\w+).*/\1/')
26 |
27 | if [ "$DESIRED_VERSION" = "$INSTALLED_VERSION" ]; then
28 | echo "> Already up to date!"
29 | exit 0
30 | else
31 | echo "> Checking upgrade to $DESIRED_VERSION"
32 | fi
33 |
34 | AUTHORIZATION_HEADER=""
35 | if [ "${GITHUB_API_TOKEN}" != "" ]; then
36 | AUTHORIZATION_HEADER="-H \"Authorization: Bearer ${GITHUB_API_TOKEN}\""
37 | fi
38 |
39 | if [ "$DESIRED_VERSION" = "latest" ]; then
40 | CLI_RELEASES_URL=https://api.github.com/repos/eclipse-velocitas/cli/releases/latest
41 | else
42 | CLI_RELEASES_URL=https://api.github.com/repos/eclipse-velocitas/cli/releases/tags/${DESIRED_VERSION}
43 | fi
44 |
45 | CLI_RELEASES=$(curl -s -L \
46 | -H "Accept: application/vnd.github+json" \
47 | -H "X-GitHub-Api-Version: 2022-11-28" \
48 | ${AUTHORIZATION_HEADER} \
49 | ${CLI_RELEASES_URL})
50 |
51 | res=$?
52 | if test "$res" != "0"; then
53 | echo "the curl command failed with exit code: $res"
54 | exit 0
55 | fi
56 |
57 | DESIRED_VERSION_TAG=$(echo ${CLI_RELEASES} | jq -r .name)
58 |
59 | if [ "$DESIRED_VERSION_TAG" = "null" ] || [ "$DESIRED_VERSION_TAG" = "" ]; then
60 | echo "> Can't find desired Velocitas CLI version: $DESIRED_VERSION. Skipping Auto-Upgrade."
61 | exit 0
62 | fi
63 |
64 | if [ "$DESIRED_VERSION_TAG" != "$INSTALLED_VERSION" ]; then
65 | echo "> Upgrading CLI..."
66 | if [[ $(arch) == "aarch64" ]]; then
67 | CLI_ASSET_NAME=velocitas-linux-arm64
68 | else
69 | CLI_ASSET_NAME=velocitas-linux-x64
70 | fi
71 | CLI_INSTALL_PATH=/usr/bin/velocitas
72 | CLI_DOWNLOAD_URL="https://github.com/eclipse-velocitas/cli/releases/download/${DESIRED_VERSION_TAG}/${CLI_ASSET_NAME}"
73 |
74 | echo "> Downloading Velocitas CLI from ${CLI_DOWNLOAD_URL}"
75 | sudo curl -s -L ${CLI_DOWNLOAD_URL} -o "${CLI_INSTALL_PATH}"
76 | sudo chmod +x "${CLI_INSTALL_PATH}"
77 | else
78 | echo "> Up to date!"
79 | fi
80 |
81 | echo "> Using CLI: $(velocitas --version)"
82 |
--------------------------------------------------------------------------------
/.dockerignore:
--------------------------------------------------------------------------------
1 | .conan_home
2 | .devcontainer
3 | .github
4 | .vscode
5 | **/build
6 | **/deploy
7 | **/docs
8 | **/licenses
9 |
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | # Automatically normalize line endings for all text-based files
2 | # http://git-scm.com/docs/gitattributes#_end_of_line_conversion
3 | * text=auto
4 |
5 | # For the following file types, normalize line endings to LF on
6 | # checkin and prevent conversion to CRLF when they are checked out
7 | # (this is required in order to prevent newline related issues like,
8 | # for example, after the build script is run)
9 | .* text eol=lf
10 | *.css text eol=lf
11 | *.html text eol=lf
12 | *.js text eol=lf
13 | *.json text eol=lf
14 | *.md text eol=lf
15 | *.sh text eol=lf
16 | *.txt text eol=lf
17 | *.xml text eol=lf
18 |
19 | # Source files
20 | # ============
21 | *.pxd text diff=python
22 | *.py text diff=python
23 | *.py3 text diff=python
24 | *.pyw text diff=python
25 | *.pyx text diff=python
26 | *.pyz text diff=python
27 | *.pyi text diff=python
28 | *.c text
29 | *.h text
30 | *.cpp text
31 | *.hpp text
32 |
33 | # Binary files
34 | # ============
35 | *.db binary
36 | *.p binary
37 | *.pkl binary
38 | *.pickle binary
39 | *.pyc binary export-ignore
40 | *.pyo binary export-ignore
41 | *.pyd binary
42 |
43 | # Jupyter notebook
44 | *.ipynb text
45 |
46 | # Note: .db, .p, and .pkl files are associated
47 | # with the python modules ``pickle``, ``dbm.*``,
48 | # ``shelve``, ``marshal``, ``anydbm``, & ``bsddb``
49 | # (among others).
50 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/bug-report.yml:
--------------------------------------------------------------------------------
1 | # This file is maintained by velocitas CLI, do not modify manually. Change settings in .velocitas.json
2 | # Copyright (c) 2023-2024 Contributors to the Eclipse Foundation
3 | #
4 | # This program and the accompanying materials are made available under the
5 | # terms of the Apache License, Version 2.0 which is available at
6 | # https://www.apache.org/licenses/LICENSE-2.0.
7 | #
8 | # Unless required by applicable law or agreed to in writing, software
9 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
10 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
11 | # License for the specific language governing permissions and limitations
12 | # under the License.
13 | #
14 | # SPDX-License-Identifier: Apache-2.0
15 |
16 | name: 🐞 Bug Report
17 | description: Provide a general summary of the bug in the title below.
18 | title: "[Bug]: "
19 | labels:
20 | - bug
21 | body:
22 | - type: markdown
23 | attributes:
24 | value: |
25 | **Thank you :heart: for taking the time to fill out this bug report!**
26 | - type: dropdown
27 | id: severity
28 | validations:
29 | required: true
30 | attributes:
31 | label: Severity
32 | description: How severe is the bug in your opinion?
33 | multiple: false
34 | options:
35 | - "Trivial"
36 | - "Medium"
37 | - "High"
38 | - "Critical"
39 | - "Blocker"
40 | - type: input
41 | id: version
42 | validations:
43 | required: true
44 | attributes:
45 | label: What release version, tag or commit-hash did you use?
46 | description: Please include a link if possible.
47 | placeholder: v0.1.0 or 06f432a00e4c66804202c91bdfb9c9b12823928b
48 | - type: textarea
49 | id: current-behavior
50 | validations:
51 | required: true
52 | attributes:
53 | label: Current Behavior
54 | description: Tell us what happened instead of the expected behavior.
55 | placeholder: Error message appeared when I cloned a repository...
56 | - type: textarea
57 | id: steps-to-reproduce
58 | validations:
59 | required: true
60 | attributes:
61 | label: Steps to Reproduce
62 | description: Provide a link to a live example, or an unambiguous set of steps to reproduce this bug. Include code to reproduce, if relevant
63 | placeholder: |
64 | 1. ...
65 | 2. ...
66 | 3. ...
67 | - type: textarea
68 | id: expected-behavior
69 | validations:
70 | required: true
71 | attributes:
72 | label: Expected Behavior
73 | description: Tell us what should happen
74 | placeholder: Clone of repository shall be prune of errors.
75 | - type: textarea
76 | id: possible-solution
77 | validations:
78 | required: false
79 | attributes:
80 | label: Possible Solution
81 | description: Fix/reason of the bug suggestion
82 | placeholder: A possible solution or fix is...
83 | - type: textarea
84 | id: additional-information
85 | validations:
86 | required: false
87 | attributes:
88 | label: Additional Information
89 | description: Provide an additional detailed description / screenshots / evidences of the bug
90 | placeholder: I would like to add...
91 | - type: checkboxes
92 | id: code-of-conduct
93 | attributes:
94 | label: Code of Conduct
95 | description: By submitting this issue, you agree to follow our "Code of Conduct".
96 | options:
97 | - label: I agree to follow this project's "Code of Conduct".
98 | required: true
99 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/feature-request.yml:
--------------------------------------------------------------------------------
1 | # This file is maintained by velocitas CLI, do not modify manually. Change settings in .velocitas.json
2 | # Copyright (c) 2023-2024 Contributors to the Eclipse Foundation
3 | #
4 | # This program and the accompanying materials are made available under the
5 | # terms of the Apache License, Version 2.0 which is available at
6 | # https://www.apache.org/licenses/LICENSE-2.0.
7 | #
8 | # Unless required by applicable law or agreed to in writing, software
9 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
10 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
11 | # License for the specific language governing permissions and limitations
12 | # under the License.
13 | #
14 | # SPDX-License-Identifier: Apache-2.0
15 |
16 | name: 🛠️ Feature Request
17 | description: Suggest an idea to help us improve our product.
18 | title: "[Feature]: "
19 | labels:
20 | - "enhancement"
21 | body:
22 | - type: markdown
23 | attributes:
24 | value: |
25 | **Thank you :heart: for taking the time to fill out this feature request report!**
26 | We kindly ask you to search if an issue already exists for your requested feature.
27 |
28 | We are happy about contributions from all users.
29 | - type: textarea
30 | attributes:
31 | label: Description
32 | description: |
33 | A clear and concise description of the feature you're interested in.
34 | validations:
35 | required: true
36 |
37 | - type: textarea
38 | attributes:
39 | label: Suggested Solution
40 | description: |
41 | Describe the solution you'd like to be implemented. Provide a clear and concise description of what you want to happen.
42 | validations:
43 | required: false
44 |
45 | - type: textarea
46 | attributes:
47 | label: Alternatives
48 | description: |
49 | Describe alternatives you've considered.
50 | A clear and concise description of alternative solutions or features you've considered.
51 | validations:
52 | required: false
53 |
54 | - type: textarea
55 | attributes:
56 | label: Additional Context
57 | description: |
58 | Add any other context about the problem here.
59 | validations:
60 | required: false
61 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/question.yml:
--------------------------------------------------------------------------------
1 | # This file is maintained by velocitas CLI, do not modify manually. Change settings in .velocitas.json
2 | # Copyright (c) 2023-2024 Contributors to the Eclipse Foundation
3 | #
4 | # This program and the accompanying materials are made available under the
5 | # terms of the Apache License, Version 2.0 which is available at
6 | # https://www.apache.org/licenses/LICENSE-2.0.
7 | #
8 | # Unless required by applicable law or agreed to in writing, software
9 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
10 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
11 | # License for the specific language governing permissions and limitations
12 | # under the License.
13 | #
14 | # SPDX-License-Identifier: Apache-2.0
15 |
16 | name: ❓ Question or general issue
17 | description: Approach us with a question
18 | title: "[Q]: "
19 | labels:
20 | - question
21 | body:
22 | - type: markdown
23 | attributes:
24 | value: |
25 | **We are happy that you have a question to ask!**
26 | - type: textarea
27 | validations:
28 | required: true
29 | attributes:
30 | label: Question
31 | description: Feel free to ask us if you need assistance
32 | placeholder: How can I create a repository based on your template?
33 |
--------------------------------------------------------------------------------
/.github/PULL_REQUEST_TEMPLATE.md:
--------------------------------------------------------------------------------
1 |
2 | ## Describe your changes
3 |
4 |
7 |
8 | ## Issue ticket number and link
9 |
10 |
13 |
14 | ## Checklist - Manual tasks
15 |
16 |
19 |
20 | * [ ] Examples are executing successfully
21 | * [ ] Created/updated unit tests. Code Coverage percentage on new code shall be >= 80%.
22 | * [ ] Created/updated integration tests.
23 |
24 | * [ ] Devcontainer can be opened successfully
25 | * [ ] Devcontainer can be opened successfully behind a corporate proxy
26 | * [ ] Devcontainer can be re-built successfully
27 |
28 | * [ ] Extended the documentation (e.g. README.md, CONTRIBUTING.md, Velocitas Docs)
29 |
--------------------------------------------------------------------------------
/.github/scripts/deploy_image_from_artifact.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Copyright (c) 2022-2025 Contributors to the Eclipse Foundation
3 | #
4 | # This program and the accompanying materials are made available under the
5 | # terms of the Apache License, Version 2.0 which is available at
6 | # https://www.apache.org/licenses/LICENSE-2.0.
7 | #
8 | # Unless required by applicable law or agreed to in writing, software
9 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
10 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
11 | # License for the specific language governing permissions and limitations
12 | # under the License.
13 | #
14 | # SPDX-License-Identifier: Apache-2.0
15 |
16 | set -e
17 |
18 | ROOT_DIRECTORY=$( realpath "$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )/../.." )
19 | APP_ARTIFACT_NAME=$(cat $ROOT_DIRECTORY/${{ appManifestPath }} | jq -r .name | tr -d '"')
20 | APP_NAME_LOWERCASE=$(echo $APP_ARTIFACT_NAME | tr '[:upper:]' '[:lower:]')
21 | APP_REGISTRY="localhost:12345"
22 |
23 | local_tag="$APP_REGISTRY/$APP_NAME_LOWERCASE:local"
24 | echo "Local URL: $local_tag"
25 |
26 | docker load -i "$APP_ARTIFACT_NAME.tar" | sed -n 's/^Loaded image: \([0-9a-f]*\).*/\1/p' | xargs -i docker tag {} $local_tag
27 | docker push $local_tag
28 |
29 | cd $ROOT_DIRECTORY
30 | velocitas exec deployment-kanto deploy-vehicleapp
31 |
--------------------------------------------------------------------------------
/.github/scripts/junit.tpl:
--------------------------------------------------------------------------------
1 |
2 |
3 | {{- range . -}}
4 | {{- $failures := len .Vulnerabilities }}
5 |
6 | {{- if not (eq .Type "") }}
7 |
8 |
9 |
10 | {{- end -}}
11 | {{ range .Vulnerabilities }}
12 |
13 | {{ escapeXML .Description }}
14 |
15 | {{- end }}
16 |
17 | {{- end }}
18 |
19 |
--------------------------------------------------------------------------------
/.github/workflows/check-licenses.yml:
--------------------------------------------------------------------------------
1 | # This file is maintained by velocitas CLI, do not modify manually. Change settings in .velocitas.json
2 | # Copyright (c) 2022-2025 Contributors to the Eclipse Foundation
3 | #
4 | # This program and the accompanying materials are made available under the
5 | # terms of the Apache License, Version 2.0 which is available at
6 | # https://www.apache.org/licenses/LICENSE-2.0.
7 | #
8 | # Unless required by applicable law or agreed to in writing, software
9 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
10 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
11 | # License for the specific language governing permissions and limitations
12 | # under the License.
13 | #
14 | # SPDX-License-Identifier: Apache-2.0
15 |
16 | # _Summary_
17 | #
18 | # Scans the repository for all 3rd party dependencies
19 | # and generates a notice file containing all used software within
20 | # the project.
21 |
22 | name: Check licenses
23 |
24 | on:
25 | workflow_dispatch:
26 | pull_request:
27 | branches:
28 | - main
29 | schedule:
30 | - cron: "0 4 * * *"
31 |
32 | jobs:
33 | check-licenses:
34 | runs-on: ubuntu-22.04
35 | name: Check Software Licenses
36 |
37 | steps:
38 | - name: Checkout repository
39 | uses: actions/checkout@v4
40 |
41 | - name: Clone License Check Repo
42 | uses: actions/checkout@v4
43 | with:
44 | repository: eclipse-velocitas/license-check
45 | ref: v1.3
46 | path: .github/actions/license-check
47 |
48 | - name: Run License Checker
49 | uses: ./.github/actions/license-check
50 | with:
51 | config-file-path: ./.licensechecker.yml
52 | fail-on-violation: false
53 | notice-file-name: "NOTICE-3RD-PARTY-CONTENT"
54 | generate-dash: true
55 |
56 | - name: Setup Java JDK
57 | uses: actions/setup-java@v4
58 | with:
59 | distribution: "temurin"
60 | java-version: 11.0.19
61 |
62 | - name: Run dash
63 | shell: bash
64 | run: |
65 | wget -O dash.jar "https://repo.eclipse.org/content/repositories/dash-licenses/org/eclipse/dash/org.eclipse.dash.licenses/1.0.2/org.eclipse.dash.licenses-1.0.2.jar"
66 | java -jar dash.jar clearlydefined.input -summary DEPENDENCIES > dash.out 2>&1 || true
67 | echo -e "Dash output: \n\`\`\` " >> $GITHUB_STEP_SUMMARY
68 | cat dash.out >> $GITHUB_STEP_SUMMARY
69 | echo -e "\n\`\`\`"
70 |
71 | - name: Upload dash input/output as artifacts
72 | uses: actions/upload-artifact@v4
73 | if: always()
74 | with:
75 | name: "dash-artifacts"
76 | path: |
77 | clearlydefined.input
78 | DEPENDENCIES
79 | dash.out
80 |
--------------------------------------------------------------------------------
/.github/workflows/check-updates.yml:
--------------------------------------------------------------------------------
1 | # This file is maintained by velocitas CLI, do not modify manually. Change settings in .velocitas.json
2 | # Copyright (c) 2024-2025 Contributors to the Eclipse Foundation
3 | #
4 | # This program and the accompanying materials are made available under the
5 | # terms of the Apache License, Version 2.0 which is available at
6 | # https://www.apache.org/licenses/LICENSE-2.0.
7 | #
8 | # Unless required by applicable law or agreed to in writing, software
9 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
10 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
11 | # License for the specific language governing permissions and limitations
12 | # under the License.
13 | #
14 | # SPDX-License-Identifier: Apache-2.0
15 |
16 | name: Automatic Package Update Check
17 |
18 | on:
19 | workflow_dispatch:
20 | schedule:
21 | - cron: "0 4 * * *"
22 |
23 | jobs:
24 | package_update_check:
25 | if: github.repository_owner == 'eclipse-velocitas'
26 | runs-on: ubuntu-22.04
27 |
28 | steps:
29 | - name: Checkout Repository
30 | uses: actions/checkout@v4
31 | with:
32 | token: ${{ secrets.VELOCITAS_PROJECT_TOKEN }}
33 |
34 | - name: Use devcontainer for upgrade and PR creation
35 | uses: devcontainers/ci@v0.3
36 | with:
37 | runCmd: |
38 | sudo apt-get update && sudo apt-get install -y gh
39 |
40 | echo "${{ secrets.VELOCITAS_PROJECT_TOKEN }}" | gh auth login --with-token
41 |
42 | velocitas upgrade --ignore-bounds && velocitas init && velocitas sync
43 |
44 | git config --global user.name "${{ github.actor }}"
45 | git config --global user.email "${{ github.actor }}@users.noreply.github.com"
46 |
47 | if [ -n "$(git status --porcelain)" ]; then
48 | PR_TITLE="Automated Package Update"
49 | PR_BODY="This pull request was created automatically by GitHub Actions to update package versions."
50 |
51 | # Check if a PR with the same title already exists
52 | PR_EXISTING=$(gh pr list --state open --search "$PR_TITLE" --json number | jq -r '.[0].number // empty')
53 |
54 | if [ -n "$PR_EXISTING" ]; then
55 | echo "Existing PR found (#${PR_EXISTING}). Editing..."
56 | git checkout .
57 | gh pr checkout "$PR_EXISTING"
58 | velocitas upgrade --ignore-bounds && velocitas init && velocitas sync
59 | git add .
60 | git commit -m "Update velocitas package versions"
61 | if [ $? -eq 0 ]; then
62 | git push
63 | gh pr comment "$PR_EXISTING" --body "Updated PR with latest package updates"
64 | fi
65 | else
66 | git add .
67 | git commit -m "Update velocitas package versions"
68 | BRANCH_NAME="automated-update-${{ github.sha }}"
69 | git push origin HEAD:$BRANCH_NAME
70 | echo "Creating new PR..."
71 | gh pr create --title "$PR_TITLE" --body "$PR_BODY" --head $BRANCH_NAME --base main
72 | fi
73 | else
74 | echo "No changes detected. Skip creating Pull Request."
75 | fi
76 |
--------------------------------------------------------------------------------
/.github/workflows/ensure-lifecycle.yml:
--------------------------------------------------------------------------------
1 | # This file is maintained by velocitas CLI, do not modify manually. Change settings in .velocitas.json
2 | # Copyright (c) 2023-2025 Contributors to the Eclipse Foundation
3 | #
4 | # This program and the accompanying materials are made available under the
5 | # terms of the Apache License, Version 2.0 which is available at
6 | # https://www.apache.org/licenses/LICENSE-2.0.
7 | #
8 | # Unless required by applicable law or agreed to in writing, software
9 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
10 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
11 | # License for the specific language governing permissions and limitations
12 | # under the License.
13 | #
14 | # SPDX-License-Identifier: Apache-2.0
15 |
16 | name: Ensure lifecycle management
17 | concurrency:
18 | group: ${{ github.ref }}-ensure-lifecycle
19 | cancel-in-progress: true
20 |
21 | on:
22 | workflow_dispatch:
23 | pull_request:
24 | branches:
25 | - main
26 | schedule:
27 | - cron: "0 4 * * *"
28 |
29 | jobs:
30 | check-sync:
31 | runs-on: ubuntu-22.04
32 | container: ghcr.io/eclipse-velocitas/devcontainer-base-images/cpp:v0.4
33 | name: Are files in sync?
34 |
35 | steps:
36 | - name: Checkout repository
37 | uses: actions/checkout@v4
38 |
39 | - name: Run CLI
40 | run: |
41 | velocitas init
42 | velocitas sync
43 |
44 | - name: Fix dubious ownership
45 | run: |
46 | git config --global --add safe.directory $( pwd )
47 |
48 | - name: Has Changes
49 | id: changes
50 | run: |
51 | if [[ -z "$(git status --porcelain .)" ]];
52 | then
53 | echo "changed=0" >> $GITHUB_OUTPUT
54 | else
55 | echo "changed=1" >> $GITHUB_OUTPUT
56 |
57 | echo -e "## Summary of detected changes\n" >> $GITHUB_STEP_SUMMARY
58 | echo -e "\`\`\`bash" >> $GITHUB_STEP_SUMMARY
59 | git status --porcelain >> $GITHUB_STEP_SUMMARY
60 | echo -e "\`\`\`" >> $GITHUB_STEP_SUMMARY
61 | echo -e "## Diff Details\n" >> $GITHUB_STEP_SUMMARY
62 | echo -e "\`\`\`bash" >> $GITHUB_STEP_SUMMARY
63 | git diff >> $GITHUB_STEP_SUMMARY
64 | echo -e "\`\`\`" >> $GITHUB_STEP_SUMMARY
65 | fi
66 | shell: bash
67 |
68 | - name: Fail if there are changes
69 | if: steps.changes.outputs.changed == 1
70 | run: exit 1
71 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2022-2025 Contributors to the Eclipse Foundation
2 | #
3 | # This program and the accompanying materials are made available under the
4 | # terms of the Apache License, Version 2.0 which is available at
5 | # https://www.apache.org/licenses/LICENSE-2.0.
6 | #
7 | # Unless required by applicable law or agreed to in writing, software
8 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
9 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
10 | # License for the specific language governing permissions and limitations
11 | # under the License.
12 | #
13 | # SPDX-License-Identifier: Apache-2.0
14 |
15 | # Prerequisites
16 | *.d
17 |
18 | # Compiled Object files
19 | *.slo
20 | *.lo
21 | *.o
22 | *.obj
23 |
24 | # Precompiled Headers
25 | *.gch
26 | *.pch
27 |
28 | # Compiled Dynamic libraries
29 | *.so
30 | *.dylib
31 | *.dll
32 |
33 | # Fortran module files
34 | *.mod
35 | *.smod
36 |
37 | # Compiled Static libraries
38 | *.lai
39 | *.la
40 | *.a
41 | *.lib
42 |
43 | # Executables
44 | *.exe
45 | *.out
46 | *.app
47 |
48 | # Python pre-compiled files
49 | *.pyc
50 |
51 | # CMake
52 | build*
53 | CMakeUserPresets.json
54 |
55 | # Mac files
56 | .DS_Store
57 |
58 | # conan licenses
59 | licenses
60 | conan_imports_manifest.txt
61 |
62 | # conan home
63 | .conan_home
64 |
65 | # auto-generated SDK version
66 | version.txt
67 | logs
68 |
69 | # Velocitas home
70 | .velocitas
71 |
--------------------------------------------------------------------------------
/.licensechecker.yml:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2022-2025 Contributors to the Eclipse Foundation
2 | #
3 | # This program and the accompanying materials are made available under the
4 | # terms of the Apache License, Version 2.0 which is available at
5 | # https://www.apache.org/licenses/LICENSE-2.0.
6 | #
7 | # Unless required by applicable law or agreed to in writing, software
8 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
9 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
10 | # License for the specific language governing permissions and limitations
11 | # under the License.
12 | #
13 | # SPDX-License-Identifier: Apache-2.0
14 |
15 | whitelist-file-path: ./whitelisted-licenses.txt
16 | scan-dirs:
17 | - path: .
18 | cpp-conan-included-profile-files:
19 | - "./.conan/profiles/linux-x86_64"
20 |
--------------------------------------------------------------------------------
/.pre-commit-config.yaml:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2023-2025 Contributors to the Eclipse Foundation
2 | #
3 | # This program and the accompanying materials are made available under the
4 | # terms of the Apache License, Version 2.0 which is available at
5 | # https://www.apache.org/licenses/LICENSE-2.0.
6 | #
7 | # Unless required by applicable law or agreed to in writing, software
8 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
9 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
10 | # License for the specific language governing permissions and limitations
11 | # under the License.
12 | #
13 | # SPDX-License-Identifier: Apache-2.0
14 |
15 | fail_fast: false
16 | repos:
17 | - repo: https://github.com/pocc/pre-commit-hooks
18 | rev: v1.3.5
19 | hooks:
20 | - id: clang-format
21 | args: ["--style=file", "--version=14"]
22 | - id: clang-tidy
23 | args:
24 | [
25 | "--version=14",
26 | "--checks=-*",
27 | "--config-file=.clang-tidy",
28 | "--format-style=file",
29 | ]
30 | - id: cpplint
31 | args: ["--recursive"]
32 | - id: cppcheck
33 | args: [
34 | "--project=build/compile_commands.json",
35 | "--language=c++",
36 | "--std=c++17",
37 | "--error-exitcode=1",
38 | "--enable=all",
39 | "--inline-suppr",
40 | "--suppress=noExplicitConstructor",
41 | "--suppress=missingInclude",
42 | "--suppress=unusedFunction",
43 | "--suppress=uninitMemberVar",
44 | "--suppress=unmatchedSuppression",
45 | # suppress all warnings for generated code
46 | "--suppress=*:build*/*",
47 | "--suppress=*:app/vehicle_model/*",
48 | "--suppress=*:examples/vehicle_model/*",
49 | ]
50 | - repo: https://github.com/Lucas-C/pre-commit-hooks
51 | rev: v1.5.4
52 | hooks:
53 | - id: insert-license
54 | files: '.*\.(py|pyi|yaml|yml|sh)$'
55 | exclude: "reinstall-cmake.sh"
56 | args:
57 | - --license-filepath
58 | - license_header.txt
59 | - --comment-style
60 | - "#"
61 | - --use-current-year
62 | - --allow-past-years
63 | - --skip-license-insertion-comment=This file is maintained by velocitas CLI, do not modify manually.
64 | - id: insert-license
65 | files: '.*\.(cpp|c|cc|h)$'
66 | exclude: '.*\.(pb.cpp|pb.c|pb.cc|pb.h)$'
67 | args:
68 | - --license-filepath
69 | - license_header.txt
70 | - --comment-style
71 | - /**| *| */
72 | - --use-current-year
73 | - --allow-past-years
74 | - --skip-license-insertion-comment=This file is maintained by velocitas CLI, do not modify manually.
75 | - id: insert-license
76 | files: "Dockerfile.*|CMakeLists.txt"
77 | args:
78 | - --license-filepath
79 | - license_header.txt
80 | - --comment-style
81 | - "#"
82 | - --use-current-year
83 | - --allow-past-years
84 | - --skip-license-insertion-comment=This file is maintained by velocitas CLI, do not modify manually.
85 |
--------------------------------------------------------------------------------
/.scripts/common.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Copyright (c) 2022-2025 Contributors to the Eclipse Foundation
3 | #
4 | # This program and the accompanying materials are made available under the
5 | # terms of the Apache License, Version 2.0 which is available at
6 | # https://www.apache.org/licenses/LICENSE-2.0.
7 | #
8 | # Unless required by applicable law or agreed to in writing, software
9 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
10 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
11 | # License for the specific language governing permissions and limitations
12 | # under the License.
13 | #
14 | # SPDX-License-Identifier: Apache-2.0
15 |
16 | function get_valid_cross_compile_architecture() {
17 | if [[ "$1" == "aarch64" || "$1" == "arm64" || "$1" == "armv8" ]]; then
18 | HOST_ARCH="aarch64"
19 | elif [[ "$1" == "x86_64" || "$1" == "amd64" ]]; then
20 | HOST_ARCH="x86_64"
21 | else
22 | return 1
23 | fi
24 |
25 | echo $HOST_ARCH
26 | return 0
27 | }
28 |
--------------------------------------------------------------------------------
/.scripts/test_package.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Copyright (c) 2022-2025 Contributors to the Eclipse Foundation
3 | #
4 | # This program and the accompanying materials are made available under the
5 | # terms of the Apache License, Version 2.0 which is available at
6 | # https://www.apache.org/licenses/LICENSE-2.0.
7 | #
8 | # Unless required by applicable law or agreed to in writing, software
9 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
10 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
11 | # License for the specific language governing permissions and limitations
12 | # under the License.
13 | #
14 | # SPDX-License-Identifier: Apache-2.0
15 |
16 | HOST_PROFILE=$1
17 | if [ "${HOST_PROFILE}" == "" ]; then
18 | HOST_PROFILE="linux-$(arch)"
19 | echo "Missing host profile argument - using default: ${HOST_PROFILE}"
20 | fi
21 |
22 | conan create --build=missing -pr:b ./.conan/profiles/linux-$(arch) -pr:h ./.conan/profiles/${HOST_PROFILE} -s:a="build_type=Release" . --user ci --channel testing
--------------------------------------------------------------------------------
/.velocitas-lock.json:
--------------------------------------------------------------------------------
1 | {
2 | "packages": {
3 | "devenv-runtimes": "v4.1.0",
4 | "devenv-devcontainer-setup": "v3.0.0",
5 | "devenv-github-templates": "v1.0.5",
6 | "devenv-github-workflows": "v7.0.0"
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/.velocitas.json:
--------------------------------------------------------------------------------
1 | {
2 | "packages": {
3 | "devenv-runtimes": "v4.1.0",
4 | "devenv-devcontainer-setup": "v3.0.0",
5 | "devenv-github-templates": "v1.0.5",
6 | "devenv-github-workflows": "v7.0.0"
7 | },
8 | "components": [
9 | "devcontainer-setup",
10 | "vehicle-signal-interface",
11 | "runtime-local",
12 | "github-templates",
13 | "github-workflows"
14 | ],
15 | "variables": {
16 | "language": "cpp",
17 | "repoType": "sdk",
18 | "githubRepoId": "eclipse-velocitas/vehicle-app-cpp-sdk",
19 | "appManifestPath": "examples/seat-adjuster/AppManifest.json"
20 | },
21 | "cliVersion": "v0.13.2"
22 | }
23 |
--------------------------------------------------------------------------------
/.vscode/c_cpp_properties.json:
--------------------------------------------------------------------------------
1 | {
2 | "configurations": [
3 | {
4 | "name": "Linux",
5 | "includePath": [
6 | "${workspaceFolder}/sdk/include",
7 | "${workspaceFolder}/sdk/src"
8 | ],
9 | "defines": [ ],
10 | "compilerPath": "/usr/bin/gcc",
11 | "cStandard": "c17",
12 | "cppStandard": "c++11",
13 | "configurationProvider": "ms-vscode.cmake-tools"
14 | }
15 | ],
16 | "version": 4
17 | }
--------------------------------------------------------------------------------
/.vscode/tasks.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": "2.0.0",
3 | "tasks": [
4 | {
5 | "label": "Local Runtime - Up",
6 | "detail": "Starts up the local runtime",
7 | "type": "shell",
8 | "command": "velocitas exec runtime-local up",
9 | "group": "none",
10 | "presentation": {
11 | "panel": "dedicated",
12 | "clear": true,
13 | },
14 | "problemMatcher": [ ]
15 | },
16 | {
17 | "label": "Local Runtime - Down",
18 | "detail": "Stops the local runtime",
19 | "type": "shell",
20 | "command": "velocitas exec runtime-local down",
21 | "group": "none",
22 | "presentation": {
23 | "panel": "dedicated",
24 | "clear": true,
25 | },
26 | "problemMatcher": [ ]
27 | },
28 | {
29 | "label": "Local Runtime - Run SeatAdjuster",
30 | "detail": "Starts the SeatAdjuster under development",
31 | "type": "shell",
32 | "command": [
33 | "velocitas exec runtime-local run-vehicle-app ${workspaceFolder}/build/bin/example-seatadjusterapp"
34 | ],
35 | "presentation": {
36 | "panel": "dedicated",
37 | "close": false,
38 | "reveal": "always"
39 | },
40 | "problemMatcher": [ ]
41 | },
42 | {
43 | "label": "Local Runtime - VehicleDataBroker CLI",
44 | "detail": "Starts the VehicleDataBroker CLI",
45 | "type": "shell",
46 | "command": "velocitas exec runtime-local run-vehicledatabroker-cli",
47 | "presentation": {
48 | "panel": "dedicated",
49 | "clear": true,
50 | },
51 | "group": "none",
52 | "problemMatcher": [ ]
53 | },
54 | // CPP specific tasks
55 | {
56 | "label": "CPP - Calculate code coverage",
57 | "detail": "Calculates code coverage of the c++ SDK",
58 | "type": "shell",
59 | // 'build' folder is a symlink. Assigning pwd to ROOT_DIR makes this independent
60 | // of the number of dirs covered by the symlink
61 | "command": "ROOT_DIR=$(pwd) && cd build && gcovr -r $ROOT_DIR",
62 | "group": "none",
63 | "dependsOn": [
64 | "CMake: Run Tests"
65 | ],
66 | "presentation": {
67 | "close": false,
68 | "panel": "dedicated"
69 | },
70 | "problemMatcher": [ ]
71 | }
72 | ]
73 | }
74 |
--------------------------------------------------------------------------------
/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2022-2025 Contributors to the Eclipse Foundation
2 | #
3 | # This program and the accompanying materials are made available under the
4 | # terms of the Apache License, Version 2.0 which is available at
5 | # https://www.apache.org/licenses/LICENSE-2.0.
6 | #
7 | # Unless required by applicable law or agreed to in writing, software
8 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
9 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
10 | # License for the specific language governing permissions and limitations
11 | # under the License.
12 | #
13 | # SPDX-License-Identifier: Apache-2.0
14 |
15 | cmake_minimum_required(VERSION 3.16)
16 |
17 | set(SDK_BUILD_TESTS ON CACHE BOOL "Build the SDK tests.")
18 | set(SDK_BUILD_EXAMPLES ON CACHE BOOL "Build the SDK examples.")
19 | set(STATIC_BUILD OFF CACHE BOOL "Build all targets with external dependencies linked in statically.")
20 |
21 | set(CMAKE_CXX_STANDARD 17)
22 |
23 | project(VehicleAppCppSdk CXX)
24 |
25 | find_package(fmt REQUIRED CONFIG)
26 | find_package(gRPC REQUIRED CONFIG)
27 | find_package(nlohmann_json REQUIRED CONFIG)
28 | find_package(PahoMqttCpp REQUIRED CONFIG)
29 | find_package(eclipse-paho-mqtt-c REQUIRED CONFIG)
30 | find_package(protobuf REQUIRED CONFIG)
31 | find_package(absl REQUIRED CONFIG)
32 |
33 | # Induce to put executables into the bin folder of the current build folder
34 | set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin)
35 |
36 | if(STATIC_BUILD)
37 | set(BUILD_SHARED_LIBS OFF)
38 | set(CMAKE_EXE_LINKER_FLAGS "-static")
39 | endif()
40 |
41 | find_program(CCACHE_FOUND ccache)
42 | if(CCACHE_FOUND)
43 | message("Found ccache installation")
44 | set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
45 | endif()
46 |
47 | if(SDK_BUILD_TESTS)
48 | enable_testing()
49 | endif()
50 |
51 | add_subdirectory(sdk)
52 |
53 | if(SDK_BUILD_EXAMPLES)
54 | add_subdirectory(examples)
55 | endif()
56 |
--------------------------------------------------------------------------------
/CPPLINT.cfg:
--------------------------------------------------------------------------------
1 | set noparent
2 |
3 | # When using Velocitas gRPC service generation the header file will include the *ServiceImpl.cpp file
4 | # this gives by default an error so lets ignore that
5 | filter=-build/include
6 |
7 | filter=-build/include_order
8 | filter=-build/header_guard
9 | filter=-whitespace/indent
10 | filter=-whitespace/comments
11 | filter=-build/c++11
12 | filter=-build/namespaces
13 | filter=-readability/todo
14 | filter=-readability/braces
15 | filter=-build/include_what_you_use
16 | filter=-runtime/references
17 | linelength=120
18 |
--------------------------------------------------------------------------------
/NOTICE-3RD-PARTY-CONTENT.md:
--------------------------------------------------------------------------------
1 | # Licenses Notice
2 | *Note*: This file is auto-generated. Do not modify it manually.
3 | ## Python
4 | | Dependency | Version | License |
5 | |:-----------|:-------:|--------:|
6 | |certifi|2025.4.26|Mozilla Public License 2.0|
7 | |cfgv|3.4.0|MIT|
8 | |charset-normalizer|3.4.2|MIT|
9 | |colorama|0.4.6|BSD|
10 | |conan|2.15.1|MIT|
11 | |cpplint|1.6.1|New BSD|
12 | |distlib|0.3.9|Python Software Foundation License|
13 | |distro|1.8.0|Apache 2.0|
14 | |fasteners|0.19|Apache 2.0|
15 | |filelock|3.18.0|The Unlicense (Unlicense)|
16 | |gcovr|5.2|BSD|
17 | |identify|2.6.10|MIT|
18 | |idna|3.10|BSD|
19 | |jinja2|3.1.6|BSD|
20 | |lxml|5.4.0|New BSD|
21 | |MarkupSafe|3.0.2|BSD|
22 | |nodeenv|1.9.1|BSD|
23 | |patch-ng|1.18.1|MIT|
24 | |platformdirs|4.3.8|MIT|
25 | |pre-commit|3.5.0|MIT|
26 | |pygments|2.19.1|Simplified BSD|
27 | |python-dateutil|2.9.0.post0|Apache 2.0
BSD|
28 | |PyYAML|6.0.2|MIT|
29 | |requests|2.32.3|Apache 2.0|
30 | |six|1.17.0|MIT|
31 | |urllib3|2.0.7|MIT|
32 | |virtualenv|20.31.2|MIT|
33 | ## Workflows
34 | | Dependency | Version | License |
35 | |:-----------|:-------:|--------:|
36 | |actions/checkout|v4|MIT License|
37 | |actions/setup-java|v4|MIT License|
38 | |actions/upload-artifact|v4|MIT License|
39 | |devcontainers/ci|v0.3|MIT License|
40 | |irongut/CodeCoverageSummary|v1.3.0|MIT License|
41 | |pre-commit/action|v3.0.1|MIT License|
42 |
--------------------------------------------------------------------------------
/SECURITY.md:
--------------------------------------------------------------------------------
1 |
2 | _ISO 27005 defines vulnerability as:
3 | "A weakness of an asset or group of assets that can be exploited by one or more threats."_
4 |
5 | ## The Eclipse Security Team
6 |
7 | The Eclipse Security Team provides help and advice to Eclipse projects
8 | on vulnerability issues and is the first point of contact
9 | for handling security vulnerabilities.
10 | Members of the Security Team are committers on Eclipse Projects
11 | and members of the Eclipse Architecture Council.
12 |
13 | Contact the [Eclipse Security Team](mailto:security@eclipse.org).
14 |
15 | **Note that, as a matter of policy, the security team does not open attachments.**
16 |
17 | ## Reporting a Security Vulnerability
18 |
19 | Vulnerabilities can be reported either via email to the Eclipse Security Team
20 | or directly with a project via the Eclipse Foundation's Bugzilla instance.
21 |
22 | The general security mailing list address is security@eclipse.org.
23 | Members of the Eclipse Security Team will receive messages sent to this address.
24 | This address should be used only for reporting undisclosed vulnerabilities;
25 | regular issue reports and questions unrelated to vulnerabilities in Eclipse software
26 | will be ignored.
27 | Note that this email address is not encrypted.
28 |
29 | The community is also encouraged to report vulnerabilities using the
30 | [Eclipse Foundation's Bugzilla instance](https://bugs.eclipse.org/bugs/enter_bug.cgi?product=Community&component=Vulnerability%20Reports&keywords=security&groups=Security_Advisories).
31 | Note that you will require an Eclipse Foundation account to create an issue report,
32 | but by doing so you will be able to participate directly in the resolution of the issue.
33 |
34 | Issue reports related to vulnerabilities must be marked as "committers-only",
35 | either automatically by clicking the provided link, by the reporter,
36 | or by a committer during the triage process.
37 | Note that issues marked "committers-only" are visible to all Eclipse committers.
38 | By default, a "committers-only" issue is also accessible to the reporter
39 | and individuals explicitly indicated in the "cc" list.
40 |
41 | ## Disclosure
42 |
43 | Disclosure is initially limited to the reporter and all Eclipse Committers,
44 | but is expanded to include other individuals, and the general public.
45 | The timing and manner of disclosure is governed by the
46 | [Eclipse Security Policy](https://www.eclipse.org/security/policy.php).
47 |
48 | Publicly disclosed issues are listed on the
49 | [Disclosed Vulnerabilities Page](https://www.eclipse.org/security/known.php).
50 |
--------------------------------------------------------------------------------
/examples/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2022-2025 Contributors to the Eclipse Foundation
2 | #
3 | # This program and the accompanying materials are made available under the
4 | # terms of the Apache License, Version 2.0 which is available at
5 | # https://www.apache.org/licenses/LICENSE-2.0.
6 | #
7 | # Unless required by applicable law or agreed to in writing, software
8 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
9 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
10 | # License for the specific language governing permissions and limitations
11 | # under the License.
12 | #
13 | # SPDX-License-Identifier: Apache-2.0
14 |
15 | add_subdirectory(example_model)
16 |
17 | # Currently only adding examples that can be tested without additional velocitas code generation
18 |
19 | add_subdirectory(performance-subscribe)
20 | add_subdirectory(seat-adjuster)
21 | add_subdirectory(set-data-points)
22 |
--------------------------------------------------------------------------------
/examples/example_model/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2022-2025 Contributors to the Eclipse Foundation
2 | #
3 | # This program and the accompanying materials are made available under the
4 | # terms of the Apache License, Version 2.0 which is available at
5 | # https://www.apache.org/licenses/LICENSE-2.0.
6 | #
7 | # Unless required by applicable law or agreed to in writing, software
8 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
9 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
10 | # License for the specific language governing permissions and limitations
11 | # under the License.
12 | #
13 | # SPDX-License-Identifier: Apache-2.0
14 |
15 | set(TARGET_NAME "example_model")
16 |
17 | add_library(${TARGET_NAME} INTERFACE)
18 |
19 | target_include_directories(${TARGET_NAME} INTERFACE .)
20 |
--------------------------------------------------------------------------------
/examples/example_model/vehicle/Cabin/Cabin.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2022-2025 Contributors to the Eclipse Foundation
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Apache License, Version 2.0 which is available at
6 | * https://www.apache.org/licenses/LICENSE-2.0.
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
10 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
11 | * License for the specific language governing permissions and limitations
12 | * under the License.
13 | *
14 | * SPDX-License-Identifier: Apache-2.0
15 | */
16 |
17 | #ifndef VMDL_EXAMPLE_VEHICLE_CABIN_H
18 | #define VMDL_EXAMPLE_VEHICLE_CABIN_H
19 |
20 | #include "sdk/DataPoint.h"
21 | #include "sdk/Model.h"
22 |
23 | #include "vehicle/Cabin/Seat/Seat.h"
24 |
25 | #include
26 |
27 | namespace velocitas::vehicle {
28 |
29 | using ParentClass = Model;
30 |
31 | /** Cabin model. */
32 | class Cabin : public ParentClass {
33 | public:
34 | class SeatCollection : public ParentClass {
35 | public:
36 | class RowType : public ParentClass {
37 | public:
38 | RowType(const std::string& name, ParentClass* parent)
39 | : ParentClass(name, parent)
40 | , DriverSide("DriverSide", this)
41 | , Middle("Middle", this)
42 | , PassengerSide("PassengerSide", this) {}
43 |
44 | vehicle::cabin::Seat DriverSide;
45 | vehicle::cabin::Seat Middle;
46 | vehicle::cabin::Seat PassengerSide;
47 | };
48 |
49 | explicit SeatCollection(ParentClass* parent)
50 | : ParentClass("Seat", parent)
51 | , Row1("Row1", this)
52 | , Row2("Row2", this) {}
53 |
54 | RowType& Row(int index) {
55 | if (index == 1) {
56 | return Row1;
57 | }
58 | if (index == 2) {
59 | return Row2;
60 | }
61 | throw std::runtime_error("Given value is outside of allowed range [1;2]!");
62 | }
63 |
64 | RowType Row1;
65 | RowType Row2;
66 | };
67 |
68 | Cabin(const std::string& name, ParentClass* parent)
69 | : ParentClass(name, parent)
70 | , Seat(this) {}
71 |
72 | /**
73 | * Seat: branch
74 | * All seats.
75 | *
76 | **/
77 | SeatCollection Seat;
78 | };
79 |
80 | } // namespace velocitas::vehicle
81 |
82 | #endif // VMDL_EXAMPLE_VEHICLE_CABIN_H
83 |
--------------------------------------------------------------------------------
/examples/example_model/vehicle/Cabin/Seat/Seat.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2022-2025 Contributors to the Eclipse Foundation
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Apache License, Version 2.0 which is available at
6 | * https://www.apache.org/licenses/LICENSE-2.0.
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
10 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
11 | * License for the specific language governing permissions and limitations
12 | * under the License.
13 | *
14 | * SPDX-License-Identifier: Apache-2.0
15 | */
16 |
17 | #ifndef VMDL_EXAMPLE_VEHICLE_CABIN_SEAT_H
18 | #define VMDL_EXAMPLE_VEHICLE_CABIN_SEAT_H
19 |
20 | #include "sdk/DataPoint.h"
21 | #include "sdk/Model.h"
22 |
23 | namespace velocitas::vehicle::cabin {
24 |
25 | using ParentClass = Model;
26 |
27 | /** Seat model. */
28 | class Seat : public ParentClass {
29 | public:
30 | Seat(const std::string& name, ParentClass* parent)
31 | : ParentClass(name, parent)
32 | , Position("Position", this) {}
33 |
34 | /**
35 | * Position: actuator
36 | * Seat position on vehicle x-axis. Position is relative to the frontmost position supported by
37 | *the seat. 0 = Frontmost position supported.
38 | *
39 | * Value range: [0, ]
40 | * Unit: mm
41 | **/
42 | DataPointUint32 Position;
43 | };
44 |
45 | } // namespace velocitas::vehicle::cabin
46 |
47 | #endif // VMDL_EXAMPLE_VEHICLE_CABIN_SEAT_H
48 |
--------------------------------------------------------------------------------
/examples/example_model/vehicle/Vehicle.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2022-2025 Contributors to the Eclipse Foundation
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Apache License, Version 2.0 which is available at
6 | * https://www.apache.org/licenses/LICENSE-2.0.
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
10 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
11 | * License for the specific language governing permissions and limitations
12 | * under the License.
13 | *
14 | * SPDX-License-Identifier: Apache-2.0
15 | */
16 |
17 | #ifndef VMDL_EXAMPLE_VEHICLE_H
18 | #define VMDL_EXAMPLE_VEHICLE_H
19 |
20 | #include "sdk/DataPoint.h"
21 | #include "sdk/Model.h"
22 |
23 | #include "vehicle/Cabin/Cabin.h"
24 |
25 | namespace velocitas {
26 |
27 | using ParentClass = Model;
28 |
29 | /** Vehicle model. */
30 | class Vehicle : public ParentClass {
31 | public:
32 | Vehicle()
33 | : ParentClass("Vehicle")
34 | , Speed("Speed", this)
35 | , Cabin("Cabin", this) {}
36 |
37 | /**
38 | * Speed: sensor
39 | * Vehicle speed.
40 | *
41 | * Unit: km/h
42 | */
43 | DataPointFloat Speed;
44 |
45 | /**
46 | * Cabin: branch
47 | * All in-cabin components, including doors.
48 | *
49 | */
50 | vehicle::Cabin Cabin;
51 | };
52 |
53 | } // namespace velocitas
54 |
55 | #endif // VMDL_EXAMPLE_VEHICLE_H
56 |
--------------------------------------------------------------------------------
/examples/grpc_client/AppManifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "manifestVersion": "v3",
3 | "name": "SampleApp",
4 | "interfaces": [
5 | {
6 | "type": "grpc-interface",
7 | "config": {
8 | "src": "https://raw.githubusercontent.com/eclipse-kuksa/kuksa-incubation/0.4.0/seat_service/proto/sdv/edge/comfort/seats/v1/seats.proto",
9 | "required": {
10 | "methods": [
11 | "Move", "CurrentPosition"
12 | ]
13 | }
14 | }
15 | }
16 | ]
17 | }
18 |
--------------------------------------------------------------------------------
/examples/grpc_client/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2024-2025 Contributors to the Eclipse Foundation
2 | #
3 | # This program and the accompanying materials are made available under the
4 | # terms of the Apache License, Version 2.0 which is available at
5 | # https://www.apache.org/licenses/LICENSE-2.0.
6 | #
7 | # Unless required by applicable law or agreed to in writing, software
8 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
9 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
10 | # License for the specific language governing permissions and limitations
11 | # under the License.
12 | #
13 | # SPDX-License-Identifier: Apache-2.0
14 |
15 | include_directories(
16 | ${CMAKE_BINARY_DIR}/gens
17 | ${CONAN_INCLUDE_DIRS}
18 | )
19 |
20 | link_directories(
21 | ${CONAN_LIB_DIRS}
22 | )
23 |
24 | add_subdirectory(src)
25 |
--------------------------------------------------------------------------------
/examples/grpc_client/README.md:
--------------------------------------------------------------------------------
1 | # GRPC Client Example
2 |
3 | Used for the [Client](https://eclipse.dev/velocitas/docs/tutorials/grpc_service_generation/create_client/) example.
4 |
--------------------------------------------------------------------------------
/examples/grpc_client/src/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2024-2025 Contributors to the Eclipse Foundation
2 | #
3 | # This program and the accompanying materials are made available under the
4 | # terms of the Apache License, Version 2.0 which is available at
5 | # https://www.apache.org/licenses/LICENSE-2.0.
6 | #
7 | # Unless required by applicable law or agreed to in writing, software
8 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
9 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
10 | # License for the specific language governing permissions and limitations
11 | # under the License.
12 | #
13 | # SPDX-License-Identifier: Apache-2.0
14 |
15 | set(TARGET_NAME "grpc_client")
16 |
17 | add_executable(${TARGET_NAME}
18 | Launcher.cpp
19 | )
20 |
21 | target_link_libraries(${TARGET_NAME}
22 | ${CONAN_LIBS}
23 | )
24 |
--------------------------------------------------------------------------------
/examples/grpc_client/src/Launcher.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2024-2025 Contributors to the Eclipse Foundation
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Apache License, Version 2.0 which is available at
6 | * https://www.apache.org/licenses/LICENSE-2.0.
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
10 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
11 | * License for the specific language governing permissions and limitations
12 | * under the License.
13 | *
14 | * SPDX-License-Identifier: Apache-2.0
15 | */
16 |
17 | #include
18 | #include
19 | #include
20 |
21 | #include
22 |
23 | using namespace velocitas;
24 |
25 | int main(int argc, char** argv) {
26 | // The default Velocitas Middleware class performs service discovery by
27 | // environment variables.
28 | // For this client it expects SDV_SEATS_ADDRESS to be defined
29 | // for example:
30 | // export SDV_SEATS_ADDRESS=grpc://127.0.0.1:5556
31 |
32 | std::cout << "Starting " << std::endl;
33 | auto serviceClient = SeatsServiceClientFactory::create(Middleware::getInstance());
34 |
35 | ::grpc::ClientContext context;
36 | ::sdv::edge::comfort::seats::v1::MoveRequest request;
37 | ::sdv::edge::comfort::seats::v1::MoveReply response;
38 |
39 | ::sdv::edge::comfort::seats::v1::Seat seat;
40 |
41 | ::sdv::edge::comfort::seats::v1::SeatLocation seat_location;
42 | seat_location.set_row(1);
43 | seat_location.set_index(1);
44 |
45 | ::sdv::edge::comfort::seats::v1::Position seat_position;
46 |
47 | seat_position.set_base(75.0);
48 |
49 | seat.set_allocated_location(&seat_location);
50 | seat.set_allocated_position(&seat_position);
51 |
52 | request.set_allocated_seat(&seat);
53 |
54 | auto status = serviceClient->Move(&context, request, &response);
55 |
56 | std::cout << "gRPC Server returned code: " << status.error_code() << std::endl;
57 | std::cout << "gRPC error message: " << status.error_message().c_str() << std::endl;
58 |
59 | if (status.error_code() != ::grpc::StatusCode::OK) {
60 | // Some error
61 | return 1;
62 | } else {
63 | ::grpc::ClientContext context;
64 | ::sdv::edge::comfort::seats::v1::CurrentPositionRequest request;
65 | ::sdv::edge::comfort::seats::v1::CurrentPositionReply response;
66 |
67 | request.set_row(1);
68 | request.set_index(1);
69 |
70 | auto status_curr_pos = serviceClient->CurrentPosition(&context, request, &response);
71 | std::cout << "gRPC Server returned code: " << status_curr_pos.error_code() << std::endl;
72 | std::cout << "gRPC error message: " << status_curr_pos.error_message().c_str() << std::endl;
73 | if (status_curr_pos.ok())
74 | std::cout << "current Position:" << response.seat().position().base() << std::endl;
75 | return 0;
76 | }
77 | }
78 |
--------------------------------------------------------------------------------
/examples/grpc_server/AppManifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "manifestVersion": "v3",
3 | "name": "SampleApp",
4 | "interfaces": [
5 | {
6 | "type": "grpc-interface",
7 | "config": {
8 | "src": "https://raw.githubusercontent.com/eclipse-kuksa/kuksa-incubation/0.4.0/seat_service/proto/sdv/edge/comfort/seats/v1/seats.proto",
9 | "provided": { }
10 | }
11 | },
12 | {
13 | "type": "vehicle-signal-interface",
14 | "config": {
15 | "src": "https://github.com/COVESA/vehicle_signal_specification/releases/download/v4.0/vss_rel_4.0.json",
16 | "datapoints": {
17 | "required": [
18 | {
19 | "path": "Vehicle.Cabin.Seat.Row1.DriverSide.Position",
20 | "access": "write"
21 | }
22 | ]
23 | }
24 | }
25 | }
26 | ]
27 | }
28 |
--------------------------------------------------------------------------------
/examples/grpc_server/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2024-2025 Contributors to the Eclipse Foundation
2 | #
3 | # This program and the accompanying materials are made available under the
4 | # terms of the Apache License, Version 2.0 which is available at
5 | # https://www.apache.org/licenses/LICENSE-2.0.
6 | #
7 | # Unless required by applicable law or agreed to in writing, software
8 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
9 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
10 | # License for the specific language governing permissions and limitations
11 | # under the License.
12 | #
13 | # SPDX-License-Identifier: Apache-2.0
14 |
15 | include_directories(
16 | ${CMAKE_BINARY_DIR}/gens
17 | ${CONAN_INCLUDE_DIRS}
18 | )
19 |
20 | link_directories(
21 | ${CONAN_LIB_DIRS}
22 | )
23 |
24 | add_subdirectory(src)
25 |
--------------------------------------------------------------------------------
/examples/grpc_server/README.md:
--------------------------------------------------------------------------------
1 | # GRPC Server Example
2 |
3 | Used for the [Server](https://eclipse.dev/velocitas/docs/tutorials/grpc_service_generation/create_server/) example.
4 |
--------------------------------------------------------------------------------
/examples/grpc_server/src/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2024-2025 Contributors to the Eclipse Foundation
2 | #
3 | # This program and the accompanying materials are made available under the
4 | # terms of the Apache License, Version 2.0 which is available at
5 | # https://www.apache.org/licenses/LICENSE-2.0.
6 | #
7 | # Unless required by applicable law or agreed to in writing, software
8 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
9 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
10 | # License for the specific language governing permissions and limitations
11 | # under the License.
12 | #
13 | # SPDX-License-Identifier: Apache-2.0
14 |
15 | set(TARGET_NAME "grpc_server")
16 |
17 | add_executable(${TARGET_NAME}
18 | # SeatsServiceImpl.cpp - No need to include as included from header file
19 | Launcher.cpp
20 | )
21 |
22 | target_link_libraries(${TARGET_NAME}
23 | ${CONAN_LIBS}
24 | )
25 |
--------------------------------------------------------------------------------
/examples/grpc_server/src/Launcher.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2024-2025 Contributors to the Eclipse Foundation
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Apache License, Version 2.0 which is available at
6 | * https://www.apache.org/licenses/LICENSE-2.0.
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
10 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
11 | * License for the specific language governing permissions and limitations
12 | * under the License.
13 | *
14 | * SPDX-License-Identifier: Apache-2.0
15 | */
16 |
17 | #include "SeatsServiceImpl.h"
18 | #include
19 | #include
20 |
21 | #include "vehicle/Vehicle.hpp"
22 |
23 | #include
24 |
25 | using namespace velocitas;
26 |
27 | int main(int argc, char** argv) {
28 | auto seatsImpl = std::make_shared();
29 |
30 | velocitas::VehicleModelContext::getInstance().setVdbc(
31 | velocitas::IVehicleDataBrokerClient::createInstance("vehicledatabroker"));
32 |
33 | auto seatServer = SeatsServiceServerFactory::create(Middleware::getInstance(), seatsImpl);
34 |
35 | seatServer->Wait();
36 |
37 | std::cout << "Waiting!" << std::endl;
38 | return 0;
39 | }
40 |
--------------------------------------------------------------------------------
/examples/grpc_server/src/SeatsServiceImpl.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2024-2025 Contributors to the Eclipse Foundation
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Apache License, Version 2.0 which is available at
6 | * https://www.apache.org/licenses/LICENSE-2.0.
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
10 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
11 | * License for the specific language governing permissions and limitations
12 | * under the License.
13 | *
14 | * SPDX-License-Identifier: Apache-2.0
15 | */
16 |
17 | #ifndef VELOCITAS_SERVICE_IMPL_Seats_H
18 | #define VELOCITAS_SERVICE_IMPL_Seats_H
19 |
20 | #include "vehicle/Vehicle.hpp"
21 | #include
22 | #include
23 |
24 | namespace velocitas {
25 |
26 | class SeatsService final : public sdv::edge::comfort::seats::v1::Seats::Service {
27 | public:
28 | SeatsService(){};
29 | virtual ~SeatsService(){};
30 |
31 | //
32 | ::grpc::Status Move(::grpc::ServerContext* context,
33 | const ::sdv::edge::comfort::seats::v1::MoveRequest* request,
34 | ::sdv::edge::comfort::seats::v1::MoveReply* response) override;
35 | ::grpc::Status
36 | MoveComponent(::grpc::ServerContext* context,
37 | const ::sdv::edge::comfort::seats::v1::MoveComponentRequest* request,
38 | ::sdv::edge::comfort::seats::v1::MoveComponentReply* response) override;
39 | ::grpc::Status
40 | CurrentPosition(::grpc::ServerContext* context,
41 | const ::sdv::edge::comfort::seats::v1::CurrentPositionRequest* request,
42 | ::sdv::edge::comfort::seats::v1::CurrentPositionReply* response) override;
43 | //
44 |
45 | private:
46 | vehicle::Vehicle vehicle;
47 | };
48 |
49 | } // namespace velocitas
50 |
51 | #include "SeatsServiceImpl.cpp"
52 |
53 | #endif // VELOCITAS_SERVICE_IMPL_Seats_H
54 |
--------------------------------------------------------------------------------
/examples/performance-subscribe/AppManifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "manifestVersion": "v3",
3 | "name": "performance-subscribe",
4 | "interfaces": [
5 | {
6 | "type": "vehicle-signal-interface",
7 | "config": {
8 | "src": "https://github.com/COVESA/vehicle_signal_specification/releases/download/v4.0/vss_rel_4.0.json",
9 | "datapoints": {
10 | "required": [
11 | ]
12 | }
13 | }
14 | }
15 | ]
16 | }
17 |
--------------------------------------------------------------------------------
/examples/performance-subscribe/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2024-2025 Contributors to the Eclipse Foundation
2 | #
3 | # This program and the accompanying materials are made available under the
4 | # terms of the Apache License, Version 2.0 which is available at
5 | # https://www.apache.org/licenses/LICENSE-2.0.
6 | #
7 | # Unless required by applicable law or agreed to in writing, software
8 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
9 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
10 | # License for the specific language governing permissions and limitations
11 | # under the License.
12 | #
13 | # SPDX-License-Identifier: Apache-2.0
14 |
15 | set(TARGET_NAME "example-performance-subscribe")
16 |
17 | add_executable(${TARGET_NAME}
18 | src/Launcher.cpp
19 | src/PerformanceTestApp.cpp
20 | )
21 |
22 | target_include_directories(${TARGET_NAME}
23 | PRIVATE
24 | ${CMAKE_CURRENT_SOURCE_DIR}/src
25 | )
26 |
27 | target_link_libraries(${TARGET_NAME}
28 | vehicle-app-sdk
29 | example_model
30 | nlohmann_json::nlohmann_json
31 | )
32 |
--------------------------------------------------------------------------------
/examples/performance-subscribe/README.md:
--------------------------------------------------------------------------------
1 | ## Usage
2 |
3 | 1) Create a .json file named: "subscription_signals.json"
4 | 2) Place it in the same folder as the binary
5 | 3) Exeucute the binary e.g. "./example-performance-subscribe"
6 | Alternatively, you can specify the path of the signal list explicitly: "./example-performance-subscribe \"
7 | 4) Check the console output for the timestamps: "\ - \ - \"
8 |
9 | ## .json format
10 |
11 | The following format is mandatory for the input file:
12 |
13 | ```
14 | {
15 | "signals": [
16 | {
17 | "path": "Vehicle.LowVoltageBattery.CurrentVoltage"
18 | },
19 | {
20 | "path": "Vehicle.LowVoltageBattery.CurrentCurrent"
21 | },
22 | {
23 | "path": "Vehicle.Speed"
24 | },
25 | ...
26 | ]
27 | }
28 | ```
29 |
30 | Signals which are not available will be printed in the console as a warning.
31 |
--------------------------------------------------------------------------------
/examples/performance-subscribe/src/Launcher.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2024-2025 Contributors to the Eclipse Foundation
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Apache License, Version 2.0 which is available at
6 | * https://www.apache.org/licenses/LICENSE-2.0.
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
10 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
11 | * License for the specific language governing permissions and limitations
12 | * under the License.
13 | *
14 | * SPDX-License-Identifier: Apache-2.0
15 | */
16 |
17 | #include "PerformanceTestApp.h"
18 | #include "sdk/Logger.h"
19 |
20 | #include
21 |
22 | #include
23 | #include
24 | #include
25 | #include
26 | #include
27 | #include
28 |
29 | namespace {
30 |
31 | std::unique_ptr myApp;
32 |
33 | void signal_handler(int sig) {
34 | velocitas::logger().info("App terminating signal received: {}", sig);
35 | myApp->stop();
36 | }
37 |
38 | const char DEFAULT_CONFIG_FILENAME[] = "subscription_signals.json";
39 |
40 | std::string getDefaultConfigFilePath(const char* appBinaryPath) {
41 | std::filesystem::path path = appBinaryPath;
42 | path.replace_filename(DEFAULT_CONFIG_FILENAME);
43 | return std::string{path};
44 | }
45 |
46 | std::vector readSignalNameFromFiles(const std::string& configFile) {
47 | velocitas::logger().info("Reading signal list from file {}.", configFile);
48 | const auto config = nlohmann::json::parse(std::ifstream(configFile));
49 | const auto& signalList = config["signals"];
50 |
51 | std::vector signalNames;
52 | signalNames.reserve(signalList.size());
53 | for (const auto& signal : signalList) {
54 | const std::string& signalName = signal["path"];
55 | if (!signalName.empty()) {
56 | velocitas::logger().debug("{}", signalName);
57 | signalNames.push_back(signalName);
58 | } else {
59 | velocitas::logger().warn("Signal entry without 'path' found!");
60 | }
61 | }
62 | return signalNames;
63 | }
64 |
65 | } // anonymous namespace
66 |
67 | int main(int argc, char** argv) {
68 | signal(SIGINT, signal_handler);
69 |
70 | const auto configFile =
71 | (argc > 1) ? std::filesystem::path(argv[1]).string() : getDefaultConfigFilePath(argv[0]);
72 | auto signalList = readSignalNameFromFiles(configFile);
73 |
74 | myApp = std::make_unique(std::move(signalList));
75 | myApp->run();
76 | return 0;
77 | }
78 |
--------------------------------------------------------------------------------
/examples/performance-subscribe/src/PerformanceTestApp.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2024-2025 Contributors to the Eclipse Foundation
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Apache License, Version 2.0 which is available at
6 | * https://www.apache.org/licenses/LICENSE-2.0.
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
10 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
11 | * License for the specific language governing permissions and limitations
12 | * under the License.
13 | *
14 | * SPDX-License-Identifier: Apache-2.0
15 | */
16 |
17 | #include "PerformanceTestApp.h"
18 | #include "sdk/IPubSubClient.h"
19 | #include "sdk/Logger.h"
20 | #include "sdk/vdb/IVehicleDataBrokerClient.h"
21 |
22 | #include
23 | #include
24 |
25 | #include
26 | #include
27 |
28 | namespace example {
29 |
30 | namespace {
31 | std::string getValueRepresentation(const velocitas::DataPointValue& value) {
32 | if (!value.isValid()) {
33 | return toString(value.getFailure());
34 | }
35 | return value.getValueAsString();
36 | }
37 |
38 | template TTimeBase getTimestamp() {
39 | const auto timestamp = std::chrono::high_resolution_clock::now();
40 | const auto timeSinceEpoch = timestamp.time_since_epoch();
41 | return std::chrono::duration_cast(timeSinceEpoch);
42 | }
43 |
44 | } // anonymous namespace
45 |
46 | PerformanceTestApp::PerformanceTestApp(std::vector signalList)
47 | : VehicleApp(velocitas::IVehicleDataBrokerClient::createInstance("vehicledatabroker"))
48 | , m_signalList{std::move(signalList)} {}
49 |
50 | void PerformanceTestApp::onStart() {
51 | velocitas::logger().info("Subscribing to signals ...");
52 | for (auto path : m_signalList) {
53 | subscribeDataPoints("SELECT " + path)
54 | ->onItem([path](const velocitas::DataPointReply& reply) {
55 | const auto value = getValueRepresentation(*reply.getUntyped(path));
56 | const auto timestamp = getTimestamp();
57 | fmt::print("{:%T} - {} - {}\n", timestamp, path, value);
58 | })
59 | ->onError([path](const velocitas::Status& status) {
60 | velocitas::logger().error("Error on subscription for data point {}: {}", path,
61 | status.errorMessage());
62 | });
63 | }
64 | }
65 |
66 | } // namespace example
67 |
--------------------------------------------------------------------------------
/examples/performance-subscribe/src/PerformanceTestApp.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2024-2025 Contributors to the Eclipse Foundation
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Apache License, Version 2.0 which is available at
6 | * https://www.apache.org/licenses/LICENSE-2.0.
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
10 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
11 | * License for the specific language governing permissions and limitations
12 | * under the License.
13 | *
14 | * SPDX-License-Identifier: Apache-2.0
15 | */
16 |
17 | #ifndef VEHICLE_APP_SDK_PERFORMANCETESTAPP_H
18 | #define VEHICLE_APP_SDK_PERFORMANCETESTAPP_H
19 |
20 | #include "sdk/VehicleApp.h"
21 |
22 | #include
23 | #include
24 |
25 | namespace example {
26 |
27 | /**
28 | * @brief
29 | */
30 | class PerformanceTestApp : public velocitas::VehicleApp {
31 | public:
32 | explicit PerformanceTestApp(std::vector signalList);
33 |
34 | void onStart() override;
35 |
36 | private:
37 | std::vector m_signalList;
38 | };
39 |
40 | } // namespace example
41 |
42 | #endif // VEHICLE_APP_SDK_PERFORMANCETESTAPP_H
43 |
--------------------------------------------------------------------------------
/examples/seat-adjuster/AppManifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "manifestVersion": "v3",
3 | "name": "seatadjuster",
4 | "interfaces": [
5 | {
6 | "type": "vehicle-signal-interface",
7 | "config": {
8 | "src": "https://github.com/COVESA/vehicle_signal_specification/releases/download/v4.0/vss_rel_4.0.json",
9 | "datapoints": {
10 | "required": [
11 | {
12 | "path": "Vehicle.Cabin.Seat.Row1.DriverSide.Position",
13 | "access": "write"
14 | },
15 | {
16 | "path": "Vehicle.Speed",
17 | "access": "read"
18 | }
19 | ]
20 | }
21 | }
22 | },
23 | {
24 | "type": "pubsub",
25 | "config": {
26 | "reads": [ "seatadjuster/setPosition/request" ],
27 | "writes": [
28 | "seatadjuster/setPosition/response",
29 | "seatadjuster/currentPosition"
30 | ]
31 | }
32 | }
33 | ]
34 | }
35 |
--------------------------------------------------------------------------------
/examples/seat-adjuster/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2022-2025 Contributors to the Eclipse Foundation
2 | #
3 | # This program and the accompanying materials are made available under the
4 | # terms of the Apache License, Version 2.0 which is available at
5 | # https://www.apache.org/licenses/LICENSE-2.0.
6 | #
7 | # Unless required by applicable law or agreed to in writing, software
8 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
9 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
10 | # License for the specific language governing permissions and limitations
11 | # under the License.
12 | #
13 | # SPDX-License-Identifier: Apache-2.0
14 |
15 | set(TARGET_NAME "example-seatadjusterapp")
16 |
17 | add_executable(${TARGET_NAME}
18 | src/SeatAdjusterApp.cpp
19 | )
20 |
21 | target_include_directories(${TARGET_NAME}
22 | PRIVATE
23 | ${CMAKE_CURRENT_SOURCE_DIR}/src
24 | )
25 |
26 | target_link_libraries(${TARGET_NAME}
27 | vehicle-app-sdk
28 | example_model
29 | nlohmann_json::nlohmann_json
30 | )
31 |
--------------------------------------------------------------------------------
/examples/seat-adjuster/src/SeatAdjusterApp.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2022-2025 Contributors to the Eclipse Foundation
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Apache License, Version 2.0 which is available at
6 | * https://www.apache.org/licenses/LICENSE-2.0.
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
10 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
11 | * License for the specific language governing permissions and limitations
12 | * under the License.
13 | *
14 | * SPDX-License-Identifier: Apache-2.0
15 | */
16 |
17 | #ifndef VEHICLE_APP_SDK_SEATADJUSTER_EXAMPLE_H
18 | #define VEHICLE_APP_SDK_SEATADJUSTER_EXAMPLE_H
19 |
20 | #include "sdk/Status.h"
21 | #include "sdk/VehicleApp.h"
22 | #include "vehicle/Vehicle.h"
23 |
24 | #include
25 | #include
26 |
27 | namespace example {
28 |
29 | /**
30 | * @brief A sample SeatAdjusterApp.
31 | * The SeatAdjusterApp subscribes at the VehicleDataBroker for updates for
32 | * the Vehicle.Speed signal. It also subscribes at a MQTT topic to listen for
33 | * incoming requests to change the seat position and forwards the requested position
34 | * to the respective data point at the data broker, but only if Vehicle.Speed equals 0.
35 | */
36 | class SeatAdjusterApp : public velocitas::VehicleApp {
37 | public:
38 | SeatAdjusterApp();
39 |
40 | void onStart() override;
41 |
42 | /**
43 | * @brief Handle successful seat movement requests.
44 | *
45 | * @param requestId The ID of the request requested the movement.
46 | * @param requestedPosition The seat position of the request.
47 | */
48 | void onSeatMovementRequested(const velocitas::VoidResult&, int requestId,
49 | float requestedPosition);
50 |
51 | /**
52 | * @brief Handle set position request from PubSub topic
53 | *
54 | * @param data The JSON string received from PubSub topic.
55 | */
56 | void onSetPositionRequestReceived(const std::string& data);
57 |
58 | /**
59 | * @brief Handle seat movement events from the VDB.
60 | *
61 | * @param dataPoints The affected data points.
62 | */
63 | void onSeatPositionChanged(const velocitas::DataPointReply& dataPoints);
64 |
65 | /**
66 | * @brief Handle errors which occurred during async invocation.
67 | *
68 | * @param status The status which contains the error.
69 | */
70 | void onError(const velocitas::Status& status);
71 | void onErrorDatapoint(const velocitas::Status& status);
72 | void onErrorTopic(const velocitas::Status& status);
73 |
74 | private:
75 | std::shared_ptr m_vehicleModel;
76 | };
77 |
78 | } // namespace example
79 |
80 | #endif // VEHICLE_APP_SDK_SEATADJUSTER_EXAMPLE_H
81 |
--------------------------------------------------------------------------------
/examples/set-data-points/AppManifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "manifestVersion": "v3",
3 | "name": "set-data-points",
4 | "interfaces": [
5 | {
6 | "type": "vehicle-signal-interface",
7 | "config": {
8 | "src": "https://github.com/COVESA/vehicle_signal_specification/releases/download/v4.0/vss_rel_4.0.json",
9 | "datapoints": {
10 | "required": [
11 | {
12 | "path": "Vehicle.Cabin.Seat.Row1.DriverSide.Position",
13 | "access": "write"
14 | },
15 | {
16 | "path": "Vehicle.Cabin.Seat.Row1.PassengerSide.Position",
17 | "access": "write"
18 | },
19 | {
20 | "path": "Vehicle.Speed",
21 | "access": "write"
22 | }
23 | ]
24 | }
25 | }
26 | }
27 | ]
28 | }
29 |
--------------------------------------------------------------------------------
/examples/set-data-points/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2022-2025 Contributors to the Eclipse Foundation
2 | #
3 | # This program and the accompanying materials are made available under the
4 | # terms of the Apache License, Version 2.0 which is available at
5 | # https://www.apache.org/licenses/LICENSE-2.0.
6 | #
7 | # Unless required by applicable law or agreed to in writing, software
8 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
9 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
10 | # License for the specific language governing permissions and limitations
11 | # under the License.
12 | #
13 | # SPDX-License-Identifier: Apache-2.0
14 |
15 | set(TARGET_NAME "example-set-data-points")
16 |
17 | add_executable(${TARGET_NAME}
18 | src/SetDataPointsApp.cpp
19 | )
20 |
21 | target_include_directories(${TARGET_NAME}
22 | PRIVATE
23 | ${CMAKE_CURRENT_SOURCE_DIR}/src
24 | )
25 |
26 | target_link_libraries(${TARGET_NAME}
27 | vehicle-app-sdk
28 | example_model
29 | nlohmann_json::nlohmann_json
30 | )
31 |
--------------------------------------------------------------------------------
/examples/set-data-points/src/SetDataPointsApp.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2022-2025 Contributors to the Eclipse Foundation
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Apache License, Version 2.0 which is available at
6 | * https://www.apache.org/licenses/LICENSE-2.0.
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
10 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
11 | * License for the specific language governing permissions and limitations
12 | * under the License.
13 | *
14 | * SPDX-License-Identifier: Apache-2.0
15 | */
16 |
17 | #include "sdk/DataPointBatch.h"
18 | #include "sdk/IPubSubClient.h"
19 | #include "sdk/Logger.h"
20 | #include "sdk/QueryBuilder.h"
21 | #include "sdk/VehicleApp.h"
22 | #include "sdk/vdb/IVehicleDataBrokerClient.h"
23 | #include "vehicle/Vehicle.h"
24 |
25 | #include
26 | #include
27 | #include
28 |
29 | namespace example {
30 |
31 | class SetDataPointsApp : public velocitas::VehicleApp {
32 | public:
33 | SetDataPointsApp()
34 | : VehicleApp(velocitas::IVehicleDataBrokerClient::createInstance("vehicledatabroker")) {}
35 |
36 | void onStart() override {
37 | // set a single data point
38 | try {
39 | velocitas::logger().info("Setting single data point ...");
40 |
41 | Vehicle.Speed.set(100.0F)->await();
42 |
43 | velocitas::logger().info("Setting single data point successfully done.");
44 | } catch (velocitas::AsyncException& e) {
45 | velocitas::logger().error("Error on setting single data point: {}", e.what());
46 | }
47 |
48 | // set multiple data points at the same time
49 | try {
50 | velocitas::logger().info("Setting batch of data points ...");
51 |
52 | auto result = Vehicle.setMany()
53 | .add(Vehicle.Cabin.Seat.Row1.DriverSide.Position, 1000)
54 | .add(Vehicle.Cabin.Seat.Row1.PassengerSide.Position, 1000)
55 | .apply()
56 | ->await();
57 |
58 | if (result.empty()) {
59 | velocitas::logger().info("Setting batch of data points successfully done.");
60 | } else {
61 | velocitas::logger().error("Some data points of batch could not be set:");
62 | for (auto datapointError : result) {
63 | velocitas::logger().error(" '{}' -> {}", datapointError.first,
64 | datapointError.second);
65 | }
66 | }
67 | } catch (velocitas::AsyncException& e) {
68 | velocitas::logger().error("Error on setting batch of data points: {}", e.what());
69 | }
70 |
71 | velocitas::logger().info("Done. (Press Ctrl+C to terminate the app.)");
72 | }
73 |
74 | private:
75 | velocitas::Vehicle Vehicle;
76 | };
77 |
78 | } // namespace example
79 |
80 | std::unique_ptr myApp;
81 |
82 | void signal_handler(int sig) {
83 | velocitas::logger().info("App terminating signal received: {}", sig);
84 | myApp->stop();
85 | }
86 |
87 | int main(int argc, char** argv) {
88 | signal(SIGINT, signal_handler);
89 |
90 | myApp = std::make_unique();
91 | myApp->run();
92 | return 0;
93 | }
94 |
--------------------------------------------------------------------------------
/gcovr.cfg:
--------------------------------------------------------------------------------
1 | filter = examples
2 | filter = sdk
3 | exclude = .*/vehicle_model/
4 | exclude = .*/tests/
5 |
6 | cobertura = build/coverage.cobertura.xml
7 | html = build/coverage.html
8 |
--------------------------------------------------------------------------------
/license_header.txt:
--------------------------------------------------------------------------------
1 | Copyright (c) 2025 Contributors to the Eclipse Foundation
2 |
3 | This program and the accompanying materials are made available under the
4 | terms of the Apache License, Version 2.0 which is available at
5 | https://www.apache.org/licenses/LICENSE-2.0.
6 |
7 | Unless required by applicable law or agreed to in writing, software
8 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
9 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
10 | License for the specific language governing permissions and limitations
11 | under the License.
12 |
13 | SPDX-License-Identifier: Apache-2.0
14 |
--------------------------------------------------------------------------------
/requirements.txt:
--------------------------------------------------------------------------------
1 | gcovr==5.2
2 | conan==2.15.1
3 |
4 | pre-commit==3.5.0
5 | cpplint==1.6.1
6 |
--------------------------------------------------------------------------------
/sdk/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2022-2025 Contributors to the Eclipse Foundation
2 | #
3 | # This program and the accompanying materials are made available under the
4 | # terms of the Apache License, Version 2.0 which is available at
5 | # https://www.apache.org/licenses/LICENSE-2.0.
6 | #
7 | # Unless required by applicable law or agreed to in writing, software
8 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
9 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
10 | # License for the specific language governing permissions and limitations
11 | # under the License.
12 | #
13 | # SPDX-License-Identifier: Apache-2.0
14 |
15 | add_subdirectory(proto)
16 | add_subdirectory(src)
17 |
18 | if(SDK_BUILD_TESTS)
19 | add_subdirectory(tests)
20 | endif(SDK_BUILD_TESTS)
21 |
--------------------------------------------------------------------------------
/sdk/include/sdk/DataPointBatch.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2022-2025 Contributors to the Eclipse Foundation
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Apache License, Version 2.0 which is available at
6 | * https://www.apache.org/licenses/LICENSE-2.0.
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
10 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
11 | * License for the specific language governing permissions and limitations
12 | * under the License.
13 | *
14 | * SPDX-License-Identifier: Apache-2.0
15 | */
16 |
17 | #ifndef VEHICLE_APP_SDK_DATAPOINTBATCH_H
18 | #define VEHICLE_APP_SDK_DATAPOINTBATCH_H
19 |
20 | #include "sdk/AsyncResult.h"
21 | #include "sdk/DataPointValue.h"
22 |
23 | #include