Download as pdf or txt
Download as pdf or txt
You are on page 1of 16

PduHdrTpBinding

Technical Reference
Adaptive MICROSAR
Version master-4011

Authors mschmidbauer, visaey, visbft, visbsz, vishrs, vislpp, vismhe,


vissa, visstk, vistia, vistrh, viswsi
Status Not Released
Technical Reference PduHdrTpBinding

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. Adaptive Platform Release Overview. R19-03.
[2] AUTOSAR. Specification of Diagnostics for Adaptive Platform. R19-03.
[3] AUTOSAR. Specification of Manifest. R18-03.
[4] Vector Informatik GmbH. Integrating Adaptive MICROSAR.
[5] Vector Informatik GmbH. Technical Reference Adaptive Log and Trace Library.
[6] Vector Informatik GmbH. Technical Reference Diagnostic Manager.
[7] Vector Informatik GmbH. Technical Reference OS Abstraction Library.
[8] Vector Informatik GmbH. Technical Reference Vector Adaptive Common Library.
[9] Vector Informatik GmbH. Technical Reference Vector Adaptive Json Library.
[10] Vector Informatik GmbH. Technical Reference Vector Thread Library.

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.

© 2021, Vector Informatik GmbH Version: master-4011 1 / 15

based on template version 1.00.00


Technical Reference PduHdrTpBinding

Contents

1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.1 Architectural Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.1.1 Dependencies 4
1.1.2 Component Design 5

2 Functional Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2.1 Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2.2 Handling of POSIX Signals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.3 Error Handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2.3.1 Exit Codes 8
2.3.2 Abnormal Terminations 8

2.4 Resource Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9


2.4.1 Thread Handling 9

3 Integration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
3.1 Build Dependencies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
3.2 Runtime Dependencies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
3.3 Files and Include Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
3.4 CMake . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
3.4.1 CMake Files 10
3.4.2 CMake Options 11

3.5 Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

4 API Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

5 Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
5.1 Runtime Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13

6 Glossary and Abbreviations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14


6.1 Glossary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
6.2 Abbreviations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14

7 Contact . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15

© 2021, Vector Informatik GmbH Version: master-4011 2 / 15

based on template version 1.00.00


Technical Reference PduHdrTpBinding

Illustrations

1-1 Interfaces to other Stack Components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

Tables

2-1 Supported Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6


2-2 Threads Created by the PduHdrTpBinding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2-3 Thread Order of the PduHdrTpBinding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

3-1 Description of Delivered CMake Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10


3-2 CMake Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

5-1 JSON parameter description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13

Listings

5-1 Example Configuration for PduHdrTpBinding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13

© 2021, Vector Informatik GmbH Version: master-4011 3 / 15

based on template version 1.00.00


Technical Reference PduHdrTpBinding

1 Introduction

This document describes the functionality, configuration and integration of the PduHdrTpBinding.

Vector Internal Library


The PduHdrTpBinding is a Vector internal library. It is not specified by AUTOSAR and
shall only be used by Vector’s implementation of the AUTOSAR Adaptive Diagnostic
Management (DM).

> Supported AUTOSAR Release R19-03


PduHdrTpBinding is a Transport Protocol based on TCP/IP to enable diagnostic communication. It is
part of the functional cluster diag. It uses AUTOSAR Classic SoAd PDU header option to encapsulate
UDS payload in the SoAd header.

1.1 Architectural Overview


