Examples of Open Vehicle API#

Before starting with the examples we have to explain the wording.

Open Vehicle API is an application development framework above the middleware. In general context Vehicle Function is often named as application or the other way around.

../../_images/expression_in_contect_of_open_vapi.png

In context of Open Vehicle API it is different: the Vehicle Function will be implemented as Complex Service . In context of Open Vehicle API an application is either an Standalone Application or an Extern Application. A Standalone Application contains all VAPI Component s while an Extern Application connects itself to a running Open Vehicle API instance.

A Complex Service is meant to run in it own process and is supposed to connect to Basic Service s and other Complex Service s. A Complex Service should not use interface s of Vehicle Device s. This will be avoided when we do not create Proxy and Stub code for the Vehicle Device interface.

Hint

General layout of a standalone application:

sdv::app::CAppControl appcontrol;
appcontrol.AddModuleSearchDir(<path_to_component_binaries>);
appcontrol.Startup("");
appcontrol.SetConfigMode();
appcontrol.AddConfigSearchDir(<path_to_configuration_files>);

appcontrol->LoadConfig(<load_data_dispatch_service>);
appcontrol->LoadConfig(<load_tasktimer_service>);
- register your signals or load a data link component (which will register signals)
appcontrol->LoadConfig(<load_your_components>);
appcontrol.SetRunningMode();

   ... run your application

- unregister signals in case no data link component was used
appcontrol.Shutdown();

Basic Examples#

The VAPI Framework contains several different types of examples.

Basic examples: First it is recommended to have a closer look at the basic examples to understand the basics of a SDV component and the principles of the framework.

Headlight Example#

Headlight example: This example shows a simple function. If the vehicle is in a tunnel, the headlights are turned on Outside of the tunnel the lights are switched off.

Door Service Example#

Door service example: This example shows one possibility to abstract a vehicle to support multiple doors. Additional it contains the creation of an FMU to simulate VAPI component s in the open source software OpenXilEnv.

Open Trunk Example#

Open trunk example: This example will show a Mixed-Criticality scenario: Two VAPI Component s. As the example is running only one VAPI instance, the QM Function can avoid the connection to the safety Complex Service just by bypassing and using the Basic Service directly. In Mixed-Criticality mode the connection would be prevendet and the Complex Service in this example could be seen as safety, ASIL rated component.

System Demo Example#

System demo example: explains the different layers, how signals are handled and how an application or a core instance could look like. Also the helper utilities sdv_dbc_util and sdv_vss_utl to create auto generated code are descripted.

Important

This example is worth to spent a time to deep dive into it as it contains the complete stack: its build up with auto generated code, runs with and without data link, generates an installation and shows how an external application connects itself to a running VAPI core instance.

Additional Examples#