This step is optional.

As default the log message is set to "Hello AUTOSAR Adaptive World". This instruction explains how to adapt the application logic, using the log message as a simple example.

The application logic is stored in the application.cpp of your application.

notice

File location: <Hello World App Dir>/src/application.cpp

The Run Method

The Run method is the logic of the application.

  • If the application is reaching this point and the initialization went well it is reporting the application state kRunning to the Executionmanager.
  • Afterwards the example is printing a log message.
  • As a last step the application state kTerminating is reported to the Executionmanager.

Change the output

  1. Open application.cpp
  2. Find the Run() method
  3. Change the text of the LogInfo
  4. std::int8_t Application::Run() {
      std::int8_t ret{EXIT_SUCCESS};

      if (!has_initialization_failed_) {
        this->ReportApplicationState(ara::exec::ApplicationState::kRunning);
        log_.LogInfo() << "ADD YOUR LOG MESSAGE HERE";
        …
        }
      …
    }

notice

Please ensure that the app terminates if the exit_requested_ member is set to true. For more details, see comment in the Run() method.

Rebuild the application

cmake --build . --target hwsrc_app --parallel $(nproc)

This time the build is much faster as only the changed parts are rebuilt (incremental build).

 

Next step in the tutorial: Install and Run the application