1.1.1 Dependencies
To fulfill its functionality, the PduHdrTpBinding has dependencies to the following AUTOSAR Platform
modules and libraries (see figure 1-1):
> Diagnostic Utility: Provides utilities for diagnostic functionality (please refer to [6]
> UdsTransport API: Contains the standardized C++ interface (please refer to [2]
> Logging Library (ara::log): Used for logging debug information (please refer to [5])
> LibVaJson: Used for parsing JSON structures (please refer to [9])
> LibVAC: Implementation of containers and helper classes that are used by all parts of the Vector
Adaptive AUTOSAR stack (please refer to [8])
> OS Abstraction: Platform abstraction layer (please refer to [7])
> Thread: Provides thread functionality (please refer to [10])

Architectural overview

"Module"
PduHdrTpBinding

"Module"
"Module" "Module" "Module"
"Module" Uds "Module" "Module"
libos log-api Diagnostic
libvac Transport thread vajson
abstraction Utility
API

Figure 1-1 Interfaces to other Stack Components

© 2021, Vector Informatik GmbH Version: master-4011 4 / 15

based on template version 1.00.00


Technical Reference PduHdrTpBinding

1.1.2 Component Design


The PduHdrTpBinding is composed of multiple parts:
> A ChannelManagement, manages the different channels, transfers the received requests to the
TransportProtocolManager, sends the response to the Communicator
> A Communicator, provides a connection to a distant client and interprets the received payload
> A realization of the standardized C++ interface UDSTransportProtocolApi (see [2, chapter 8.1] for
further details)

© 2021, Vector Informatik GmbH Version: master-4011 5 / 15

based on template version 1.00.00


Technical Reference PduHdrTpBinding

2 Functional Description

The features listed in the sections cover the complete functionality specified for the PduHdrTpBinding.
The implemented features are described in 2.1.

2.1 Features
The following features are supported:

Feature Description
Custom TP towards DM daemon This includes
> allow DM to control the
TP
> establish a TCP
connection
> enable diagnostic
communication with a
diagnostic client

SoAd PDU header option to encapsulate UDS payload 8 Bytes SoAd header:
> Source Address (2 Bytes)
> Target Address (2 Bytes)
> Payload Length (4 Bytes)

Reception of data over an established TCP connection refer to [2, chapter 8.1]
Transmission of data over an established TCP connection refer to [2, chapter 8.1]
Periodic Transmission of data over an established TCP connection refer to [2, chapter 8.1]

Table 2-1 Supported Features

© 2021, Vector Informatik GmbH Version: master-4011 6 / 15

based on template version 1.00.00


Technical Reference PduHdrTpBinding

2.2 Handling of POSIX Signals


All code of the component must be protected against the concurrent reception of POSIX Signals. If the
code of the component cannot be protected against the concurrent reception of POSIX Signals, the
reaction to the reception of a Signal must be the immediate termination of the process without further
processing of Adaptive MICROSAR code. Please see the Adaptive MICROSAR product manuals for
details how to achieve this in customer applications.
PduHdrTpBinding does not interact with POSIX Signals.

© 2021, Vector Informatik GmbH Version: master-4011 7 / 15

based on template version 1.00.00


Technical Reference PduHdrTpBinding

2.3 Error Handling


For a detailed description of error handling refer to chapter 4 API Description.

2.3.1 Exit Codes


PduHdrTpBinding does not return any exit codes, because it is a library.

2.3.2 Abnormal Terminations


Any unexpected error will either be propagated to the caller or terminate the process. Please see [4,
chapter “Abnormal Terminations”, section “Library Components”] for the mechanism used and details
about event notification.

© 2021, Vector Informatik GmbH Version: master-4011 8 / 15

based on template version 1.00.00


Technical Reference PduHdrTpBinding

2.4 Resource Management


This section describes the resource management of the PduHdrTpBinding.

2.4.1 Thread Handling


This section describes the following aspects of multithreading in the PduHdrTpBinding:
> The creation of threads,
> the number of threads created,
> the execution phase in which each thread is created,
> the purpose of the created threads,
> the order of creation and termination of threads.

Caution
This document only covers threads created by the described component itself. Threads of
components that are used for the implementation of this component are not described.

Table 2-2 lists the threads created by the PduHdrTpBinding.

Thread Name Multiplicity Spawned in Phase Description


vPduHdrTp 1 Init Thread for polling the reactor

Table 2-2 Threads Created by the PduHdrTpBinding

Table 2-3 shows the order in which the threads of the PduHdrTpBinding are started and terminated.

Startup Order Shutdown Order


vPduHdrTp vPduHdrTp

Table 2-3 Thread Order of the PduHdrTpBinding

© 2021, Vector Informatik GmbH Version: master-4011 9 / 15

based on template version 1.00.00


Technical Reference PduHdrTpBinding

3 Integration

Note
Please refer to the DM technical reference [6] for more information about the integration
and selection of the TP.

3.1 Build Dependencies


To build the PduHdrTpBinding the following components are required:
> amsr-vector-fs-diagnosticutility
> amsr-vector-fs-libiostream
> amsr-vector-fs-libosabstraction
> amsr-vector-fs-libvac
> amsr-vector-fs-log-api
> amsr-vector-fs-thread
> amsr-vector-fs-udstransport
> amsr-vector-fs-vajson
Please also note figure 1-1.

3.2 Runtime Dependencies


PduHdrTpBinding needs to run within DM context. For detailed information please refer to the
respective technical reference [6].

3.3 Files and Include Structure


PduHdrTpBinding is an internal library only. Therefore there are no header files or an include structure
to be used by customer software.
> Runtime Files:
PduHdrTpBinding does not create/write files during runtime.
PduHdrTpBinding reads the following configuration file on startup in the etc folder
> pduhdrtpbinding_config.json: Used to configure the PduHdrTpBinding

3.4 CMake
For detailed usage of CMake see documentation available at cmake.org/documentation.

3.4.1 CMake Files


The PduHdrTpBinding contains the CMake files listed in table 3-1.

CMake Path Description


./CMakeLists.txt CMake Project Root configuration.
./lib/PduHdrTpBinding/CMakeLists.txt CMake Project Sources configuration.

Table 3-1 Description of Delivered CMake Files

© 2021, Vector Informatik GmbH Version: master-4011 10 / 15

based on template version 1.00.00


Technical Reference PduHdrTpBinding

Note
The CMake files must be considered as drafts. Therefore, the CMake files must be
reviewed, tested and, if necessary, adapted by you.

3.4.2 CMake Options


The CMake project provided with this component has options as specified in table 3-2.

CMake Option Description Default Value


-DENABLE_DOXYGEN Vector internal use. Set to OFF OFF
-DBUILD_TESTS Vector internal use. Set to OFF OFF
-DENABLE_STATIC_ANALYSIS Vector internal use. Set to OFF OFF

Table 3-2 CMake Options

3.5 Installation
The PduHdrTpBinding does not install artifacts.

© 2021, Vector Informatik GmbH Version: master-4011 11 / 15

based on template version 1.00.00


Technical Reference PduHdrTpBinding

4 API Description

The PduHdrTpBinding is an internal library only used by DM. Therefore there are no APIs to be used
by customer software.

Caution
The API of the Adaptive MICROSAR product is build by public classes, their methods, free
functions and types. Classes, their accessible methods, free functions and other types that
are intended to be used by customers are annotated with the documentation tag \vpublic.
These items build the product public API. Customer software shall just use the public API
of Adaptive MICROSAR. The private part shall not be used.

© 2021, Vector Informatik GmbH Version: master-4011 12 / 15

based on template version 1.00.00


Technical Reference PduHdrTpBinding

5 Configuration

The configuration options of the PduHdrTpBinding are described in the following sections.

5.1 Runtime Configuration


The Configuration for PduHdrTpBinding can be configured using JSON parameters. They have to be
added manually to the pduhdrtpbinding_config.json file. See the description of the parameters in
table 5-1.

Parameter JSON key Description


IP Address IPAddress The IP Address of the listening/acceptor
socket
TCP Port TCPPort The TCP Port of the listening/acceptor
socket
Maximum number of Channels MaxChannels Maximum number of channels. Rep-
resents also the maximum number of
sockets
Maximum Payload length MaxPayloadLength The maximum Payload length in Bytes
Maximum Periodic Bulk Size MaxPeriodicBulkSize Represents the resources for periodic
transmission
TTL TTL The TTL/HopCount in IPv6

Table 5-1 JSON parameter description

An example how to configure the Configuration for PduHdrTpBinding is shown in listing 5-1.

Configuration for PduHdrTpBinding

{
"IPAddress": "192.168.7.2",
"TCPPort": 10000,
"MaxChannels": 5,
"MaxPayloadLength": 64,
"MaxPeriodicBulkSize": 16,
"TTL": 0
}

Listing 5-1 Example Configuration for PduHdrTpBinding

© 2021, Vector Informatik GmbH Version: master-4011 13 / 15

based on template version 1.00.00


Technical Reference PduHdrTpBinding

6 Glossary and Abbreviations

6.1 Glossary

Term Description
LibVAC Vector base type library
LibVaJson Vector library for parsing JSON files
Logging Li- AUTOSAR Adaptive Platform library for logging and tracing
brary (ara::log)
OS Abstraction Vector platform abstraction library
PduHdrTpBinding A custom TP based on TCP/IP and SoAd PDU header option

6.2 Abbreviations

Abbreviation Description
AMSR Adaptive MICROSAR
API Application Programming Interface
ARA AUTOSAR Runtime for Adaptive Applications
AUTOSAR Automotive Open System Architecture
DM Diagnostic Manager
IP Internet Protocol
JSON JavaScript Object Notation
MICROSAR Microcontroller Open System Architecture (the Vector AUTOSAR solu-
tion).
PDU Protocol Data Unit
SoAd Socket Adaptor
TCP Transmission Control Protocol
TP Transport Protocol
TTL Time To Live
UDS Unified Diagnostics Services
UTF-8 Unicode Transformation Format – 8-bit

© 2021, Vector Informatik GmbH Version: master-4011 14 / 15

based on template version 1.00.00


Technical Reference PduHdrTpBinding

7 Contact

Visit our website for more information on

> News
> Products
> Demo software
> Support
> Training data
> Addresses

www.vector.com

© 2021, Vector Informatik GmbH Version: master-4011 15 / 15

based on template version 1.00.00

You might also like