Professional Documents
Culture Documents
Technical Reference
Adaptive MICROSAR
Version master-3976
Document Information
History
The change history of this file is part of the component change history. It is documented in
ChangeHistory.txt of the component folder.
Reference Documents
[1] AUTOSAR. Specification of Core Types for Adaptive Platform. R19-03.
Caution
We have configured the programs in accordance with your specifications in the ques-
tionnaire. Whereas the programs do support other configurations than the one specified
in your questionnaire, Vector´s release of the programs delivered to your company is
expressly restricted to the configuration you have specified in the questionnaire.
Contents
1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.1 Architectural Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.1.1 Dependencies 5
1.1.2 Component Design 5
2 Functional Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2.1 Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2.1.1 Initialization and Shutdown 6
3 Integration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
3.1 Build Dependencies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
3.2 Files and Include Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
3.3 Integration of ApplicationBase . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
3.4 CMake . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
3.4.1 Build 8
3.4.2 Exported CMake packages 8
3.5 Usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
4 API Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
4.1 ara/core/initialization.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
4.1.1 Detailed Description 10
4.1.2 Function Documentation 10
4.1.2.1 Deinitialize() noexcept 10
4.1.2.2 Initialize() noexcept 11
6 Contact . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
Illustrations
Tables
Listings
1 Introduction
This document describes the functionality, API and configuration of the Adaptive AUTOSAR BSW
module ApplicationBase.
ApplicationBase provides the global initialization and shutdown functions, that initialize and deinitialize,
respectively, data structures and threads of the AUTOSAR Runtime for Adaptive Applications, as
specified in Adaptive Core Types specification [1].
> Supported AUTOSAR Release R19-03
ara::core::Initialize() has to be called before any ARA API is called in an Adaptive application.
ara::core::Deinitialize() has to be called when ARA APIs are not used any more in an Adaptive
application.
2 Functional Description
The features listed in the sections cover the complete functionality specified for the ApplicationBase.
Referring to the AUTOSAR standard functionality as specified in [1], the implemented features are
described in 2.1.
Known Limitations of the current implementation of the module are listed in 2.2.
2.1 Features
The following features specified in [1] are supported:
Feature Description
Initialization and Shutdown see 2.1.1
Limitation Description
Supported Modules Currently generation of initialization and deinitialization code
is only supported for amsr::vac, amsr::osabstraction,
amsr::thread, ara::log, ara::per, ara::com, ara::diag,
amsr::tsync and amsr::phm.
API Generation Currently executable.category is evaluated and only for
APPLICATION_LEVEL is initialization and deinitialization code
generated.
Reinitialization Only one sequence of ara::core::Initialize(),
ara::core::Deinitialize() is supported in one process.
3 Integration
If the component ara::com is used, the .json-configuration file used for the application must be placed
in the ./etc folder with the name com_application.json.
Every application needs an individual ApplicationBase library that is built with the application specific
generated code.
3.4 CMake
For detailed usage of CMake see documentation available at https://cmake.org/documentation.
3.4.1 Build
The CMake project provided with this component has options as specified in 3-1.
3.5 Usage
The example shown in 3-1 demonstrates the usage of ApplicationBase.
// ...
#include "ara/core/initialization.h"
4 API Description
Functions
> Result< void > ara::core::Initialize () noexcept
(Pre-)Initialization of the ARA Framework.
> Result< void > ara::core::Deinitialize () noexcept
Shutdown of the ARA Framework.
Precondition
ara::core::Initialize() has returned successfully.
All threads accessing ARA APIs joined.
Note
Calling any ARA functions after calling this function may have unforeseen consequences. When
Deinitialize() returns with an error, it is generally unsafe to call either Deinitialize() or Initialize()
again.
Remarks
The function body is generated.
// ...
#include "ara/core/initialization.h"
ara::core::Result<void> init_result {
ara::core::Initialize()};
// init_result.HasValue() != true -> ARA can not be used
// init_result.HasValue() == true -> ARA can be used
if(init_result.HasValue()) {
Thread-safe: FALSE
Reentrant: FALSE
Return values
Returns
an initialized Result<void> on success.
Note
Calling any ARA functions before calling this function may have unforeseen consequences.
Remarks
The function body is generated.
// ...
#include "ara/core/initialization.h"
Thread-safe: FALSE
Reentrant: FALSE
Return values
Returns
an initialized Result<void> on success.
Classes
> class amsr::application_base::InitializationException
Exception type thrown by ara::core::Initialize()/aracore::Deinitialize().
> class amsr::application_base::InitializationErrorDomain
Error domain for errors originating from ara::core::Initialize()/aracore::Deinitialize().
Enumerations
> enum amsr::application_base::InitializationErrc : ara::core::ErrorDomain::CodeType {
amsr::application_base::InitializationErrc::kWrongSequence = 101 }
Specifies the internal errors that can occur upon calling ara::core::Initialize()/aracore::Deinitialize().
Functions
> constexpr ara::core::ErrorDomain const & amsr::application_base::GetInitializationErrorDomain ()
noexcept
Obtain the reference to the single global InitializationErrorDomain instance.
> constexpr ara::core::ErrorCode amsr::application_base::MakeErrorCode (InitializationErrc code,
ara::core::ErrorDomain::SupportDataType data, char const ∗message) noexcept
Create a new ErrorCode for InitializationErrorDomain with the given support data type and message.
Returns
Reference to the InitializationErrorDomain instance.
Product public API
References amsr::application_base::GetInitializationErrorDomain().
Referenced by amsr::application_base::GetInitializationErrorDomain(), and amsr::application_base::MakeErrorCod
Parameters
Returns
The new ErrorCode instance.
Product public API
4.2.4 amsr::application_base::InitializationErrorDomain
Error domain for errors originating from ara::core::Initialize()/aracore::Deinitialize().
Inheritance diagram for amsr::application_base::InitializationErrorDomain:
ErrorDomain
amsr::application_base::InitializationErrorDomain
Public Types
> using Exception = InitializationException
Alias for the exception base class.
Parameters
Returns
The text message, never nullptr.
Product public API
Returns
"InitializationError".
Product public API
Parameters
The documentation for this class was generated from the following file:
> lib/application_base/include/amsr/application_base/initialization_error_domain.h
5.1 Abbreviations
Abbreviation Description
AMSR Adaptive MICROSAR
amsr-vector-fs- ApplicationBase CMake Project
applicationbase
AUTOSAR Automotive Open System Architecture
BOM Byte order mark
CRC Cyclic redundancy check
MICROSAR Microcontroller Open System Architecture
TLV Tag-Length-Value
UTF-8 Unicode Transformation Format – 8-bit
6 Contact
> News
> Products
> Demo software
> Support
> Training data
> Addresses
www.vector.com