Open Trunk Standalone Application#

Note

Execution:
open_trunk_example 0

Note

Demonstration of Open Trunk Example Code#

To simplify the code of this example we did not include the code processing the TX signal as it is not important here. The TX signals are included in all other examples. This example should visualize only a safety aspect and introduce the view about Mixed-Criticality .

Initialization
  • When user runs the executable ./open_trunk_example 0 , then the application will run as standalone application.

  • At first, it will check whether the SDV_FRAMEWORK_RUNTIME environment variable exists or not. If it was not set, then we need to set it manually by giving the location of framework headerfiles and binaries.

    ../../../_images/environment_set.png
  • From the given application configuration, the core services will be loaded in order to start the application.

    ../../../_images/startup_app.png
  • Now, we need to set to config mode for loading the required configuration files.

    ../../../_images/set_config.png
Data communication
  • The Vehicle Speed (Rx) signal will be subscribed via Data Dispatch Service, so when there is a change in signal value, the callback function will be called.

    ../../../_images/data_dispatch.png
  • Register the event in Vehicle Device on signal change.

    ../../../_images/vehicle_device_rx.png
  • Register callback function in Basic Service for signal change update.

    ../../../_images/basic_service_rx.png
  • Get the interfaces of Basic Service and Complex Service for opening the trunk.

    ../../../_images/get_interfaces.png
  • Now, we will set to running mode in which we can no longer load any more config files later.

    ../../../_images/set_running.png ../../../_images/data_flow_diag.png
Shutdown
  • Unregister the signals and events from the Basic and Complex services.

    ../../../_images/unregister_events.png
  • Shutdown the application.

    ../../../_images/shutdown_app.png
../../../_images/open_trunk_screenshot_0.png

The Speed signal is coming via CAN bus by using the VAPI Component can_com_sim.sdv from the framework. The VAPI Component reads the CAN messages from a text file and sends these messages to the Data Link The Data Link component is created from a dbc file with the help of the helper tool sdv_bcd_util.

Attention

For safety reason the red connection in the picture must be prevented as the connection bypasses the validation against vehicle movement.

../../../_images/open_trunk_example.png