TechnicalReference SoAd
TechnicalReference SoAd
Technical Reference
Version 17.4.0
Document Information
History
Reference Documents
Caution
We have configured the programs in accordance with your specifications in the
questionnaire. 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................................................................................................................. 12
1.1 Architecture Overview ...................................................................................... 14
3 Integration ................................................................................................................... 24
3.1 Scope of Delivery ............................................................................................. 24
3.2 Critical Sections ............................................................................................... 25
3.3 Main Functions ................................................................................................ 26
3.3.1 Preemption ...................................................................................... 26
3.4 Memory Sections ............................................................................................. 26
3.4.1 Memory Sections for Multi-partition use-case ................................... 26
3.5 Multi-partition ................................................................................................... 27
5 Configuration .............................................................................................................. 66
5.1 Configuration Variants ...................................................................................... 66
5.2 Configuration with DaVinci Configurator Classic .............................................. 66
5.2.1 Socket Connection handling............................................................. 66
5.2.1.1 Socket Connection Group .............................................. 66
5.2.1.2 Socket Connection establishment .................................. 67
5.2.1.2.1 Manual ....................................................... 67
5.2.1.2.2 Automatic ................................................... 68
5.2.1.3 Checksum handling on UDP sockets ............................. 68
5.2.2 Transmission path ............................................................................ 69
5.2.3 Reception path ................................................................................. 70
5.2.4 Vector specific feature ...................................................................... 70
5.2.4.1 Best Match Algorithm extensions ................................... 70
5.2.4.2 UDP Immediate IF TxConfirmaion.................................. 71
5.2.4.3 SoAd_GetRcvRemoteAddr() .......................................... 71
5.2.4.4 Additional SoConModeChg notification .......................... 72
5.2.4.5 Socket API ..................................................................... 72
5.2.4.6 Shutdown mechanism.................................................... 73
5.2.4.7 MainFunction splitting .................................................... 74
5.2.4.8 Optimized TP transmission ............................................ 75
7 Contact ........................................................................................................................ 91
Illustrations
Figure 1-1 Functional Overview ................................................................................. 13
Figure 1-2 AUTOSAR 4.2 Architecture Overview ....................................................... 14
Figure 1-3 Interfaces to adjacent modules of the Socket Adaptor .............................. 14
Figure 2-1 Module states ........................................................................................... 20
Figure 5-1 Socket Connection Group configuration.................................................... 66
Figure 5-2 Socket Connection configuration .............................................................. 67
Figure 5-3 Socket Connection Setup parameter ........................................................ 67
Figure 5-4 Remote address “not set” parameter ........................................................ 68
Figure 5-5 Configuration of checksum calculation on a UDP socket .......................... 69
Figure 5-6 Add PDU Route ........................................................................................ 69
Figure 5-7 Add PDU Route Destination ..................................................................... 69
Figure 5-8 Add Socket Route ..................................................................................... 70
Figure 5-9 Add Socket Route Destination .................................................................. 70
Figure 5-10 Best Match Algorithm extensions .............................................................. 71
Figure 5-11 UDP Immediate IF TxConfirmation ........................................................... 71
Figure 5-12 SoAd_GetRcvRemoteAddr ....................................................................... 71
Figure 5-13 Additional SoConModeChg notification ..................................................... 72
Figure 5-14 Configure Socket API................................................................................ 72
Figure 5-15 Enable upper layer specific <User>_ShutdownFinished() ......................... 73
Figure 5-16 Configure <User>_ShutdownFinished() for any module ............................ 73
Figure 5-17 Additional header file inclusion ................................................................. 73
Figure 5-18 Shutdown finished timeout ........................................................................ 74
Figure 5-19 Optimized TP transmission sequence ....................................................... 75
Figure 5-20 Optimized TP transmission configuration .................................................. 75
Figure 5-21 Trigger Transmit API for SoAd_IfTransmit configuration ............................ 77
Figure 5-22 NPduUdpTxQueue configuration .............................................................. 77
Figure 5-23 Event Queue limitation principle................................................................ 78
Figure 5-24 Event Queue limitation configuration ........................................................ 79
Figure 5-25 Timeout List limitation configuration .......................................................... 79
Figure 5-26 PDU reception verification callback configuration ..................................... 80
Figure 5-27 PDU reception verification socket connection configuration ...................... 80
Figure 5-28 Keep Socket Connection online configuration ........................................... 82
Figure 5-29 Socket UDP Alive Supervision Timeout configuration ............................... 82
Figure 5-30 Socket TCP Keep Alive Time configuration ............................................... 83
Figure 5-31 Anomaly reporting configuration ............................................................... 83
Figure 5-32 Security event references configuration .................................................... 84
Figure 5-33 Measurement Data SOME/IP SD Type configuration ................................ 84
Figure 5-34 SoAd instance configuration ..................................................................... 85
Figure 5-35 IF optimistic transmission fan-out configuration ........................................ 86
Figure 5-36 Socket specific MSL timeout configuration ................................................ 87
Figure 5-37 CDD configuration .................................................................................... 87
Tables
Table 2-1 Supported AUTOSAR standard conform feature ....................................... 16
Table 2-2 Not supported AUTOSAR standard conform features ............................... 17
Table 2-3 Features provided beyond the AUTOSAR standard .................................. 18
Table 2-4 Service IDs ............................................................................................... 23
Table 2-5 Errors reported to DET ............................................................................. 23
Table 3-1 Implementation files .................................................................................. 25
Table 3-2 Memory Mapping in multi-partition use case ............................................. 27
1 Introduction
This document describes the functionality, API and configuration of the AUTOSAR BSW
module Socket Adaptor as specified in [1].
The Socket Adaptor provides communication between PDU based communication and
socket based communication via TcpIp. Following key features are offered by the Socket
Adaptor:
> Support of TCP and UDP sockets over lower module TcpIp
> Supports multiple socket connections per local socket to support multiple
communication partners on the same local socket
> Control API for socket connections or automated socket connection handling by
Socket Adaptor
> Independent reception (Socket Route) and transmission path (Pdu Route) on a socket
connection
> Support of Interface (IF) and Transport Protocol (TP) PDUs for upper layers
> Generic upper layer configuration
Figure 1-1 provides a functional overview over Socket Adaptor and some examples of
possible configuration variants.
The next figure shows the interfaces of the Socket Adaptor. These interfaces are described
in chapter 4.
Applications do not access the services of the BSW modules directly. They use the service
ports provided by the BSW modules via the RTE. The Socket Adaptor does not support any
service ports.
2 Functional Description
The features listed in the following tables cover the complete functionality specified for the
Socket Adaptor.
The AUTOSAR standard functionality is specified in [1], the corresponding features are listed
in the tables
> Table 2-1 Supported AUTOSAR standard conform feature
> Table 2-2 Not supported AUTOSAR standard conform features
Vector Informatik provides further Socket Adaptor functionality beyond the AUTOSAR
standard. The corresponding features are listed in the table
> Table 2-3 Features provided beyond the AUTOSAR standard
2.1 Features
The following features specified in [1] are supported:
Supported AUTOSAR Standard Conform Features
Socket Connections and Socket Connection Groups
PDU Transmission
PDU Reception
PDU Header option
Best Match Algorithm
Message Acceptance Policy
TP PDU Cancelation
Disconnection and recovery
Routing Groups
PDU fan-out
Buffer handling (e.g. nPdu feature)
Error handling
Version check
Address assignment services
Support of post-build loadable
Get and reset measurement data
Release remote IP address service
Table 2-1 Supported AUTOSAR standard conform feature
2.2 Deviations
The following features specified in [1] are not supported:
Category Not Supported AUTOSAR Standard Conform Features
Functional Socket Routes (TCP/UDP) with multiple TP upper layers and disabled PDU Header
option
Functional Socket Connection Open (Ch 7.1.1): Following ParamIds are not supported:
- TCPIP_PARAMID_TCP_OPTIONFILTER
- TCPIP_PARAMID_PATHMTU_ENABLE
- TCPIP_PARAMID_FLOWLABEL
- TCPIP_PARAMID_DSCP
Functional Meta data is not provided via PduInfoPtr.MetaDataPtr. Instead, the meta data is
provided after the payload data via PduInfoType.SduDataPtr.
Functional SoAdSocketUdpAliveSupervisionTimeout:
- Timeout gets reset on transmission, too
- Timeout is not reset during SoAd_SetRemoteAddress
Functional Development Errors ([1] Ch 7.12.1): SOAD_E_INV_METADATA
API Det_ReportRuntimeError
API SoAd_TpCancelTransmit: ServiceIds from ASR-4.2.2 are used instead.
API SoAd_TpCancelReceive: ServiceIds from ASR-4.2.2 are used instead.
API SoAd_GetSoConMode
API SoAd_TpChangeParameter
API SoAd_RxIndication: Parameter “RemoteAddrPtr” and “BufPtr” are supported without
const.
API <Up>_[SoAd][If]TxConfirmation: parameter “result” is not supported
Config SoAdSocketDifferentiatedServicesField
Config SoAdSocketFlowLabel
Config SoAdSocketPathMTUEnabled
Config SoAdSocketSoConModeChgNotifyUpperLayerRef
Config SoAdSocketUdpChecksumEnabled
Config SoAdSocketTcpTxQuota
Config SoAdSocketTCPOptionFilterRef
Config SoAdSocketTcpTlcConnectionRef
Config SoAdTxPduCollectionSemantic:
- SoAdTxIfTriggerTransmit (TechRef Ch 5.2.4.10) is used instead
- mixed semantic is supported
Table 2-2 Not supported AUTOSAR standard conform features
Caution
There may be also some other deviations which are not documented here.
Hence, the compiler abstraction cannot be used to specify and optimize pointers (would lead
to compiler errors).
Workaround: Do not use special optimizations in compiler abstraction.
2.2.3 Hints
2.2.3.1 CDD Contribution Type
Socket Adaptor supports the “CddSoAdUpperLayerContribution” with schema according to
AUTOSAR 4.0.3. Older versions support “CddComIfUpperLayerContribution” instead of
“CddSoAdUpperLayerContribution”.
2.2.3.2 API deviation
The API to upper layer modules is implemented according to AUTOSAR 4.1.3 and partly to
4.2.1.
Please refer to chapter 4 for details.
2.2.3.3 UDP socket ressources bound at startup
If a UDP socket connection remote address contains wildcards, socket connection can be
opened on reception according to [1]. To support this feature corresponding socket
connection must bind a TcpIp socket at ECU startup (i.e. first MainFunction cycle).
2.2.3.4 SoAd_SetUniqueRemoteAddress() disables alive supervision timeout
If SoAd_SetUniqueRemoteAddress() is called for a UDP socket connection group and
a corresponding socket connection in state online is found, alive supervision timeout will be
disabled for this socket connection.
2.2.3.5 SoAd_CloseSoCon() if open/close counter is 0
If SoAd_CloseSoCon() is called with parameter abort set to TRUE and open/close
counter is 0, caused by socket connection open in reception of data, the corresponding
socket connection will be closed anyway. If parameter abort is set to FALSE, socket
connection is not closed.
This behavior was implemented to close socket connections by user in all cases and to
prevent always open socket connections that blocks communication with other remote
entities.
2.3 Initialization
The Socket Adaptor is initialized via a SoAd_InitMemory() call followed by call of
SoAd_PreInit(). Afterwards, SoAd_Init() must be called on each partition the Socket
Adaptor is used on and initialization is finished by a call of SoAd_PostInit(). SoAd must
not be initialized during runtime. The initialization is only allowed in uninit und shutdown
state.
Example
SoAd_PreInit(SoAd_Config_Ptr);
SoAd_Init(SoAd_Config_Ptr);
SoAd_PostInit();
2.4 States
The Socket Adaptor has an extended state handling after calling the initialization functions
(described in chapter before). Figure 2-1 shows the states of Socket Adaptor when using
the
stm shutdown feature described in 5.2.4.6.
Shutdown
Initial
SoAd_InitMemory()
SOAD_STATE_UNINIT SOAD_STATE_SHUTDOWN
SoAd_PreInit()
SoAd_PreInit()
SOAD_STATE_PREINIT
SoAdShutdownFinishedWaitTime, Shutdown finished
SoAd_Init()
SoAd_PostInit()
Service ID Service
0x0B SOAD_SID_RLS_IP_ADDR_ASSIGN
0x0C SOAD_SID_GET_LOCAL_ADDR
0x0D SOAD_SID_GET_PHYS_ADDR
0x0E SOAD_SID_ENABLE_ROUTING
0x0F SOAD_SID_DISABLE_ROUTING
0x10 SOAD_SID_SET_REMOTE_ADDR
0x11 SOAD_SID_TP_CHANGE_PARAMETER
0x12 SOAD_SID_RX_INDICATION
0x13 SOAD_SID_COPY_TX_DATA
0x14 SOAD_SID_TX_CONFIRMATION
0x15 SOAD_SID_TCP_ACCEPTED
0x16 SOAD_SID_TCP_CONNECTED
0x17 SOAD_SID_TCPIP_EVENT
0x18 SOAD_SID_LOCAL_IP_ADDR_ASSIGNMENT_CHG
0x19 SOAD_SID_MAIN_FUNCTION
0x1A SOAD_SID_READ_DHCP_HOST_NAME_OPT
0x1B SOAD_SID_WRITE_DHCP_HOST_NAME_OPT
0x1C SOAD_SID_GET_REMOTE_ADDR
0x1D SOAD_SID_IF_ROUT_GROUP_TRANSMIT
0x1E SOAD_SID_SET_UNI_REMOTE_ADDR
0x1F SOAD_SID_IF_SPEC_ROUT_GROUP_TRANSMIT
0x20 SOAD_SID_ENABLE_SPECIFIC_ROUTING
0x21 SOAD_SID_DISABLE_SPECIFIC_ROUTING
0x23 SOAD_SID_RELEASE_REMOTE_ADDR
0x45 SOAD_SID_GET_RESET_MEASURE_DATA
0xD0 SOAD_SID_MAIN_FUNCTION_RX
0xD1 SOAD_SID_MAIN_FUNCTION_STATE
0xD2 SOAD_SID_MAIN_FUNCTION_TX
0xD3 SOAD_SID_SHUTDOWN
0xD4 SOAD_SID_GET_RCV_REMOTE_ADDR
0xD5 SOAD_SID_GET_REMOTE_ADDR_STATE
0xD6 SOAD_SID_READ_DHCP_OPT
0xD7 SOAD_SID_WRITE_DHCP_OPT
Service ID Service
0xD8 SOAD_SID_DHCP_EVENT
0xD9 SOAD_SID_FORCE_RELEASE_REMOTE_ADDR
0xDA SOAD_SID_PRE_INIT
0xDB SOAD_SID_POST_INIT
Table 2-4 Service IDs
3 Integration
This chapter gives necessary information for the integration of the MICROSAR Classic
Socket Adaptor into an application environment of an ECU.
Caution
Consider main function expectations when using preemptive tasks.
Additionally, please consider the usage of critical sections as described in chapter 3.2
The user must ensure that partitions cannot write into each other’s memory (RO: Read only
access). For partition-unspecific use-cases (e.g. measurement data), shared memory
sections must be accessible (RW: read and write access) by all involved partitions. Table
3-2 gives an overview on the expected read and write accesses.
SOAD_OsApplicationX_<SectionType> RW RO
SOAD_OsApplicationY_<SectionType> RO RW
SOAD_<SectionType> RW RW
Table 3-2 Memory Mapping in multi-partition use case
For the mapping of the partition-specific memory sections partition-specific software address
methods (SwAddrMethods) are used. Refer to [8] for further details on SwAddrMethods. For
the partition-specific SwAddrMethods the mapping is done automatically by the OS.
3.5 Multi-partition
When Socket Adaptor is configured in a multi-partition environment (refer to 5.2.4.17)
freedom from interference (FFI) regarding memory cannot be guaranteed.
4 API Description
4.2.1 SoAd_InitMemory
Prototype
void SoAd_InitMemory (void)
Parameter
void none
Return code
void none
Functional Description
Initializes *_CLEARED_*-variables.
Service to initialize module global variables at power up. This function initializes the variables in
*_CLEARED_* sections. Used in case they are not initialized by the startup code.
Particularities and Limitations
Module is uninitialized.
Call context
> TASK
> This function is Synchronous
> This function is Non-Reentrant
Table 4-2 SoAd_InitMemory
4.2.2 SoAd_PreInit
Prototype
void SoAd_PreInit (const SoAd_ConfigType *SoAdConfigPtr)
Parameter
SoAdConfigPtr [in] Configuration structure for initializing the module.
Return code
void none
Functional Description
Pre-Initializes module.
This function initializes the shared memory of SoAd module and sets the module to the pre-initialized state.
Particularities and Limitations
> Interrupts are disabled. SoAd_InitMemory has been called unless the *_CLEARED_*-variables are
initialized by start-up code.
Call context
> TASK
> This function is Synchronous
> This function is Non-Reentrant
> SoAd must not be initialized during runtime. The initialization is only allowed in uninit und shutdown
state.
Table 4-3 SoAd_PreInit
4.2.3 SoAd_Init
Prototype
void SoAd_Init (const SoAd_ConfigType *SoAdConfigPtr)
Parameter
SoAdConfigPtr [in] Configuration structure for initializing the module. This parameter is not used
since it is already provided in context of SoAd_PreInit().
Return code
void none
Functional Description
Initializes module.
This function initializes the partition-specific memory of SoAd module of the application context this function
is called in and sets the partition-specific initialized state.
Particularities and Limitations
> Interrupts are disabled. SoAd_PreInit() has been called.
Call context
> TASK
> This function is Synchronous
> This function is Non-Reentrant
> SoAd must not be initialized during runtime. The initialization is only allowed in uninit und shutdown
state. In multi-partition use-case: This function has to be called once in each partition context.
Table 4-4 SoAd_Init
4.2.4 SoAd_PostInit
Prototype
void SoAd_PostInit (void)
Parameter
void none
Return code
void none
Functional Description
Post-Initializes module.
This function checks the initialization state of all partitions and sets the global initialized state.
Particularities and Limitations
> SoAd_Init() has been called on each partition.
Call context
> TASK
> This function is Synchronous
> This function is Non-Reentrant
> SoAd must not be initialized during runtime. The initialization is only allowed in uninit und shutdown
state. This function must be called only once and it must be called on the main partition in case of multi-
partition.
Table 4-5 SoAd_PostInit
4.2.5 SoAd_IfTransmit
Prototype
Std_ReturnType SoAd_IfTransmit (PduIdType SoAdSrcPduId, const PduInfoType
*SoAdSrcPduInfoPtr)
Parameter
SoAdSrcPduId [in] Tx PDU identifier.
SoAdSrcPduInfoPtr [in] Pointer to PDU.
Return code
Std_ReturnType E_OK Transmit request was accepted.
Std_ReturnType E_NOT_OK Transmit request was not accepted.
Functional Description
Transmits an IF-PDU.
-
Particularities and Limitations
-
Call context
> TASK|ISR2
> This function is Synchronous
> This function is Reentrant for different PDUs and Non-Reentrant for the same PDU.
Table 4-6 SoAd_IfTransmit
4.2.6 SoAd_IfRoutingGroupTransmit
Prototype
Std_ReturnType SoAd_IfRoutingGroupTransmit (SoAd_RoutingGroupIdType id)
Parameter
id [in] Routing group identifier.
Return code
Std_ReturnType E_OK Transmit request was accepted.
Std_ReturnType E_NOT_OK Transmit request was not accepted.
Functional Description
Triggers transmission of all IF-PDUs related to a routing group.
Triggers transmission via trigger transmit in main function context.
4.2.7 SoAd_IfSpecificRoutingGroupTransmit
Prototype
Std_ReturnType SoAd_IfSpecificRoutingGroupTransmit (SoAd_RoutingGroupIdType id,
SoAd_SoConIdType SoConId)
Parameter
id [in] Routing group identifier.
SoConId [in] Socket connection identifier.
Return code
Std_ReturnType E_OK Transmit request was accepted.
Std_ReturnType E_NOT_OK Transmit request was not accepted.
Functional Description
Triggers transmission of all IF-PDUs related to a routing group and socket connection.
Triggers transmission via trigger transmit in main function context.
Particularities and Limitations
-
Call context
> TASK|ISR2
> This function is Reentrant
Table 4-8 SoAd_IfSpecificRoutingGroupTransmit
4.2.8 SoAd_TpTransmit
Prototype
Std_ReturnType SoAd_TpTransmit (PduIdType SoAdSrcPduId, const PduInfoType
*SoAdSrcPduInfoPtr)
Parameter
SoAdSrcPduId [in] Tx PDU identifier.
SoAdSrcPduInfoPtr [in] Pointer to PDU (length is evaluated only).
Return code
Std_ReturnType E_OK Transmit request was accepted.
4.2.9 SoAd_Shutdown
Prototype
Std_ReturnType SoAd_Shutdown (void)
Parameter
void none
Return code
Std_ReturnType E_OK Shutdown request was accepted.
SOAD_E_INPROGRESS Shutdown is in progress.
E_NOT_OK Shutdown request was not accepted.
Functional Description
Shuts down SoAd module.
Closes all open socket connections and disables transmission and reception.
Particularities and Limitations
-
Call context
> TASK|ISR2
> This function is Non-Reentrant
Table 4-10 SoAd_Shutdown
4.2.10 SoAd_TpCancelTransmit
Prototype
Std_ReturnType SoAd_TpCancelTransmit (PduIdType PduId)
Parameter
PduId [in] Tx PDU identifier.
Return code
Std_ReturnType E_OK Transmit cancellation request was accepted.
Std_ReturnType E_NOT_OK Transmit cancellation request was not accepted.
Functional Description
Requests transmission cancellation of a specific TP-PDU.
-
Particularities and Limitations
Transmission of PDU is requested via SoAd_TpTransmit.
Call context
> TASK|ISR2
> This function is Reentrant
Table 4-11 SoAd_TpCancelTransmit
4.2.11 SoAd_TpCancelReceive
Prototype
Std_ReturnType SoAd_TpCancelReceive (PduIdType PduId)
Parameter
PduId [in] Rx PDU identifier.
Return code
Std_ReturnType E_OK Receive cancellation request was accepted.
Std_ReturnType E_NOT_OK Receive cancellation request was not accepted.
Functional Description
Requests reception cancellation of a specific TP-PDU.
-
Particularities and Limitations
Reception of PDU is initiated via <Up>_[SoAd][Tp]StartOfReception.
Call context
> TASK|ISR2
> This function is Reentrant
Table 4-12 SoAd_TpCancelReceive
4.2.12 SoAd_GetSoConId
Prototype
Std_ReturnType SoAd_GetSoConId (PduIdType TxPduId, SoAd_SoConIdType
*SoConIdPtr)
Parameter
TxPduId [in] Tx PDU identifier.
SoConIdPtr [out] Pointer to the socket connection identifier.
Return code
Std_ReturnType E_OK Socket connection identifier was found.
Std_ReturnType E_NOT_OK Socket connection identifier was not found.
Functional Description
Returns the socket connection identifier of a specific Tx PDU identifier.
-
Particularities and Limitations
-
Call context
> TASK|ISR2
> This function is Synchronous
> This function is Reentrant
Table 4-13 SoAd_GetSoConId
4.2.13 SoAd_OpenSoCon
Prototype
Std_ReturnType SoAd_OpenSoCon (SoAd_SoConIdType SoConId)
Parameter
SoConId [in] Socket connection identifier.
Return code
Std_ReturnType E_OK Open request was accepted.
Std_ReturnType E_NOT_OK Open request was not accepted.
Functional Description
Opens a socket connection.
Opens the socket connection in context of main function.
Particularities and Limitations
-
Call context
> TASK|ISR2
> This function is Reentrant
> The sum of the users must not call SoAd_OpenSoCon() more than 4294967295 ((2^32) - 1) times for a
specific socket connection without calling SoAd_CloseSoCon().
Table 4-14 SoAd_OpenSoCon
4.2.14 SoAd_CloseSoCon
Prototype
Std_ReturnType SoAd_CloseSoCon (SoAd_SoConIdType SoConId, boolean Abort)
Parameter
SoConId [in] Socket connection identifier.
Abort [in] Flag to close socket connection immediately. [range: TRUE close immediately,
FALSE close when open close sequence is 0]
Return code
Std_ReturnType E_OK Close request was accepted.
Std_ReturnType E_NOT_OK Close request was not accepted.
Functional Description
Closes a socket connection.
Closes the socket connection in context of main function.
Particularities and Limitations
-
Call context
> TASK|ISR2
> This function is Reentrant
Table 4-15 SoAd_CloseSoCon
4.2.15 SoAd_RequestIpAddrAssignment
Prototype
Std_ReturnType SoAd_RequestIpAddrAssignment (SoAd_SoConIdType SoConId,
SoAd_IpAddrAssignmentType Type, SoAd_SockAddrType *LocalIpAddrPtr, uint8
Netmask, SoAd_SockAddrType *DefaultRouterPtr)
Parameter
SoConId [in] Socket connection identifier.
Type [in] IP address type. [range in case of SOAD_SOCKET_API !=
SOAD_SOCKET_API_AUTOSAR: SOAD_IPADDR_ASSIGNMENT_STATIC ..
SOAD_IPADDR_ASSIGNMENT_IPV6_ROUTER]
LocalIpAddrPtr [in] Pointer to IP address which shall be assigned. [Points to one of the following
structs depending on value of struct element domain:
- SoAd_SockAddrInetType for IPv4
- SoAd_SockAddrInet6Type for IPv6]
Netmask [in] Netmask in CIDR.
DefaultRouterPtr [in] Pointer to default router (gateway) address.
[Type == SOAD_IPADDR_ASSIGNMENT_STATIC:
4.2.16 SoAd_ReleaseIpAddrAssignment
Prototype
Std_ReturnType SoAd_ReleaseIpAddrAssignment (SoAd_SoConIdType SoConId)
Parameter
SoConId [in] Socket connection identifier.
Return code
Std_ReturnType E_OK Release request was accepted.
Std_ReturnType E_NOT_OK Release request was not accepted.
Functional Description
Releases IP address assignment on a local address identified by a socket connection.
-
Particularities and Limitations
-
Call context
> TASK|ISR2
> This function is Synchronous
> This function is Reentrant for different local IP addresses and Non-Reentrant for the same local IP
address.
4.2.17 SoAd_GetLocalAddr
Prototype
Std_ReturnType SoAd_GetLocalAddr (SoAd_SoConIdType SoConId, SoAd_SockAddrType
*LocalAddrPtr, uint8 *NetmaskPtr, SoAd_SockAddrType *DefaultRouterPtr)
Parameter
SoConId [in] Socket connection identifier.
LocalAddrPtr [out] Pointer to local address (IP and Port). [Points to one of the following structs
depending on value of struct element domain:
- SoAd_SockAddrInetType for IPv4
- SoAd_SockAddrInet6Type for IPv6]
NetmaskPtr [out] Pointer to network mask (CIDR Notation).
DefaultRouterPtr [out] Pointer to default router (gateway). [Points to one of the following structs
depending on configured IP address version of parameter SoConId:
- SoAd_SockAddrInetType for IPv4
- SoAd_SockAddrInet6Type for IPv6]
Return code
Std_ReturnType E_OK Request was accepted.
Std_ReturnType E_NOT_OK Request was not accepted.
Functional Description
Returns a local IP address identified by a socket connection.
-
Particularities and Limitations
-
Call context
> TASK|ISR2
> This function is Synchronous
> This function is Reentrant
Table 4-18 SoAd_GetLocalAddr
4.2.18 SoAd_GetPhysAddr
Prototype
Std_ReturnType SoAd_GetPhysAddr (SoAd_SoConIdType SoConId, uint8 *PhysAddrPtr)
Parameter
SoConId [in] Socket connection identifier.
PhysAddrPtr [out] Pointer to physical address. [Points to a uint8 array of length 6]
Return code
Std_ReturnType E_OK Request was accepted.
Std_ReturnType E_NOT_OK Request was not accepted.
Functional Description
Returns the physical address (MAC address) of a local interface identified by a socket connection.
-
Particularities and Limitations
-
Call context
> TASK|ISR2
> This function is Synchronous
> This function is Reentrant
Table 4-19 SoAd_GetPhysAddr
4.2.19 SoAd_GetRemoteAddr
Prototype
Std_ReturnType SoAd_GetRemoteAddr (SoAd_SoConIdType SoConId, SoAd_SockAddrType
*IpAddrPtr)
Parameter
SoConId [in] Socket connection identifier.
IpAddrPtr [out] Pointer to remote address. [Points to one of the following structs depending on
configured IP address version of parameter SoConId:
- SoAd_SockAddrInetType for IPv4
- SoAd_SockAddrInet6Type for IPv6]
Return code
Std_ReturnType E_OK Request was accepted.
Std_ReturnType E_NOT_OK Request was not accepted.
Functional Description
Returns the remote address of a socket connection.
-
Particularities and Limitations
-
Call context
> TASK|ISR2
> This function is Synchronous
> This function is Reentrant
Table 4-20 SoAd_GetRemoteAddr
4.2.20 SoAd_GetRemoteAddrState
Prototype
Std_ReturnType SoAd_GetRemoteAddrState (SoAd_SoConIdType SoConId,
SoAd_SockAddrType *IpAddrPtr, SoAd_RemAddrStateType *RemAddrState)
Parameter
SoConId [in] Socket connection identifier.
IpAddrPtr [out] Pointer to remote address. [Points to one of the following structs depending on
configured IP address version of parameter SoConId:
- SoAd_SockAddrInetType for IPv4
- SoAd_SockAddrInet6Type for IPv6]
RemAddrState [out] Pointer to remote address state.
Return code
Std_ReturnType E_OK Request was accepted.
Std_ReturnType E_NOT_OK Request was not accepted.
Functional Description
Returns the remote address and remote address state of a socket connection.
-
Particularities and Limitations
-
Call context
> TASK|ISR2
> This function is Synchronous
> This function is Reentrant
Table 4-21 SoAd_GetRemoteAddrState
4.2.21 SoAd_GetRcvRemoteAddr
Prototype
Std_ReturnType SoAd_GetRcvRemoteAddr (SoAd_SoConIdType SoConId,
SoAd_SockAddrType *IpAddrPtr)
Parameter
SoConId [in] Socket connection identifier.
IpAddrPtr [out] Pointer to remote address. [Points to one of the following structs depending on
configured IP address version of parameter SoConId:
- SoAd_SockAddrInetType for IPv4
- SoAd_SockAddrInet6Type for IPv6]
Return code
Std_ReturnType E_OK Request was accepted.
4.2.22 SoAd_EnableRouting
Prototype
Std_ReturnType SoAd_EnableRouting (SoAd_RoutingGroupIdType id)
Parameter
id [in] Routing group identifier.
Return code
Std_ReturnType E_OK Request was accepted.
Std_ReturnType E_NOT_OK Request was not accepted.
Functional Description
Enables a routing group.
-
Particularities and Limitations
-
Call context
> TASK|ISR2
> This function is Synchronous
> This function is Reentrant
Table 4-23 SoAd_EnableRouting
4.2.23 SoAd_EnableSpecificRouting
Prototype
Std_ReturnType SoAd_EnableSpecificRouting (SoAd_RoutingGroupIdType id,
SoAd_SoConIdType SoConId)
Parameter
id [in] Routing group identifier.
SoConId [in] Socket connection identifier.
Return code
Std_ReturnType E_OK Request was accepted.
Std_ReturnType E_NOT_OK Request was not accepted.
Functional Description
Enables a routing group on a specific socket connection.
-
Particularities and Limitations
-
Call context
> TASK|ISR2
> This function is Synchronous
> This function is Reentrant
Table 4-24 SoAd_EnableSpecificRouting
4.2.24 SoAd_DisableRouting
Prototype
Std_ReturnType SoAd_DisableRouting (SoAd_RoutingGroupIdType id)
Parameter
id [in] Routing group identifier.
Return code
Std_ReturnType E_OK Request was accepted.
Std_ReturnType E_NOT_OK Request was not accepted.
Functional Description
Disables a routing group.
-
Particularities and Limitations
-
Call context
> TASK|ISR2
> This function is Synchronous
> This function is Reentrant
Table 4-25 SoAd_DisableRouting
4.2.25 SoAd_DisableSpecificRouting
Prototype
Std_ReturnType SoAd_DisableSpecificRouting (SoAd_RoutingGroupIdType id,
SoAd_SoConIdType SoConId)
Parameter
id [in] Routing group identifier.
SoConId [in] Socket connection identifier.
Return code
Std_ReturnType E_OK Request was accepted.
Std_ReturnType E_NOT_OK Request was not accepted.
Functional Description
Disables a routing group on a specific socket connection.
-
Particularities and Limitations
-
Call context
> TASK|ISR2
> This function is Synchronous
> This function is Reentrant
Table 4-26 SoAd_DisableSpecificRouting
4.2.26 SoAd_SetRemoteAddr
Prototype
Std_ReturnType SoAd_SetRemoteAddr (SoAd_SoConIdType SoConId, SoAd_SockAddrType
*RemoteAddrPtr)
Parameter
SoConId [in] Socket connection identifier.
RemoteAddrPtr [in] Pointer to remote address. [Points to one of the following structs depending on
configured IP address version of parameter SoConId:
- SoAd_SockAddrInetType for IPv4
- SoAd_SockAddrInet6Type for IPv6]
Return code
Std_ReturnType E_OK Request was accepted.
Std_ReturnType E_NOT_OK Request was not accepted.
Functional Description
Sets the remote address of a socket connection.
-
4.2.27 SoAd_SetUniqueRemoteAddr
Prototype
Std_ReturnType SoAd_SetUniqueRemoteAddr (SoAd_SoConIdType SoConId, const
SoAd_SockAddrType *RemoteAddrPtr, SoAd_SoConIdType *AssignedSoConIdPtr)
Parameter
SoConId [in] Socket connection identifier (any socket connection in socket connection
group).
RemoteAddrPtr [in] Pointer to remote address. [Points to one of the following structs depending on
configured IP address version of parameter SoConId:
- SoAd_SockAddrInetType for IPv4
- SoAd_SockAddrInet6Type for IPv6]
AssignedSoConIdPtr [out] Pointer to assigned socket connection identifier.
Return code
Std_ReturnType E_OK Request was accepted.
Std_ReturnType E_NOT_OK Request was not accepted.
Functional Description
Sets the remote address of a suitable socket connection in a socket connection group.
Considers the best match algorithm to select the socket connection.
Particularities and Limitations
-
Call context
> TASK|ISR2
> This function is Synchronous
> This function is Reentrant for different socket connection identifiers and Non-Reentrant for the same
socket connection identifier.
Table 4-28 SoAd_SetUniqueRemoteAddr
4.2.28 SoAd_ReleaseRemoteAddr
Prototype
Std_ReturnType SoAd_ReleaseRemoteAddr (SoAd_SoConIdType SoConId)
Parameter
SoConId [in] Socket connection identifier.
Return code
void none
Functional Description
Releases the remote address (IP address and port) of the specified socket connection by setting it back to
the configured remote address setting.
Releases the remote address of a socket connection if it is not locked due to pending
transmissions/receptions or an established TCP connection. In case of a locked connection the request is
stored to process it later in main function context. Due to a high load of transmissions and reception of
messages it may happen that a release of the remote address is not possible.
Particularities and Limitations
-
Call context
> TASK|ISR2
> This function is Synchronous
> This function is Reentrant for different socket connection identifiers and Non-Reentrant for the same
socket connection identifier.
Table 4-29 SoAd_ReleaseRemoteAddr
4.2.29 SoAd_ForceReleaseRemoteAddr
Prototype
Std_ReturnType SoAd_ForceReleaseRemoteAddr (SoAd_SoConIdType SoConId)
Parameter
SoConId [in] Socket connection identifier.
Return code
void none
Functional Description
Forces the release of the remote address (IP address and port) of the specified socket connection by
setting it back to the configured remote address setting.
Releases the remote address of a socket connection if it is not locked due to pending
transmissions/receptions. If the connection is locked due to an open TCP connection, the remote address is
released by forcing the socket connection to close. Additionally, new transmissions/receptions are rejected.
Particularities and Limitations
-
Call context
> TASK|ISR2
4.2.30 SoAd_ReadDhcpHostNameOption
Prototype
Std_ReturnType SoAd_ReadDhcpHostNameOption (SoAd_SoConIdType SoConId, uint8
*length, uint8 *data)
Parameter
SoConId [in] Socket connection identifier.
length [in,out] Length of buffer for hostname (length of provided buffer, updated to length of
hostname).
data [out] Pointer to buffer for hostname.
Return code
Std_ReturnType E_OK Request was accepted.
Std_ReturnType E_NOT_OK Request was not accepted.
Functional Description
Returns the DHCP hostname option currently configured on a local interface identified by a socket
connection.
-
Particularities and Limitations
-
Call context
> TASK|ISR2
> This function is Synchronous
> This function is Reentrant
Table 4-31 SoAd_ReadDhcpHostNameOption
4.2.31 SoAd_WriteDhcpHostNameOption
Prototype
Std_ReturnType SoAd_WriteDhcpHostNameOption (SoAd_SoConIdType SoConId, uint8
length, const uint8 *data)
Parameter
SoConId [in] Socket connection identifier.
length [in] Length of buffer for hostname.
data [in] Pointer to buffer for hostname.
Return code
Std_ReturnType E_OK Request was accepted.
Std_ReturnType E_NOT_OK Request was not accepted.
Functional Description
Sets the DHCP hostname option on a local interface identified by a socket connection.
-
Particularities and Limitations
-
Call context
> TASK|ISR2
> This function is Synchronous
> This function is Reentrant
Table 4-32 SoAd_WriteDhcpHostNameOption
4.2.32 SoAd_ReadDhcpOption
Prototype
Std_ReturnType SoAd_ReadDhcpOption (SoAd_LocalAddrIdType IpAddrId, uint16
Option, uint16 *DataLengthPtr, uint8 *DataPtr)
Parameter
IpAddrId [in] IP address identifier.
Option [in] DHCP option code.
DataLengthPtr [in,out] Pointer to length of option buffer (updated to length of option on return).
DataPtr [out] Pointer to option buffer.
Return code
Std_ReturnType E_OK Request was accepted.
Std_ReturnType E_NOT_OK Request was not accepted.
Functional Description
Returns a DHCP option on a local address.
-
Particularities and Limitations
-
Call context
> TASK|ISR2
> This function is Synchronous
> This function is Reentrant
Table 4-33 SoAd_ReadDhcpOption
4.2.33 SoAd_WriteDhcpOption
Prototype
Std_ReturnType SoAd_WriteDhcpOption (SoAd_LocalAddrIdType IpAddrId, uint16
Option, uint16 DataLength, const uint8 *DataPtr)
Parameter
IpAddrId [in] IP address identifier.
Option [in] DHCP option code.
DataLength [in] Length of option buffer.
DataPtr [in] Pointer to option buffer.
Return code
Std_ReturnType E_OK Request was accepted.
Std_ReturnType E_NOT_OK Request was not accepted.
Functional Description
Sets a DHCP option on a local address.
-
Particularities and Limitations
-
Call context
> TASK|ISR2
> This function is Synchronous
> This function is Reentrant
Table 4-34 SoAd_WriteDhcpOption
4.2.34 SoAd_GetVersionInfo
Prototype
void SoAd_GetVersionInfo (Std_VersionInfoType *versioninfo)
Parameter
versioninfo [out] Pointer to where to store the version information. Parameter must not be
NULL.
Return code
void none
Functional Description
Returns the version information.
Returns version information, vendor ID and AUTOSAR module ID of the component.
Particularities and Limitations
-
4.2.35 SoAd_GetAndResetMeasurementData
Prototype
void SoAd_GetAndResetMeasurementData (SoAd_MeasurementIdxType MeasurementIdx,
boolean MeasurementResetNeeded, uint32 *MeasurementDataPtr)
Parameter
MeasurementIdx [in] The index to select specific measurement data.
[range: SOAD_MEAS_DROP_TCP, SOAD_MEAS_DROP_UDP,
SOAD_MEAS_DROP_TCP_CONNECTION,
SOAD_MEAS_DROP_UDP_SOCKET,
SOAD_MEAS_DROP_UDP_LENGTH,
SOAD_MEAS_INVALID_SOME_IP_SERVICE_ID,
SOAD_MEAS_INVALID_SOME_IP_METHOD_ID,
SOAD_MEAS_INVALID_SOME_IP_SD_SERVICE_ID,
SOAD_MEAS_INVALID_SOME_IP_SD_METHOD_ID,
SOAD_MEAS_ALL]
MeasurementResetNeeded [in] Flag to indicate if the counter needs to be reset.
[range: TRUE, FALSE]
MeasurementDataPtr [out] Buffer where the value of the counter is to be copied into.
[range: POINTER may be NULL_PTR]
Return code
Std_ReturnType E_OK The operations were successful.
Std_ReturnType E_NOT_OK The operations failed.
Functional Description
Gets and Resets (if requested) the measurement data.
Gets and Resets (if requested) the value of the counter of dropped TCP/UDP packets, dropped TCP
connections, dropped UDP frames (wrong socket/length), invalid SOME/IP service identifiers, invalid
SOME/IP method identifiers, invalid SOME/IP SD service identifiers and invalid SOME/IP SD method
identifiers. The returned value contains the measurement data of all configured Socket Adaptor instances.
Particularities and Limitations
-
Configuration Variant(s): SOAD_GET_RESET_MEASUREMENT_DATA_API
Call context
> TASK|ISR2
> This function is Synchronous
> This function is Reentrant for different measurement indexes and Non-Reentrant for the same
measurement index.
Table 4-36 SoAd_GetAndResetMeasurementData
4.2.36 SoAd_MainFunctionRx
Prototype
void SoAd_MainFunctionRx (void)
Parameter
void none
Return code
void none
Functional Description
Schedules the Socket Adaptor (Entry point for scheduling) and handles asynchronous reception.
Particularities and Limitations
In case that several SoAd instances exist, the SoAd_MainFunctionRx() exists per instance. As naming
convention, the API name is in this case appended by the name of the instance:
SoAd_MainFunctionRx_<InstanceName>().
Call context
> TASK
> This function is Synchronous
> This function is Non-Reentrant
Table 4-37 SoAd_MainFunctionRx
4.2.37 SoAd_MainFunctionState
Prototype
void SoAd_MainFunctionState (void)
Parameter
void none
Return code
void none
Functional Description
Schedules the Socket Adaptor (Entry point for scheduling) and handles states.
Particularities and Limitations
In case that several SoAd instances exist, the SoAd_MainFunctionState() exists per instance. As
naming convention, the API name is in this case appended by the name of the instance:
SoAd_MainFunctionState_<InstanceName>().
Call context
> TASK
> This function is Synchronous
4.2.38 SoAd_MainFunctionTx
Prototype
void SoAd_MainFunctionTx (void)
Parameter
void none
Return code
void none
Functional Description
Schedules the Socket Adaptor (Entry point for scheduling) and handles asynchronous transmission.
Particularities and Limitations
In case that several SoAd instances exist, the SoAd_MainFunctionTx() exists per instance. As naming
convention, the API name is in this case appended by the name of the instance:
SoAd_MainFunctionTx_<InstanceName>().
Call context
> TASK
> This function is Synchronous
> This function is Non-Reentrant
Table 4-39 SoAd_MainFunctionTx
4.2.39 SoAd_MainFunction
Prototype
void SoAd_MainFunction (void)
Parameter
void none
Return code
void none
Functional Description
Schedules the Socket Adaptor (Entry point for scheduling) and handles asynchronous reception and
transmission and states.
Particularities and Limitations
In case that several SoAd instances exist, the SoAd_MainFunction() exists per instance. As naming
convention, the API name is in this case appended by the name of the instance:
SoAd_MainFunction_<InstanceName>().
Call context
> TASK
> This function is Synchronous
Component API
Bmc Bmc_Store_u32
Bmc Bmc_FetchAdd_u32
Bmc Bmc_FetchSub_u32
IdsM IdsM_SetSecurityEvent
Table 4-41 Services used by the Socket Adaptor
4.4.2 SoAd_CopyTxData
Prototype
BufReq_ReturnType SoAd_CopyTxData (SoAd_SocketIdType SocketId, uint8 *BufPtr,
uint16 *BufLengthPtr)
Parameter
SocketId [in] Socket identifier.
BufPtr [in] Pointer to buffer of provided transmission buffer.
BufLength|BufLengthPtr Pointer to length of provided transmission buffer.
[in,out]
Return code
BufReq_ReturnType BUFREQ_OK Copy request accepted.
BufReq_ReturnType BUFREQ_E_NOT_OK Copy request not accepted.
Functional Description
Copies data to provided transmission buffer.
Uses "BufLengthPtr" to update length if less data is copied to provided buffer.
Particularities and Limitations
-
Call context
> TASK|ISR2
> This function is Synchronous
> This function is Reentrant for different socket identifiers and Non-Reentrant for the same socket
identifier.
Table 4-43 SoAd_CopyTxData
4.4.3 SoAd_TxConfirmation
Prototype
void SoAd_TxConfirmation (SoAd_SocketIdType SocketId, uint16 Length)
Parameter
SocketId [in] Socket identifier.
Length [in] Length of confirmed data.
Return code
void none
Functional Description
Confirms transmission of data.
-
Particularities and Limitations
-
Call context
> TASK|ISR2
> This function is Synchronous
> This function is Reentrant for different socket identifiers and Non-Reentrant for the same socket
identifier.
Table 4-44 SoAd_TxConfirmation
4.4.4 SoAd_LocalIpAddrAssignmentChg
Prototype
void SoAd_LocalIpAddrAssignmentChg (SoAd_LocalAddrIdType IpAddrId,
SoAd_IpAddrStateType State)
Parameter
IpAddrId [in] IP address identifier.
State [in] State of IP address assignment.
Return code
void none
Functional Description
Receives local IP address assignment state changes.
-
Particularities and Limitations
-
Call context
> TASK|ISR2
> This function is Synchronous
> This function is Reentrant for different IP address identifiers and Non-Reentrant for the same IP address
identifier.
Table 4-45 SoAd_LocalIpAddrAssignmentChg
4.4.5 SoAd_TcpAccepted
Prototype
Std_ReturnType SoAd_TcpAccepted (SoAd_SocketIdType SocketId, SoAd_SocketIdType
SocketIdConnected, SoAd_SockAddrType *RemoteAddrPtr)
Parameter
SocketId [in] Listen socket identifier.
SocketIdConnected [in] Connected socket identifier.
RemoteAddrPtr [in] Pointer to remote addres. [Points to one of the following structs depending on
value of struct element domain:
- SoAd_SockAddrInetType for IPv4
4.4.6 SoAd_TcpConnected
Prototype
void SoAd_TcpConnected (SoAd_SocketIdType SocketId)
Parameter
SocketId [in] Socket identifier.
Return code
void none
Functional Description
Handles TCP connections which have been initiated locally and are now successfully connected.
-
Particularities and Limitations
-
Call context
> TASK|ISR2
> This function is Synchronous
> This function is Reentrant for different socket identifiers and Non-Reentrant for the same socket
identifier.
Table 4-47 SoAd_TcpConnected
4.4.7 SoAd_TcpIpEvent
Prototype
void SoAd_TcpIpEvent (SoAd_SocketIdType SocketId, SoAd_EventType Event)
Parameter
SocketId [in] Socket identifier.
Event [in] Event type. [SOAD_TCP_RESET, SOAD_TCP_CLOSED,
SOAD_TCP_FIN_RECEIVED, SOAD_UDP_CLOSED,
SOAD_TLS_HANDSHAKE_SUCCEEDED]
Return code
void none
Functional Description
Handles events on sockets.
-
Particularities and Limitations
-
Call context
> TASK|ISR2
> This function is Synchronous
> This function is Reentrant for different socket identifiers and Non-Reentrant for the same socket
identifier.
Table 4-48 SoAd_TcpIpEvent
4.4.8 SoAd_DhcpEvent
Prototype
void SoAd_DhcpEvent (SoAd_LocalAddrIdType IpAddrId, SoAd_DhcpEventType Event)
Parameter
IpAddrId [in] IP address identifier.
Event [in] Event type. [!= SOAD_DHCP_EVENT_INVALID]
Return code
void none
Functional Description
Notifies user of a DHCP event.
-
Particularities and Limitations
-
Call context
> TASK|ISR2
> This function is Synchronous
4.5.1 <Up>_[SoAd][If]RxIndication
Prototype
void <Up>_[SoAd][If]RxIndication (PduIdType RxPduId, const PduInfoType*
PduInfoPtr)
Parameter
RxPduId [in] Rx PDU identifier
PduInfoPtr [in] Pointer to PDU
Return code
void none
Functional Description
Receives IF-PDU.
Particularities and Limitations
-
-
Call context
> TASK|ISR2
> This function is Synchronous
> This function is Reentrant
Table 4-50 <Up>_[SoAd][If]RxIndication
4.5.2 <Up>_[SoAd][If]TriggerTransmit
Prototype
Std_ReturnType <Up>_[SoAd][If]TriggerTransmit (PduIdType TxPduId, PduInfoType*
PduInfoPtr)
Parameter
TxPduId [in] Tx PDU identifier
PduInfoPtr [in/out] Pointer to PDU
Return code
Std_ReturnType E_OK Request was accepted.
Std_ReturnType E_NOT_OK Request was not accepted.
Functional Description
Copies data for a previously requested PDU via SoAd_IfTransmit if trigger transmit is used for the PDU.
Particularities and Limitations
-
Available for upper layer with IF-API and enabled ‘SoAdRoutingGroupTxTriggerable’ for at least one routing
group referenced in any ‘SoAdPduRoute’ or if ‘SoAdTxIfTriggerTransmit’ is enabled.
PduInfoPtr->SduLength is set to provided buffer size and upper layer has to consider this value before
copying to buffer.
Call context
> TASK|ISR2
> This function is Synchronous
> This function is Reentrant
Table 4-51 <Up>_[SoAd][If]TriggerTransmit
4.5.3 <Up>_[SoAd][If]TxConfirmation
Prototype
void <Up>_[SoAd][If]TxConfirmation (PduIdType TxPduId)
Parameter
TxPduId [in] Tx PDU identifier
Return code
void none
Functional Description
Confirms transmission of an IF-PDU.
Particularities and Limitations
-
Available for upper layer with IF-API and ‘SoAdIfTxConfirmation’ in ‘SoAdBswModules’ is enabled.
Call context
> TASK|ISR2
> This function is Synchronous
> This function is Reentrant
Table 4-52 <Up>_[SoAd][If]TxConfirmation
4.5.4 <Up>_[SoAd][Tp]StartOfReception
Prototype
BufReq_ReturnType <Up>_[SoAd][Tp]StartOfReception (PduIdType RxPduId,
PduInfoType* info, PduLengthType TpSduLength, PduLengthType* bufferSizePtr)
Parameter
RxPduId [in] Rx PDU identifier
info [in] No used [range: NULL_PTR]
TpSduLength [in] Total length of PDU to be received
bufferSizePtr [out] Available receive buffer
Return code
BufReq_ReturnType BUFREQ_OK Reception request was accepted.
BufReq_ReturnType BUFREQ_E_NOT_OK Reception request was not accepted.
Functional Description
Starts reception of a TP-PDU.
Particularities and Limitations
-
‘BUFREQ_E_OVFL’ as return value is treated like ‘BUFREQ_E_NOT_OK’.
Parameter ‘info’ can be configured to constant pointer by enabling
‘SoAdTpStartOfReceptionWithConstPointer’.
Call context
> TASK|ISR2
> This function is Reentrant
Table 4-53 <Up>_[SoAd][Tp]StartOfReception
4.5.5 <Up>_[SoAd][Tp]CopyRxData
Prototype
BufReq_ReturnType <Up>_[SoAd][Tp]CopyRxData (PduIdType RxPduId, const
PduInfoType* PduInfoPtr, PduLengthType* bufferSizePtr)
Parameter
RxPduId [in] Rx PDU identifier
PduInfoPtr [in] Pointer to PDU
bufferSizePtr [out] Available receive buffer
Return code
BufReq_ReturnType BUFREQ_OK Copy request was accepted.
BufReq_ReturnType BUFREQ_E_NOT_OK Copy request was not accepted.
Functional Description
Copies received data of a TP-PDU.
Particularities and Limitations
-
‘BUFREQ_E_OVFL’ as return value is treated like ‘BUFREQ_E_NOT_OK’.
Parameter ‘PduInfoPtr’ can be configured to constant pointer by enabling
‘SoAdTpCopyRxDataWithConstPointer’.
Call context
> TASK|ISR2
> This function is Reentrant
Table 4-54 <Up>_[SoAd][Tp]CopyRxData
4.5.6 <Up>_[SoAd][Tp]RxIndication
Prototype
void <Up>_[SoAd][Tp]RxIndication (PduIdType RxPduId, Std_ReturnType result)
Parameter
RxPduId [in] Rx PDU identifier
result [in] Reception result
Return code
void none
Functional Description
Indicates that a TP-PDU reception is finished.
Particularities and Limitations
-
-
Call context
> TASK|ISR2
> This function is Reentrant
Table 4-55 <Up>_[SoAd][Tp]RxIndication
4.5.7 <Up>_[SoAd][Tp]CopyTxData
Prototype
BufReq_ReturnType <Up>_[SoAd][Tp]CopyTxData (PduIdType TxPduId, const
PduInfoType* PduInfoPtr, RetryInfoType* retry, PduLengthType* availableDataPtr)
Parameter
TxPduId [in] Tx PDU identifier
4.5.8 <Up>_[SoAd][Tp]TxConfirmation
Prototype
void <Up>_[SoAd][Tp]TxConfirmation (PduIdType TxPduId, Std_ReturnType result)
Parameter
TxPduId [in] Tx PDU identifier
result [in] Transmission result
Return code
void none
Functional Description
Confirms transmission of a TP-PDU.
Particularities and Limitations
-
-
Call context
> TASK|ISR2
> This function is Reentrant
Table 4-57 <Up>_[SoAd][Tp]TxConfirmation
4.5.9 <Up>_SoConModeChg
Prototype
void <Up>_SoConModeChg (SoAd_SoConIdType SoConId, SoAd_SoConModeType Mode)
Parameter
SoConId [in] Socket connection identifier
Mode [in] New socket connection mode
Return code
void None
Functional Description
Notifies about a socket connection mode change
Particularities and Limitations
-
Available if ‘SoAdBswModules/SoAdSoConModeChg’ is enabled for an upper layer or if a
‘SoAdGeneral/SoAdAdditionalSoConModeChgCallback’ is configured.
Call context
> TASK|ISR2
> This function is Synchronous
> This function is Reentrant
Table 4-58 <Up>_SoConModeChg
4.5.10 <Up>_LocalIpAddrAssignmentChg
Prototype
void <Up>_LocalIpAddrAssignmentChg (SoAd_SoConIdType SoConId,
SoAd_IpAddrStateType State)
Parameter
SoConId [in] Socket connection identifier
State [in] New socket connection local IP address state
Return code
void None
Functional Description
Notifies about IP assignment state for a specific socket connection.
Particularities and Limitations
-
Available if ‘SoAdBswModules/SoAdLocalIpAddrAssigmentChg’ is enabled for an upper layer or if a
‘SoAdGeneral/SoAdAdditionalLocalIpAddrAssignmentChgCallback’ is configured.
Call context
> TASK|ISR2
> This function is Synchronous
4.5.11 <Up>_ShutdownFinished
Prototype
void <Up>_ShutdownFinished (void)
Parameter
void none
Return code
void None
Functional Description
Notifies about finished shutdown.
Particularities and Limitations
-
> Available if ‘SoAdBswModules/SoAdShutdownFinishedCbk’ is enabled for an upper layer.
Call context
> TASK|ISR2
> This function is Synchronous
> This function is Reentrant
Table 4-60 <Up>_ShutdownFinished
4.5.12 <Up_VerifyRxPdu>
Prototype
Std_ReturnType <Up_VerifyRxPdu> (const SoAd_SockAddrType * LocalAddrPtr, const
SoAd_SockAddrType * RemoteAddrPtr, SoAd_PduHdrIdType PduHdrId, const
PduInfoType * PduInfoPtr)
Parameter
LocalAddrPtr [in] Pointer to local socket address
RemoteAddrPtr [in] Pointer to remote socket address
PduHdrId [in] PDU Header ID
PduInfoPtr [in] Pointer to PDU data [range: NULL_PTR if SoAdVerifyRxPduMaxDataLength
== 0]
Return code
Std_ReturnType E_OK PDU reception verification succeeded
Std_ReturnType E_NOT_OK PDU reception verification failed
Functional Description
Verifies a PDU reception and indicates if a reception shall be continued or dropped.
Particularities and Limitations
-
Configurable in ‘SoAdVerifyRxPduCallback/SoAdVerifyRxPdu’
Call context
> TASK
> This function is Synchronous
> This function is Reentrant
Table 4-61 <Up_VerifyRxPdu>
4.5.13 <Up_DhcpEvent>
Prototype
void <Up_DhcpEvent> (SoAd_LocalAddrIdType IpAddrId, SoAd_DhcpEventType Event)
Parameter
IpAddrId [in] IP address identifier.
Event [in] Event type. [!= TCPIP_DHCP_EVENT_INVALID]
Return code
void none
Functional Description
Notifies user of a DHCP event.
-
Particularities and Limitations
-
Call context
> TASK|ISR2
> This function is Synchronous
> This function is Reentrant
Table 4-62 <Up_DhcpEvent>
5 Configuration
There is one configuration tool to configure and generate the Socket Adaptor:
> DaVinci Configurator Classic
In case of TCP and special cases of UDP buffers must be configured in the TcpIp module.
The tool provides solving actions to add and optimize buffers.
5.2.1.2 Socket Connection establishment
There are basically two different ways how to handle socket connections. Depending on the
use case following ways can be chosen:
> Manual
> Automatic
If an upper layer needs to control the socket connection state or remote address a manual
socket connection establishment is recommended (e.g. DoIP). In all other cases Socket
Adaptor can handle the socket connection on itself (e.g. PduR).
5.2.1.2.1 Manual
Manual socket connection establishment is enabled if the corresponding parameter is
disabled (Figure 5-3).
> SoAd_CloseSoCon()
> SoAd_SetRemoteAddr()
> SoAd_SetUniqueRemoteAddr()
These services can be used to open and close a socket connection or set the remote
address.
In case of UDP, the socket connection can be opened on reception if the message
acceptance filter is enabled in the socket connection group and the remote address contains
wildcards.
To set a port to wildcard, set port to 0. To configure an IP address to wildcard, empty the
remote IP address field. Vector supports a special value for a not set IP address or port
(Figure 5-4). If an IP address or port is not set, a socket connection is not considered in the
best match algorithm (i.e. socket connection won’t be opened on reception).
5.2.1.2.2 Automatic
Automatic socket connection establishment is enabled if the corresponding parameter is
enabled (Figure 5-3).
All services described in chapter 5.2.1.2.1 are not available and corresponding functions will
return E_NOT_OK on call.
A socket connection is automatically opened if the remote address is set in configuration or
on reception in case of UDP and the message acceptance filter is enabled in socket
connection group.
5.2.1.3 Checksum handling on UDP sockets
It is possible to enable or disable the checksum calculation on UDP sockets. Figure 5-5
shows the configuration parameters. SoAdSocketUdpChecksumChangeEnabled
specifies if the UDP checksum calculation setting shall be changed or not by calling
<TcpIp>_ChangeParameter() API when opening the socket.
SoAdSocketUdpChecksumEnabled represents the final setting of the UDP checksum
calculation which is only applied when SoAdSocketUdpChecksumChangeEnabled is
enabled. By default, the checksum calculation is enabled in TcpIp.
Please refer to [7] for further information on how packets are handled on reception and
transmission depending on the setting of this parameter.
Note
The checksum calculation is not configurable when
either Socket Adaptor is used together with vBsdAd module as lower layer,
or UDP frames are used via IPv6 (a checksum is mandatory in this case),
or checksum offloading is done in hardware.
It is required to disable SoAdSocketUdpChecksumChangeEnabled in those cases.
3. Add one or multiple (fan-out) PDU Route Destination (Figure 5-7) and reference the
socket connection created in 1
3. Add exactly one (fan-out not possible) Socket Route Destination and chose the upper
layer PDU(Figure 5-9)
According to [1] TxConfirmation for UDP socket connections with IF API is called within main
function. It may be possible that new data are received while sent data are not confirmed
yet. This may lead to incorrect behavior if upper layer is based on request and response
behavior. Immediate TxConfirmaion can prevent reception before confirmation.
This feature is implemented for one PduRoute/PduRouteDestination per socket connection
only.
5.2.4.3 SoAd_GetRcvRemoteAddr()
Via this API it is possible for the upper layer to retrieve the remote address of the last
received message on a socket connection. To enable this feature enable the parameter
marked in Figure 5-12.
Caution
If splitting is enabled SoAd_MainFunction() must not be called anymore.
Module Module
SoAd <Up>
<Up>_[SoAd][Tp]TxConfirmation(PduIdType, Std_ReturnType)
This feature can be enabled and disabled for each TP PduRoute separately (Figure 5-20).
Note
It is highly recommended to enable
SoAdSocketTcpImmediateTpTxConfirmation if feature is used on TCP
sockets since TP transmission is finished on reception of the TCP ACK otherwise and
not in context of TP transmission request.
Note
Please consider SoAdTcpTxQueueSize since even if TP transmission is finished
corresponding queue element is not released until reception of TCP ACK.
Caution
SoAd_IfTransmit has to be called with valid length (e.g. length of PDU instead of
zero) since length is needed to call TcpIp transmission service before Trigger Transmit
callback is called.
For some reasons length of PDU maybe unknown on call to SoAd_IfTransmit. In this
case enable SoAdTxDynamicLengthEnabled in configuration tool to switch to a Vector
specific transmission API between SoAd and TcpIp. With this adapted API it is possible to
request a specific length but copy less data. So if PDU length is unknown maximum PDU
length can be used in SoAd_IfTransmit and smaller length can be copied in Trigger
Transmit callback.
Caution
The adapted API has to be supported by the TcpIp module.
To enable this feature enable the corresponding parameter on the PduRoute (Figure 5-21).
Note
It is possible to have a nPduUdpTxBuffer and a nPduUdpTxQueue on one socket
connection. In this case PDUs in nPduUdpTxBuffer are also represented by an element
in the nPduUdpTxQueue.
The configuration of event queue parameters is required to be done per Socket Adaptor
instance. To configure the event queue limitation create the corresponding configuration
container and set the event queue limit parameters (Figure 5-24). If a container or parameter
does not exist limitation is disabled (default) and all possible events are handled within one
main function.
Figure 5-26 shows how to configure the name of the callback and the maximum amount of
PDU data which are forwarded via the callback.
Figure 5-27 shows how to enable the call of the callback for a specific socket connection. If
disabled on a socket connection the callback won’t be called.
To enable the usage of the meta data create the following parameter for the corresponding
PDU in the EcuC module:
EcuC/EcucPduCollection/Pdu/MetaDataLength
Set the value to 2 since 2 bytes is the size of the socket connection index.
Note
Meta data is used in several MICROSAR Classic components. The handling of
meta data is implemented differently and depends on the component-specific use
case. In the Socket Adaptor, the meta data is intended to be used for PduR-API-
Forwarding to RTE and SomeIp and for communication via SomeIpTp. Other
use-cases like multi-partition or gateway routing are not supported explicitly.
When this feature is enabled, it is recommended to use a timeout for automatic closing of
the socket connections. For UDP, the SoAdSocketUdpAliveSupervisionTimeout can
be used, which is shown in Figure 5-29. In case of a TCP socket connection it is required to
enable SoAdSocketTcpKeepAlive and to set SoAdSocketTcpKeepAliveProbesMax
to “0”, which is both configured in Figure 5-30. SoAdSocketTcpKeepAliveTime now
defines the timeout value.
The SOME/IP and SD measurement data is only updated in case the optional parameter
SoAdMeasurementDataSomeIpSdType is configured to either SOME_IP or SOME_IP_SD
on the socket connection group (refer to Figure 5-33). This parameter must only be
configured when the socket connection group or one of the socket connections of the socket
connection group is used by a socket route having a PDU header ID configured. The first 2
bytes of the PDU header ID represent the service ID and the last 2 bytes represent the
method ID. On reception of a PDU, the received PDU header ID is compared to the
configured PDU header IDs of the socket connection which the PDU was received on. This
is done by having a binary search on the service IDs. To make memory usage and runtime
as efficient as possible, only the associated method IDs of matching service IDs are
considered and there is no additional search on all method IDs. If no matching PDU header
ID is found following options exist for incrementation of the counter values:
1. If no matching service ID was found, the service ID counter is incremented.
2. If a matching service ID was found but no matching PDU header ID, the method ID
counter is incremented.
Whether the SOME/IP- or the SOME/IP SD counters are incremented depends on the
configuration of the parameter on the socket connection group.
To get and reset the counter values, please refer to the API description of
SoAd_GetAndResetMeasurementData() given in chapter 4.2.35.
Configuration elements are mapped to an instance by adding the socket connection group
references to the instance as shown in Figure 5-34. Each socket connection group as well
as PDU routes (Tx data path) and socket routes (Rx data path) must only be referenced by
one SoAd instance.
As already mentioned in chapter 5.2.4.11, event queue and timeout list parameters are
defined instance-wise. Additionally, the available buffer pools (e.g. meta data or trigger
transmit buffers) are configured per instance.
Moreover, the main function(s) (refer to chapter 2.5) exist per instance and each main
function handles only the data of the corresponding instance. Refer to the chapters 4.2.36 -
4.2.39 for the naming convention of the main function(s) when more than one instance
exists.
The shutdown feature (refer to 5.2.4.6) is used partition-independent. Whenever a shutdown
is triggered all instances perform the steps to shut down the Socket Adaptor.
In the multi-partition use-case it is required to access shared memory from different SoAd
instances. To guarantee data consistency the data must be accessed atomically which is
done by using the Bmc module [5] and its functions given in chapter 4.3. Partition-specific
memory is used for the partition-specific functionality to assert that different partitions do not
write to the same memory locations. This is done by generating partition-specific files.
Partition-specific files exist per mapped OS Application and contain the short name of the
OS application as naming convention. The files are listed in chapter 3.1.
Caution
Configure SoAdRxTcpBufferSegmentsMax depending on the underlying TcpIp
module to avoid data loss.
Note
Socket specific MSL timeouts are not supported when Socket Adaptor is used together
with vBsdAd module as lower layer.
For the example in Figure 5-37 the prefix is ExampleCdd. The prototype for an IF
RxIndication would be ExampleCdd_[SoAd][If]RxIndication().SoAd and If infixes
depends on configuration of “ExampleCdd” in “SoAdBswModules”.
6.1 Glossary
Term Description
BSD Sockets Berkeley sockets used by Linux for Ethernet communication
DaVinci Configurator Generation tool for MICROSAR Classic components
Classic
Table 6-1 Glossary
6.2 Abbreviations
Abbreviation Description
API Application Programming Interface
AUTOSAR Automotive Open System Architecture
BSD Berkeley Software Distribution
BSW Basis Software
CDD Complex Device Driver (Complex Driver)
DEM Diagnostic Event Manager
DET Development Error Tracer
DoIP Diagnostic over Internet Protocol
ECU Electronic Control Unit
Eth Ethernet Driver
EthTrcv Ethernet Transceiver Driver
EthIf Ethernet Interface
EthSM Ethernet State Manager
FFI Freedom from interference
IdsM Intrusion Detection System Manager
IF Interface API between BSW modules
MICROSAR Microcontroller Open System Architecture (the Vector AUTOSAR solution)
MSL Maximum Segment Lifetime
OS Operating System
PduR PDU Router
RTE Runtime Environment
SchM Schedule Manager
SoAd Short name of Socket Adaptor
SRS Software Requirement Specification
SwAddrMethods Software address methods
SWS Software Specification
TcpIp Transport layer module containing TCP and UDP implementation
TCP Transmission Control Protocol
7 Contact
> News
> Products
> Demo software
> Support
> Training data
> Addresses
www.vector.com