AUTOSAR SWS ServiceDiscovery
AUTOSAR SWS ServiceDiscovery
AUTOSAR CP R22-11
Disclaimer
This work (specification and/or software implementation) and the material contained in
it, as released by AUTOSAR, is for the purpose of information only. AUTOSAR and the
companies that have contributed to it shall not be liable for any use of the work.
The material contained in this work is protected by copyright and other types of intel-
lectual property rights. The commercial exploitation of the material contained in this
work requires a license to such intellectual property rights.
This work may be utilized or reproduced without any modification, in any form or by
any means, for informational purposes only. For any other purpose, no part of the work
may be utilized or reproduced, in any form or by any means, without permission in
writing from the publisher.
The work has been developed for automotive applications only. It has neither been
developed, nor tested for non-automotive applications.
The word AUTOSAR and the AUTOSAR logo are registered trademarks.
Contents
1 Introduction and functional overview 8
3 Related documentation 11
3.1 Input documents & related standards and norms . . . . . . . . . . . . 11
3.2 Related specification . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
4 Constraints and assumptions 12
4.1 Limitations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
4.2 Applicability to car domains . . . . . . . . . . . . . . . . . . . . . . . . 12
5 Dependencies to other modules 13
5.1 AUTOSAR BSW Scheduler . . . . . . . . . . . . . . . . . . . . . . . . 13
5.2 AUTOSAR BSW Mode Manager . . . . . . . . . . . . . . . . . . . . . 13
5.3 AUTOSAR Socked Adaptor . . . . . . . . . . . . . . . . . . . . . . . . 13
5.4 AUTOSAR Default Error Tracer . . . . . . . . . . . . . . . . . . . . . . 13
5.5 AUTOSAR Diagnostic Event Manager . . . . . . . . . . . . . . . . . . 14
5.6 File structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
5.6.1 Code file structure . . . . . . . . . . . . . . . . . . . . . . . . 14
5.6.2 Header file structure . . . . . . . . . . . . . . . . . . . . . . . 14
6 Requirements Tracing 15
7 Functional specification 16
7.1 Background & Rationale . . . . . . . . . . . . . . . . . . . . . . . . . . 16
7.2 Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
7.2.1 General requirements . . . . . . . . . . . . . . . . . . . . . . 18
7.2.2 Ethernet Communication . . . . . . . . . . . . . . . . . . . . 20
7.2.3 State Handling . . . . . . . . . . . . . . . . . . . . . . . . . . 21
7.2.4 Interaction with Socket Adaptor . . . . . . . . . . . . . . . . . 22
7.2.5 Subscribe Eventgroup retry handling . . . . . . . . . . . . . . 23
7.3 Message format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
7.3.1 Request ID . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
7.3.2 Protocol Version field . . . . . . . . . . . . . . . . . . . . . . 26
7.3.3 Interface Version field . . . . . . . . . . . . . . . . . . . . . . 27
7.3.4 Message Type field . . . . . . . . . . . . . . . . . . . . . . . 27
7.3.5 Return Code field . . . . . . . . . . . . . . . . . . . . . . . . 27
7.3.6 Flags field . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
7.3.7 Reserved field . . . . . . . . . . . . . . . . . . . . . . . . . . 27
7.3.8 Entries Array . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
7.3.8.1 Entry Format Type 1 . . . . . . . . . . . . . . . . . . 28
7.3.8.2 Entry Format Type 2 . . . . . . . . . . . . . . . . . . 29
7.3.9 Options Array . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
7.3.9.1 Configuration Option . . . . . . . . . . . . . . . . . . 30
Term: Description:
Service A functional entity that offers an interface
Service Instance A single instance of the Service
Offer A message entry that offers a Service Instance
Stop Offer A message that stops offering a Service Instance
Find A message entry used to find a Service Instance
Event A message sent by an ECU implementing a Service
Instance to an ECU using this Service Instance.
Eventgroup A logical grouping of 1 or more events. An Eventgroup is
part of a Service.
Server Service Provide a service
Client Service Consumes a service
Server A ECU which host ServerServices
Client A ECU which host ClientServices
Endpoint Option Endpoint Options are used to announce a tuple of unicast
address and port
Multicast Option Multicast Options are used to announce a tuple of multicast
address and port
Unicast event Events which are transmitted to a unicast endpoint by the
ECU which host an SdServerService. The unicast endpoint
is provided by a particular SdClientService which has
subscribed to this SdServerService within the Endpoint
Option referenced by a SubscribeEventgroup entry (see
Consumed Eventgroup unicast endpoint)
Multicast event Events which are transmitted to a multicast endpoint by the
ECU which host an SdServerService. A multicast endpoint
could be provided by the SdServerService (see
Eventhandler multicast endpoint) and SdClientService (see
Consumed Eventgroup multicast endpoint).
5
4
Term: Description:
Eventhandler multicast endpoint Term to describe the tuple of multicast address and port,
which is pre-configured for a SdServerService per
Eventhandler. If the threshold for subscribed Clients with
different endpoint information has been reached, then the
Server sends the corresponding events to this
pre-configured multicast address and port. The Eventhandler
multicast endpoint is announced via a Multicast option
referenced by a SubscribeEventgroupAck entry
Consumed Eventgroup unicast endpoint Term to describe the tuple of unicast address and port,
which is pre-configured for a SdClientService per Consumed
Eventgroup. A SdClientService which subscribes with this
unicast address and port, indicates the SdServer to which
endpoint, the cooresponding events shall be sent. The
Consumed Eventgroup unicast endpoint is announced via a
Endpoint option referenced by a SubscribeEventgroup or
StopSubscribeEventgroup entry
Consumed Eventgroup multicast endpoint Term to describe the tuple of multicast address and port,
which is pre-configured for a SdClientService per Consumed
Eventgroup. A SdClientService which subscribe with this
multicast address and port, indicates the SdServer to which
endpoint the corresponding events shall be sent. The
Consumed Eventgroup multicast endpoint is announced via
a Multicast option referenced by a SubscribeEventgroup or
StopSubscribeEventgroup
Eventhandler multicast connection Term to describe the usage of an established socket
connection if a SdServerService provides the Multicast
events via the configured Eventhandler multicast endpoint
Consumed Eventgroup unicast connection Term to describe the usage of an established socket
connection if a SdClientService receives the events via a
Consumed Eventgroup unicast endpoint
Consumed Eventgroup multicast connection Term to describe the usage of an established socket
connection if a SdClientService receives the events via a
Consumed Eventgroup multicast endpoint
3 Related documentation
[1] Glossary
AUTOSAR_TR_Glossary
[2] General Specification of Basic Software Modules
AUTOSAR_SWS_BSWGeneral
[3] General Requirements on Basic Software Modules
AUTOSAR_SRS_BSWGeneral
[4] Layered Software Architecture
AUTOSAR_EXP_LayeredSoftwareArchitecture
[5] Requirements on SOME/IP Service Discovery Protocol
AUTOSAR_RS_SOMEIPServiceDiscoveryProtocol
[6] SOME/IP Service Discovery Protocol Specification
AUTOSAR_PRS_SOMEIPServiceDiscoveryProtocol
[7] Specification of Basic Software Mode Manager
AUTOSAR_SWS_BSWModeManager
[8] Specification of Socket Adaptor
AUTOSAR_SWS_SocketAdaptor
4.1 Limitations
Although the AUTOSAR SD is able to respond to wildcard requests (ANY) for Service
ID, Instance ID, Major Version, and Minor Version, this module is only able to send
wildcard finds for Minor Version.
This document does not yet contain trace links to the SRS Ethernet, therefore, the
trace table is empty.
Load Balancing Option (Priority field and Weight field) can be configured for the Offer
Services. However, the Client does not evaluate these fields.
[SWS_Sd_00001] dThe code file structure shall not be defined within this specification
completely. At this point it shall be pointed out that the code-file structure shall include
the following files named:
• Sd_Lcfg.c - for link time configurable parameters and
• Sd_PBcfg.c - for post build time configurable parameters.
These files shall contain all link time and post-build time configurable parameters.c()
[SWS_Sd_00003] dThe module shall include the Dem.h file. By this inclusion, the APIs
to report errors as well as the required Event Id symbols are included.c()
6 Requirements Tracing
The following tables reference the requirements specified in [5] and links to the fulfill-
ment of these. Please note that if column “Satisfied by” is empty for a specific require-
ment this means that this requirement is not fulfilled by this document.
Requirement Description Satisfied by
7 Functional specification
For Client Services the local ECUs Service Discovery module has to (client role):
• Listen for offers and finds depending of the configuration store this information in
volatile memory.
• Listen for stop offers and depending of the configuration store this information in
volatile memory.
• Send finds depending on the state of the current ECU and its SWCs.
Service Discovery can be used to manage Publish/Subscribe relationships as well. In
the Service Discovery based Publish/Subscribe use-case one ECU (Publish/Subscribe
Client with ConsumedEventgroup) is interested in receiving some data from (subscrib-
ing to) another ECU (Publish/Subscribe Server with EventHandler).
While the Subscribe is defined explicitly in the SD message, the Publish is based on
the availability of the service Instance itself (OfferService entry). Based on the offered
Service Instance the Publish/Subscribe Client may subscribe via SubscribeEventgroup
entries. The Publish/Subscribe Server will now use this subscription to register the
Publish/Subscribe Client as an interested party in some information specified by the
subscription and start sending that information to the Publish/Subscribe Client pending
some event or time-out.
As optimization, the SD supports sending event messages to multiple clients using
multicast messages instead of a unicast message per client. Please note, it has to be
differed between a multicast endpoint which could be pre-configured on Server side
and a multicast enpoint which could be pre-configured on Client side:
1. If an SdServerService has a pre-configured multicast address and port per Even-
thandler, then the SdServerService switches to this multicast address and port
(so-called "Eventhandler multicast endpoint"), if the threshold (SdEventHandler-
MulticastThreshold) for subscribed SdClientServices with different endpoint in-
formation has been reached
2. If an SdClientService has subcribed with a multicast address and port (so-called
"Consumed Eventgroup multicast endpoint"), then the SdServerService sends
its events upon a subscription to the Consumed Eventgroup multicast endpoint
(multicast address and port)
7.2 Requirements
• SD_CONSUMED_EVENTGROUP_REQUESTED
"SD_SERVER_SERVICE_DOWN" implies that the local SWC(s) offering this Service
Instance are not ready to communicate,
"SD_SERVER_SERVICE_AVAILABLE" implies that the local SWC(s) offering this Ser-
vice Instance are ready to communicate,
"SD_CLIENT_SERVICE_RELEASED" implies that the local SWC(s) using this Service
Instance do not need to communicate with this Service Instance,
"SD_CLIENT_SERVICE_REQUESTED" implies that the local SWC(s) using this ser-
vice is ready to communicate with this Service Instance and needs this Service In-
stance,
"SD_CONSUMED_EVENTGROUP_RELEASED" implies that the local SWC(s) using
this Consumed Eventgroup do not need the events of this Consumed Eventgroup,
"SD_CONSUMED_EVENTGROUP_REQUESTED" implies that the local SWC(s) us-
ing this Consumed Eventgroup need the events of this Consumed Eventgroup.
[SWS_Sd_00007] dThe following CurrentStates shall be available for reporting to Bsw
M module via BswM_Sd_ClientServiceCurrentState(), BswM_Sd_ConsumedEvent
GroupCurrentState(), and BswM_Sd_EventHandlerCurrentState() respectively:
- SD_CLIENT_SERVICE_DOWN
- SD_CLIENT_SERVICE_AVAILABLE
- SD_CONSUMED_EVENTGROUP_DOWN
- SD_CONSUMED_EVENTGROUP_AVAILABLE
- SD_EVENT_HANDLER_RELEASED
- SD_EVENT_HANDLER_REQUESTEDc()
Note:
"SD_CLIENT_SERVICE_DOWN" tells the local SWC(s) that this Service Instance is
not available,
"SD_CLIENT_SERVICE_AVAILABLE" tells the local SWC(s) that this Service Instance
is available,
"SD_CONSUMED_EVENTGROUP_DOWN" tells the local SWC(s) that this Con-
sumed Eventgroup is not currently subscribed,
"SD_CONSUMED_EVENTGROUP_AVAILABLE" tells the local SWC(s) that this Con-
sumed Eventgroup is currently subscribed (i.e. events are received),
"SD_EVENT_HANDLER_RELEASED" tells the local SWC(s) that no client is currently
subscribed to this Eventgroup,
[SWS_Sd_00019] dThe Service Discovery module shall store the status of all statically
configured Service Instances and Eventgroups separately.c()
[SWS_Sd_00020] dAfter initialization of the Service Discovery module by the call of
the API Sd_Init(), all configured Server Service Instances shall have the state "SD_
SERVER_SERVICE_DOWN", unless a Server Service Instance has SdServerService
AutoAvailable set to true, then the state shall be set to "SD_SERVER_SERVICE_
AVAILABLE".c()
Note:
SdServerServiceAutoAvailable set to true, is only allowed for Server Services which
are NOT referencing a SdServiceGroup.
[SWS_Sd_00021] dAfter initialization of the Service Discovery module by calling of
the API Sd_Init(), all configured Client Service Instances shall have the state "SD_
CLIENT_SERVICE_RELEASED", unless a Client Service Instance has SdClientSer-
viceAutoRequired set to true, then the state shall be set to "SD_CLIENT_SERVICE_
REQUESTED".c()
Note:
SdClientServiceAutoRequire set to true, is only allowed for Client Services which are
NOT referencing a SdServiceGroup.
[SWS_Sd_00440] dAfter initialization of the Service Discovery module by calling of
the API Sd_Init(), all configured Eventgroups shall have the state "SD_CONSUMED_
EVENTGROUP_ RELEASED", unless a Consumed Eventgroup has "SdConsumed
EventGroupAutoRequired" set to true, then the state shall be set to "SD_CONSUMED_
EVENTGROUP_REQUESTED" as soon as the associated Client Service Instance is
requested.c()
[SWS_Sd_00402] dThe Service Discovery module shall store all IP address assign-
ment states referenced by server and client Service Instances.c()
[SWS_Sd_00442] dIf Sd_ConsumedEventGroupSetState is called with SD_CON-
SUMED_EVENTGROUP_REQUESTED while its Client Service Instance is still re-
leased (SD_CLIENT_SERVICE_RELEASED) E_NO_OK shall be returned.c()
[SWS_Sd_00443] dIf a SdClientService is set to SD_CLIENT_SERVICE_RELEASED
(via Sd_ClientServiceSetState() or Sd_ServiceGroupStop()) while one or more of
c()
[SWS_Sd_00736] dIf SdSubscribeEventgroupRetryEnable is set to TRUE and SdSub-
scribeEventgroupRetryMax is set to a value greater than 0, every time a Consumed
Eventgroup transit to the state SD_CONSUMED_EVENTGROUP_REQUESTED, the
following actions shall be done:
• the corresponding client service subscription retry delay timer shall be started
and set to SdSubscribeEventgroupRetryDelay, if the timer is not already running
• the Eventgroup subscription retry counter shall be initialized with 1
c()
[SWS_Sd_00737] dIf the client service subscription retry delay timer elapsed and the
counts of retries of subscription (SdSubscribeEventgroupRetryMax) did not exceed
for a configured Eventgroup, the subscription for the Eventgroup shall be re-triggered
by sending a combination of StopSubscribeEventgroup/SubscribeEventgroup, and the
retry counter shall be incremented. If the counts of retries of subscription (SdSubscribe
EventgroupRetryMax) exceeds, the ServiceDiscovery module shall raise the runtime
error "SD_E_COUNT_OF_RETRY_SUBSCRIPTION_EXCEEDED".c()
[SWS_Sd_00738] dThe retry of a subscription for a requested Eventgroup shall be
stopped for the following conditions:
• If a SubscribeEventGroupAck or SubscribeEventGroupNack was received for the
requested Eventgroup.
• If the count of retries exceeds SdEventgroupSubscribeRetryMax of the requested
Eventgroup.
• If the requested Eventgroup is set to "SD_CONSUMED_EVENTGROUP_RE-
LEASED".
c()
[SWS_Sd_00739] dIf SdSubscribeEventgroupRetryEnable is set to TRUE and Sub-
scribeEventgroupRetryMax is set to 0xFF, the retries of subscription shall continue as
long as all of the following conditions are fulfilled:
• the corresponding Eventgroup is set to "SD_CONSUMED_EVENTGROUP_RE-
QUESTED"
• no SubscribeEventGroupAck or no SubscribeEventGroupNack was received
c()
[SWS_Sd_00740] dThe client service subscription retry delay timer shall be can-
celled, if the retry is finished for all Eventgroups of a ClientService according to SWS_
SD_00738.c()
When the client does not receive initial events before the next OfferService is received,
it should stop requesting the eventgroup, i.e. trigger StopSubscribeEventgroup, and
resume requesting the eventgroup, i.e. trigger SubscribeEventgroup when the next
OfferService is received.
This procedure can be triggered on application level and corresponds functionally to
a StopSubscribeEventgroup/SubscribeEventgroup combination after a loss of a Sub-
scribeEventgroupAck. This might imply notifying the SD-Module about reception of the
Initial Event of each and every Field, or other appropriate means.
If the procedures, described in the previous to paragraphs cannot be implemented
by the application, the retry-mechanism should be out-sourced to the BswM in a rule
that initiates re-sending of Initial Events via triggering a StopSubscribeEventgroup/-
SubscribeEventgroup SD message upon detecting that a security association is estab-
lished, to increase at least the robustness for a security association based communa-
tion.
Since the set-up of an security association is asynchronous, the BswM rule (BswM-
ModeRequestSource/BswMTimer) should thereby delay sending StopSubscribeEvent-
group/SubscribeEventgroup by an appropriate time that allows both peers to finish es-
tablishing the security association.
If the Subscribe Eventgroup Ack entry does not arrive before the next Subscribe Event-
group entry is sent (see PRS_SOMEIPSD_00463) or if the client does not receive initial
events before the next OfferService is received, this should not lead to re-establishing
security association connections, if the current connection is being set-up or is already
set-up.
For events that are transported using a security association the client has to make sure
that the security association is established and that it is ready to receive messages
before sending the SubscribeEventgroup entry (see [SWS_Sd_00761]). The server,
on the other hand, has to make sure that the security association is established and
that it is able to send messages before sending the SubscribeEventgroupAck entry
(see [SWS_Sd_00760]).
[SWS_Sd_00759] dIf a SubscribeEventgroup entry is received, for which a security
association is required, and the security association not yet established, this entry
shall be answered with a SubscribeEventgroupNack entry (see [SWS_Sd_00760]).c()
[SWS_Sd_00037] dIf not defined otherwise, all fields in the Service Discovery mes-
sages shall be in Network Byte Order (i.e. Big Endian Byte Order).c()
7.3.1 Request ID
This chapter describes the requirements related to the Request ID field. The Request
ID is made up of Client ID and Session ID. While the Client ID is not used for Service
Discovery, the Session ID is used to detect the reboot or restart of other Service Dis-
covery instances in the vehicle in order to repair the local state of the Service Discovery
module.
[SWS_Sd_00034] dAfter initialization of the Service Discovery Module, the Session ID
for messages sent by the local ECU shall be 0x0001.c()
Note to SWS_SD_00034: This means that the first SD message sent out has Session
ID set to 0x0001. According to PRS_SOMEIPSD_00160 the Service Discovery module
has to handle the session ID per communication partner. Thus, the first SD message
sent out to the multicast endpoint as well as the first SD message sent out to any
unicast endpoint has the Session ID set to 0x0001.
The Protocol Version field is used to describe the current version of SOME/IP.
The Interface Version field is used to describe the current version of the SOME/IP
service; i.e. the current version of SOME/IP-SD itself.
The Message Type field is used to differentiate the types of SOME/IP messages.
SOME/IP-SD uses only event messages; thus, it always uses the same type.
The Return Code is used to signal whether a request was successfully been pro-
cessed. This is not applicable for SOME/IP-SD; therefore, the return code will be
statically set to 0x00.
With the Flags field the SOME/IP-SD header starts. It is used to signal global Service
Discovery information, which includes currently the state of the last reboot as well as
the capability of receiving unicast messages.
[SWS_Sd_00448] dA reboot detected with Session ID and Reboot Flag shall lead to
expiration of the local state that is controlled by this communication partner.
In case of a reboot of a server, of which the client uses a service, the client shall handle
the reboot as if a Stop Offer entry was received (see also SWS_SD_00367 for further
details)
In case of a reboot of a server, of which the client uses a service, the server shall
handle the reboot as if a StopSubscribeEventgroup entry was received (see also SWS_
SD_00345 for further details).c()
This Reserved field is not currently used and left empty for further enhancements of
the SOME/IP-SD protocol.
Two types of Entries exist: Type 1 Entries for Services and Type 2 Entries for Event-
groups.
For further details on the Entry Format Type 1 , see [6, PRS SOME/IP Service Discov-
ery Protocol] Chapter 4.1.2.3 Entry Format
The Type 1 Entries shall have the following layout:
[SWS_Sd_00173] dThe Service ID field of the Type 1 Entry format layout shall carry the
Service ID of the service, statically configured using the parameter SdServerServiceID
and SdClientServiceID, depending on being a server or client entry.c()
[SWS_Sd_00175] dThe Instance ID field of the Type 1 Entry format layout shall carry
the Instance ID of the service, statically configured using the parameter SdServerSer-
viceInstanceID and SdClientServiceInstanceID, depending on being a server or client
entry.c()
[SWS_Sd_00178] dThe Major Version field of the Type 1 Entry format layout shall
carry the SdServerServiceMajorVersion and SdClientServiceMajorVersion, depending
on being a server or client entry.c()
[SWS_Sd_00180] dThe TTL field of the Type 1 Entry format layout defines the lifetime
of the entry for Servers in seconds configured using the parameter SdServerTimerTTL
and SdClientTimerTTL, except for Stop-Entries, which have a TTL of 0.
Note: For Clients the TTL value is not used for Type 1 Entries and shall be ignored by
the server service.c()
[SWS_Sd_00182] dThe Minor Version field of the Type 1 Entry format layout shall carry
the SdServerServiceMinorVersion and SdClientServiceMinorVersion.c()
[SWS_Sd_00193] dThe Service ID field of the Type 2 Entry format layout shall carry
the Service ID of the eventgroups service, statically configured using the parameter Sd
ServerServiceID and SdClientServiceID, depending on being a server or client entry.c
()
[SWS_Sd_00195] dThe Instance ID field of the Type 2 Entry format layout shall carry
the Instance ID of the eventgroups service statically configured using the parame-
ter SdServerServiceInstanceID and SdClientServiceInstanceID, depending on being
a server or client entry.c()
[SWS_Sd_00198] dThe Major Version field of the Type 2 Entry format layout shall
carry the SdServerServiceMajorVersion and SdClientServiceMajorVersion, depending
on being a server or client entry.c()
[SWS_Sd_00200] dThe TTL field of the Type 2 Entry format layout defines the lifetime
of the entry in seconds configured using the parameter SdServerTimerTTL and Sd
ClientTimerTTL, except for Stop- or Nack-Entries, which use a TTL of 0.c()
[SWS_Sd_00204] dThe Eventgroup ID field of the Type 2 Entry format layout shall
carry the ID of an Eventgroup, configured using the parameter SdConsumedEvent
GroupID.c()
[SWS_Sd_00476] dType 2 Entries (Entries for Eventgroups) shall not use "any values"
as Service ID (i.e. 0xFFFF), Instance ID (i.e. 0xFFFF), Eventgroup ID (i.e. 0xFFFF),
and/or Major Version (i.e. 0xFF).c()
The Option array is the last part of the Service Discovery Message (see Figure 7.2).
The options in the options array carry additional information.
For further details on theConfiguration Option, see [6, PRS SOME/IP Service Discov-
ery Protocol] Chapter 4.1.2.4 Options Format
The Configuration Option transports additional attributes of entries in the Service Dis-
covery messages. Between 0 and n configuration items can be transported using the
Configuration Option. These configuration items can include for example the name of
the host or the Service.
This chapter describes the fields and values of the IPv4 Endpoint Option, which trans-
ports unicast IP Address, Layer 4 Protocols (e.g. UDP or TCP), and Port Number; thus,
the information needed to communicate with a service.
When receiving a Service Discovery message offering a service and transporting an
IPv4 Endpoint Option, ECUs receiving this message can dynamically configure the
Socket Adaptor for using this service by updating a Socket Connection.
[SWS_Sd_00755] dThe ports shall be used for the events and notification events as
well.
• When using UDP the server uses the announced port as source port.
• With TCP the client shall check the status of the socket connection by calling
SoAd_GetSoConMode(). Calling this API has to provide SOAD_SOCON_ON-
LINE state for at the dedicated socket connection.
In addition, if a secure port was selected, an security association needs to be estab-
lished before sending the subscription. Otherwise events and notification events can
neither be sent secure ports nor received.c()
This chapter describes the fields and values of the IPv6 Endpoint Option, which is the
same as the IPv4 Endpoint Option except that it transport IPv6 Addresses instead IPv4
Addresses.
[SWS_Sd_00756] dThe ports shall be used for the events and notification events as
well.
• When using UDP the server uses the announced port as source port.
• With TCP the client shall check the status of the socket connection by calling
SoAd_GetSoConMode(). Calling this API has to provide SOAD_SOCON_ON-
LINE state for at the dedicated socket connection.
In addition, if a secure port was selected, an security association needs to be estab-
lished before sending the subscription. Otherwise events and notification events can
neither be sent secure ports nor received.
c()
The IPv4 Multicast option is either used by an SdServerService to announce its con-
figured Eventhandler multicast endpoint or by a SdClientService to announce its con-
figured Consumed Eventgroup multicast endpoint:
• If it is used as Eventhandler multicast endpoint, then an SdServerService an-
nounces the IPv4 multicast address, the transport layer protocol (ISO/OSI layer
4) and the port number, to where the multicast-events and multicast-notification-
events are sent to.
• If it is used as Consumed Eventgroup multicast endpoint, then an SdClientSer-
vice indicates the IPv4 multicast address, the transport layer protocol (ISO/OSI
layer 4) and the port number, where the SdClient expects events to be received.
As transport layer protocol, only UDP is supported.
The IPv6 Multicast option is either used by an SdServerService to announce its con-
figured Eventhandler multicast endpoint or by an SdClientService to announce its con-
figured Consumed Eventgroup multicast endpoint:
• If it is used as Eventhandler multicast endpoint, then an SdServerService an-
nounces the IPv6 multicast address, the transport layer protocol (ISO/OSI layer
4) and the port number, to where the multicast-events and multicast-notification-
events are sent to.
• If it is used as Consumed Eventgroup multicast endpoint, then an SdClientSer-
vice indicates the IPv6 multicast address, the transport layer protocol (ISO/OSI
layer 4) and the port number, where the SdClient expects events to be received.
As transport layer protocol, only UDP is supported.
The IPv4 SD Endpoint Option transports the endpoint (i.e. IP-Address and Port) of
the senders SD implementation. This is used to identify the SOME/IP-SD Instance in
cases in which the IP-Address and/or Port Number cannot be used.
The IPv6 SD Endpoint Option transports the endpoint (i.e. IP-Address and Port) of
the senders SD implementation. This is used to identify the SOME/IP-SD Instance in
cases in which the IP-Address and/or Port Number cannot be used.
This chapter describes how Entries can reference two runs of Options with zero to
fifteen options each in order to reference additional information.
Note: Entries support two option runs to allow referencing the same Options by differ-
ent Entries. With a single option run, sharing Endpoint Options while having different
Configuration Options per Entry would not have work efficiently.
Note: Figure 7.13 shows an SD message example, which has an entry referencing
two options in the first run:
The following table shows which Option is allowed to be carried by different Entries (all
other combinations shall not be used):
These requirements are valid for all Entries concerning Services including Entries of
Type 0x00, 0x01, 0x02, and 0x03.
Note: Currently only Service Entries of type 0x00 and 0x01 are defined in this specifi-
cation.
[SWS_Sd_00295] dAn Instance ID of 0xFFFF shall mean any possible instances and
are not allowed for OfferService and StopOfferService entries.c()
[SWS_Sd_00296] dFindService entries shall carry Service ID, Service Instance ID,
Major Version, and Minor Version as configured in SdClientServiceID, SdClientService
InstanceID, SdClientServiceMajorVersion, and SdClientServiceMinorVersion.c()
[SWS_Sd_00297] dOfferService and StopOfferService shall carry Service ID, Service
Instance ID, Major Version, Minor Version, and as configured in SdServerServiceID, Sd
ServerServiceInstanceID, SdServerServiceMajorVersion, and SdServerServiceMinor
Version.c()
[SWS_Sd_00298] dFindService entries shall carry the TTL as configured in SdClient
TimerTTL.
Note:The TTL value for FindService shall be ignored by the server service, and the
configuration is only kept for backward compatibility.c()
[SWS_Sd_00299] dOfferService entries shall carry the TTL as configured in SdServer
TimerTTL.c()
[SWS_Sd_00267] dAll entries concerning Services (FindService, OfferService and
StopOfferService shall carry - i.e. reference - the options as configured.c()
Note: see also chapter 7.3.9.6.
[SWS_Sd_00478] dThis chapter describes how to derive all necessary data to assem-
ble an OfferService Message:
1. Derive all static data from the configuration container. These are e.g:
• Container SdServerService: SdServerServiceId
• Container SdServerService: SdServerServiceInstanceId
• Container SdServerService: SdServerServiceMajorVersion
• Container SdServerService: SdServerServiceMinorVersion
• Container SdServerTimer: SdServerTimerTTL
• Container SdInstance: SdInstanceHostname
2. If TCP is configured for this service (configuration item SdServerServiceTcpRef
exists):
• The generator derives a SoConID out of the SoConGroup referenced by the
configuration parameter SdServerServiceTcpRef
• Call the Socket Adaptor’s API SoAd_GetLocalAddr() with the derived So
ConID to get back the IP Address, Transport protocol (Layer 4), and the port
number needed for the Endpoint Option.
• Build the relevant Endpoint Option with L4-Protocol set to TCP (shall be
same as in LocalAddr) .
3. If UDP is configured for this service (configuration item SdServerServiceUdpRef
exists):
• The generator derives a SoConID out of the SoConGroup referenced by the
configuration parameter SdServerServiceUdpRef
• Call the Socket Adaptor’s API SoAd_GetLocalAddr() with the derived So
ConID to get back the IP Address, Transport protocol (Layer 4), and the port
number needed for the Endpoint Option.
• Build the relevant Endpoint Option with L4-Protocol set to TCP (shall be
same as in LocalAddr) .
4. Build Configuration Option if configured (see configuration item SdServerCapa-
bilityRecord and SdInstanceHostname).
5. Build OfferService Entry as described above.
c()
The following requirements are valid for all Entries concerning Eventgroups including
Entries of Type 0x04, 0x05, 0x06, and 0x07.
Note: Currently only Eventgroup Entry of Type 0x06 and 0x07 are defined in this spec-
ification.
For further details on Eventgroup Entries, see [6, PRS SOME/IP Service Discovery
Protocol] Chapter 4.1.3.1 Eventgroup Entry
[SWS_Sd_00289] dEventgroups entries include:
• SubscribeEventgroup and StopSubscribeEventgroup
• SubscribeEventgroupAck and SubscribeEventgroupNack
c()
[SWS_Sd_00291] dEventgroup entries shall set the Eventgroup ID to the ID of the
Eventgroup (configuration parameters SdConsumedEventGroupId and SdEventHan-
dlerEventGroupId).c()
Note: Eventgroup ID 0x0000 is reserved.
[SWS_Sd_00301] dSubscribeEventgroup, and StopSubscribeEventgroup entries shall
set the Service IDs, Service Instance IDs, and Eventgroup IDs based on the config-
uration (configuration parameters SdClientServiceId and SdClientServiceInstanceId).c
()
[SWS_Sd_00304] dSubscribeEventgroup entries shall have the TTL field set to the
configured value (configuration parameter SdClientTimerTTL of SdConsumedEvent
Group) and the SubscribeEventgroupAck entry shall use the TTL value of the Sub-
scribeEventgroup entry it acknowledges.c()
[SWS_Sd_00307] dEventgroup entries shall carry the options as configured.c()
[SWS_Sd_00693] dThe Counter field in the Type 2 Entry format is used to differentiate
different Subscribe Eventgroups to otherwise identical Eventgroups (i.e. same Service
ID, same Instance ID, same Eventgroup ID, and same Major Version). The Counter field
shall be reflected by the Server to the Subscribe Eventgroup Ack and Nack entries.
If identical Consumed Eventgroups are configured with different Endpoints, then the
SD shall use the Counter to differentiate the different Subscriptions. The value of the
Counter can be determined by the implementation.c()
Note:
A width of 4 bits limits this to 16 different Subscriptions to the same Eventgroup.
[SWS_Sd_00757] dIn case network security protocols are in use clients shall be hold-
ing back their SubscribeEventgroup, as long as the security association that enables
secure communication is not established (see [SWS_Sd_00761]).
c()
For further details on SubscribeEventgroupNack Entries, see [6, PRS SOME/IP Ser-
vice Discovery Protocol] Chapter 4.1.3.1 Eventgroup Entry
[SWS_Sd_00698] dIf a SubscribeEventgroup entry referencing two conflicting End-
point Options (UDP or TCP) is received then a SubscribeEventgroupNack shall be
generated. Endpoint options are considered conflicting if they are of the same type but
hold different values, like different IP or Port number.c()
4. If UDP is configured for this service and used as Consumed Eventgroup multicast
endpoint (configuration item SdClientServiceMulticastRef exists):
• Find the relevant SocketConnection based on the SdClientServiceMulticas-
tRef (finding SoConGroup) and the Endpoint Option of the OfferService en-
try (finding SoCon within).
• Call the Socket Adaptor’s API SoAd_GetLocalAddr() with the derived So-
ConID to get back the multicast IP Address, Transport protocol (Layer 4),
and the port number needed for the Multicast Option.
• Build the relevant Multicast Option with L4-Protocol set to UDP (shall be
same as in LocalAddr).
5. Build Configuration Option if configured (see configuration item SdClientCapabil-
ityRecord and SdInstanceHostname).
6. Build SubscribeEventgroup Entry as described above.
c()
[SWS_Sd_00480] dThis chapter describes the interaction with the Socket Adaptor
module to send Service Discovery messages:
1. Precondition: Service Discovery message is assembled
2. In case the message shall be sent via unicast:
- Call the Socket Adaptor’s API SoAd_SetRemoteAddr
3. In case the message shall be sent via multicast:
- Call the API SoAd_SetRemoteAddr to set the destination
4. Call SoAd_IfTransmit() to send the message on the bus
Please also refer to the sequence "CLIENT/SERVER: TransmitSdMessage" shown in
Chapter 9.c()
Note:
This can be achieved for example by checking the status of all Service Instances and
Eventgroups cyclically and afterwards assembling the Service Discovery Messages.
[SWS_Sd_00651] dThe amount of separate Service Discovery messages shall be re-
duced, i.e.: Combine as much information as possible into one Service Discovery mes-
sage before calling the Socket Adaptor’s transmit API. This means that when a entry
is sent after waiting the appropriate delay (i.e. based on Request-Response-Delay) all
other entries for this communication partner may be packed into the Service Discovery
message as well.c()
[SWS_Sd_00482] dThis chapter describes the interaction with the Socket Adaptor on
how Service Discovery messages are received:
1. When the SocketAdaptor receives a Service Discovery message, the API Sd_Rx
Indication() is called.
2. Using the indicated RxPduId, the associated SoConId for this SD Instance has to
be determined.
3. Call API SoAd_GetRemoteAddr() with this SoConId.
4. Store address and message for further processing.
5. Reset the SoCon back to Wildcard using SoAd_ReleaseRemoteAddr()
6. The entries shall be processed exactly in the order they arrived.
Please also refer to the sequence "CLIENT/SERVER: Sd_RxIndication" shown in
Chapter 9.c()
Note:
For deriving the SoConId, the SoAdSocketRoute corresponding to this RxPduId should
refer either to a SoAdSocketConnection or to a SoAdSocketConnectionGroup contain-
ing a single SoAdSocketConnection.
[SWS_Sd_00696] dIf the entries of a single Service Discovery Message would lead to
closing and opening the same Socket Connection in the Socket Adaptor, the Service
Discovery shall not close the Socket Connection first.c()
Note: Closing and opening Socket Connections (especially with TCP), conflicts with
the behavior of the Service Discovery and leads to suboptimal reaction times.
When receiving entries the relevant Service Instance or Eventgroups have to be iden-
tified, which is explained in this section.
[SWS_Sd_00488] dIf SdClientServiceMinorVersion is set to 0xFFFFFF and SdVersion
DrivenFindBehavior is set to EXACT_OR_ANY_MINOR_VERSION, the Minor Version
in a received OfferService or StopOfferService entry is not checked for identifying Ser-
vice Instances and its associated Eventgroups.c()
[SWS_Sd_00489] dIf SdClientServiceMinorVersion is set to any value except 0x
FFFFFF and SdVersionDrivenFindBehavior is set to EXACT_OR_ANY_MINOR_VER-
SION, the Minor Version in a received OfferService or StopOfferService shall be
checked for identifying Service Instances and its associated Eventgroups. The Ser-
vice Discovery module shall process a OfferService or StopOfferService where the
minor version of the received entry match exact the configured minor version of the
corresponding SdClientService.c()
Note:
We call each configured service instance fulfilling the SWS items [SWS_Sd_00488]
and [SWS_Sd_00489] a service instance match candidate.
[SWS_Sd_04089] dIf SdVersionDrivenFindBehavior is set to MINIMUM_MINOR_VER-
SION, the Minor
Version in a received OfferService or StopOfferService shall be checked for
identifying Service Instances and its associated Eventgroups. The Service Discovery
module shall process a OfferServices or StopOfferServices where the minor version
of the received entry are equal or greater than the configured minor version of the
corresponding SdClientService.c()
Note: This described behavior of SWS_SD_04089 is differend from PRS_
SOMEIPSD_00825
When receiving Service Discovery messages using multicast, these messages may be
received by multiple ECUs at once and multiple ECUs may answer to such a message
in parallel. This could lead to overload situations of the ECU which sent the Service
Discovery messge via multicast, if all receiving ECUs answer in a similar point in time.
In order to avoid a high workload on ECU which sent the Service Discovery message
via multicast, the answers of the receiving ECUs could delay answer as described in
this section.
[SWS_Sd_00491] dAnswers to Entries received via multicast shall be delayed based
on the appropriate configuration items:
• For ServerServices:
– SdServerTimerRequestResponseMinDelay
– SdServerTimerRequestResponseMaxDelay
• For ConsumedEventgroups:
– SdClientTimerRequestResponseMinDelay
– SdClientTimerRequestResponseMaxDelay
c()
[SWS_Sd_00492] dThe configuration parameters for delaying OfferService entries as
response to FindService entries received by multicast shall be taken from the Timer
containers referenced by the Service container:
• SdServerService
c()
[SWS_Sd_00493] dThe configuration parameters for delaying SubscribeEventgroup
entries as response to OfferService entries received by multicast shall be taken from
the Timer containers referenced by the Eventgroup containers:
• SdConsumedEventGroup
c()
[SWS_Sd_00494] dThere shall be a random delay between the appropriate MinDelay
and MaxDelay before answering to an Entry received via multicast.c()
[SWS_Sd_00724] dIf SdServerTimerRequestResponseMinDelay and SdServerTimer
RequestResponseMaxDelay are set to the same value, this value shall be used as
delay.
If SdServerTimerRequestResponseMinDelay and SdServerTimerRequestResponse
MaxDelay are set to 0, no delay shall be introduced.c()
[SWS_Sd_00725] dIf SdClientTimerRequestResponseMinDelay and SdClientTimer
RequestResponseMaxDelay are set to the same value, this value shall be used as
delay.
If SdClientTimerRequestResponseMinDelay and SdClientTimerRequestResponse
MaxDelay are set to 0, no delay shall be introduced.c()
[SWS_Sd_00495] dDelayed answering Entries received via multicast (as in SWS_
SD_00494) shall no influence other timers (e.g. for handling the Repetition Phase).c()
7.6 Timings and repetitions for Server Service and Event Handlers
Especially after starting multiple ECUs, the multicast messages of the Service Discov-
ery come with the risk of overflowing ECUs with too many messages. Therefore, the
Service Discovery can be configured with a suitable message sending behavior.
For every Server Service Instance different phases are defined as shown in Figure
7.14:
• Down
• Available
– Initial Wait Phase
– Repetition Phase
– Main Phase
[SWS_Sd_00605] dWhen the Down Phase is entered (coming from states other than
init), the API SoAd_CloseSoCon() shall be called for all Socket Connections associated
with this Server Service Instance.c()
[SWS_Sd_00760] dIf a Sd server receives a SubscribeEventgroup entry and client
end point is assigned to a socket connection, the server shall call SoAd_IsConnection-
Ready() for this socket connection and client endpoint:
• If the function returns TCPIP_E_OK, the server shall respond with Sub-
scribeEventgroupAck.
• For all other return values the server shall discard the entry and respond with
SubscribeEventgroupNack.
c()
This chapter describes the behavior of the Service Discovery in regard of a Server
Service Instance in the Initial Wait Phase.
[SWS_Sd_00317] dIf the following conditions apply, the Initial Wait Phase for this con-
figured Server Service Instance shall be entered:
• Sd_Init() has been called
• SdServerService state was set to SD_SERVER_SERVICE_AVAILABLE (via Sd_
ServerServiceSetState() or Sd_ServiceGroupStart())
• Sd_LocalIpAddrAssignmentChg() with state "TCPIP_IPADDR_STATE_AS-
SIGNED" has been called for the first IpAddrId associated with the SdInstance
TxPdu.
c()
Note: Service Discovery expects that the IP address of the data/control path to be
always the same. This means that a call of Sd_LocalIpAddrAssignmentChg() affects
the control path and data path simultaneously.
[SWS_Sd_00330] dWhen the Initial Wait Phase is entered, the routing of the Server
Service shall be enabled. See SdServerServiceActivationRef of this Server Service
Instance.c()
[SWS_Sd_00318] dWhen entering the Initial Wait Phase, a random timer shall be
started, using a random value within the configured range of SdServerTimerInitialOffer
DelayMin and SdServerTimerInitialOfferDelayMax.c()
[SWS_Sd_00319] dIf a FindService Entry is received within the Initial Wait Phase for
this Server Service Instance, it shall be ignored.c()
[SWS_Sd_00320] dIf a SubscribeEventgroup Entry or StopSubscribeEventgroup Entry
are received within the Initial Wait Phase (or other phases) for an Event Handler of this
Server Service Instance, it shall only be processed within the Service Discovery.c()
Note to SWS_SD_00320: Please refer to the according sequence diagrams and sec-
tion 7.6.4.
[SWS_Sd_00321] d
When the calculated random timer based on the min and max values SdServer-
TimerInitialOfferDelayMin and SdServerTimerInitialOfferDelayMax expires and SoAd_
GetSoConMode() provides SOAD_SOCON_ONLINE or SOAD_SOCON_RECON-
NECT state for at least one of the associated socket connection of this service ( con-
figured in SdServerServiceTcpRef or SdServerServiceUdpRef ) :
• OfferService Entry shall be sent.
• If the SdServerTimerInitialOfferRepetitionsMax >0, enter the Repetition Phase
• If the SdServerTimerInitialOfferRepetitionsMax =0, enter the Main Phase.
c()
Note:
1. Init Wait Phase could be extended depends upon the out parameter of type SoAd_
SoConModeType provided by SoAd_GetSoConMode() API.
2. In some case SoAd may need more time to change the socket connection state from
SOAD_SOCON_OFFLINE to SOAD_SOCON_RECONNECT or SOAD_SOCON_ON-
LINE. E.G. Socket Connection will not change to SOAD_SOCON_RECONNECT or
SOAD_SOCON_ONLINE only if InitWaitPhase of Service is configured as 0 or SoAd
main function period is greater then Sd main function period.
[SWS_Sd_00323] dIf SdServerService is set to a state other than SD_SERVER_
SERVICE_AVAILABLE ( via Sd_ServerServiceSetState() or Sd_ServiceGroupStop()
) while being in Initial Wait Phase:
• Enter the Down Phase.
• Set all associated EventHandler to SD_EVENT_HANDLER_RELEASED and re-
port it to the BswM by calling the API BswM_Sd_EventHandlerCurrentState.
• Cancle all relevant timers for service instance (see SWS_SD_00318).
c()
[SWS_Sd_00325] dIf Sd_LocalIpAddrAssignmentChg() is called with a state other than
"TCPIP_IPADDR_STATE_ASSIGNED" while being in Initial Wait Phase, this phase
shall be left and the Down Phase shall be entered.c()
[SWS_Sd_00606] dWhen the Initial Wait Phase is entered, the API SoAd_OpenSo
Con() shall be called for all Socket Connections associated with this Server Service
Instance.c()
Note: As soon as an IP address is assigned again and no SD_SERVER_SERVICE_
DOWN was received, the Initial Wait Phase shall be reentered with the random timer
reset to the random value.
This chapter describes the timing behavior of the Service Discovery in regard of Server
Service Instances in the Repetition Phase.
[SWS_Sd_00329] dIf the Repetition Phase is entered, the Service Discovery shall wait
SdServerTimerInitialOfferRepetitionBaseDelay and send an OfferService Entry.c()
[SWS_Sd_00336] dAfter the amount of cyclically sent OfferServices within the Repe-
tition Phase equals the amount of SdServerTimerInitialOfferRepetitionsMax, the Main
Phase shall be entered.c()
Note:
Additionally sent OfferService messages which have been triggered by received Find
Service messages shall have no influence on the counter value of the cyclically Offer
Service messages.
[SWS_Sd_00342] dThe Service Discovery Module shall stay in the Main Phase for the
configured Server Service as long as the following conditions apply:
• Server Service is in state "SD_SERVER_SERVICE_AVAILABLE" ( indicated by
a call of Sd_ServerServiceSetState() or Sd_ServiceGroupStart())
• IP address is assigned and can be used (i.e. Sd_LocalIpAddrAssignmentChg
has been called with status TCPIP_IPADDR_STATE_ASSIGNED)
c()
[SWS_Sd_00449] dIf SdServerTimerOfferCyclicDelay is greater than 0, in the Main
Phase an OfferService entry shall be sent cyclically with an interval defined by config-
uration item SdServerTimerOfferCyclicDelay.c()
[SWS_Sd_00450] dThe first OfferService is sent SdServerTimerOfferCyclicDelay after
the beginning of the Main Phase.c()
[SWS_Sd_00451] dIf SdServerTimerOfferCyclicDelay is 0, no OfferService entries
shall be sent in Main Phase for this Server Service Instance.c()
[SWS_Sd_00343] dIf the Service Discovery Module receives a FindService Entry the
following step shall be performed:
• Send an "OfferService Entry" considering the appropriate delay.
c()
Note: Currently this specification does not allow sending "FindService Entries" using
unicast. For compatibility reasons receiving such entries shall be supported.
Note to SWS_SD_00343: For more details on sending an "OfferService Entry" con-
sidering the appropriate delay, see Chapter 7.5.3)
[SWS_Sd_00344] dIf the Service Discovery Module receives a "SubscribeEvent-
group", the following step(s) shall be performed in the following order:
• Send a SubscribeEventgroupAck / Nack entry using Unicast considering the ap-
propriate delay without influencing the current running main phase timer.
• Report to the BswM SD_EVENT_HANDLER_REQUESTED by calling the API
BswM_Sd_EventHandlerCurrentState().
• Start the TTL timer according to the value received via the "SubscribeEvent-
group".
c()
Note: Currently this specification does not allow sending "SubscribeEventgroup En-
tries" using multicast. For compatibility reasons receiving such entries shall be sup-
ported.
This chapter describes the interaction between Service Discovery and Socket Adaptor
(SoAd) in order to configure the TX path for sending out events (fan out). It has to be
considered, that a SdClientService could either subscribe with an Consumed Event-
group unicast endpoint (transferred within a Endpoint Option) or with a Consumed
Eventgroup multicast endpoint (transferred within a Multicast Option).
[SWS_Sd_00452] dThe Service Discovery shall keep track of the subscribed clients
per Event Handler and remove clients from the fan out, if the last SubscribeEventgroup
entry was longer ago than the time specified in its TTL field of that SubscribeEvent-
group entry.This shall be handled independently if the client subscribed with a Con-
sumed Eventgroup unicast endpoint, Consumed Eventgroup multicast endpoint or if
the Event Handler has set SdEventHandlerMulticastThreshold to 1 (Events are trans-
mitted exclusively via Eventhandler multicast endpointc()
Note: Service Discovery has to maintain the TTL time per subscribed Client Service In-
stance independent if the client subscribed with a Consumed Eventgroup unicast end-
point or Consumed Eventgroup multicast endpoint or if the affected SdServerService
transmit its Events via the Evenhandler multicast endpoint according to the configura-
tion of SdEventHandlerMulticastThreshold. In any case the Server Service Instance
must know its subscribed clients with respect to the unicast remote address (IP and
port) of the client.
[SWS_Sd_00453] dIf SdEventHandlerTCP is configured: For every SubscribeEvent-
group entry of this Event Handler and the SubscribeEventgroup entry reference an
Endpoint Option, the following shall be done:
• The relevant Routing Groups shall be identified by SdEventHandlerTcp.
• The relevant TCP Socket Connection of this client shall be identified using the
Address/Port of Endpoint Option (TCP) referenced in the SubscribeEventgroup
entry and the SdServerServiceTcpRef, or shall be set up, if not existed before.
• Check state of incoming TCP connection using SoAd_GetSoConMode. If mode
is not SOAD_SOCON_ONLINE, answer using SubscribeEventgroupNack. Only
if the client was not subscribed before receiving the aforementioned entry:
– SoAd_EnableSpecificRouting with SdEventActivationRef and the Socket
Connection.
– SoAd_IfSpecificRoutingGroupTransmit with SdEventTriggeringRef and the
Socket Connection.
• Answer using SubscribeEventgroup entry.
c()
[SWS_Sd_00454] d
If SdEventHandlerUdp is configured: For every SubscribeEventgroup entry of this
Eventhandler and if the SubscribeEventgroup entry references a Unicast Endpoint Op-
tion, the following shall be done:
• The relevant Routing Groups shall be identified by SdEventHandlerUdp.
• If the relevant UDP Socket Connection of this client shall be identified using
the Eventgroup unicast endpoint (Address/Port) of Endpoint Option (UDP) ref-
erenced in the SubscribeEventgroup entry and the SdServerServiceUdpRef, or
shall be set up (SoAd_SetUniqueRemoteAddr()), if not existed before.
– If no Wildcard Socket Connection is left, SD_E_OUT_OF_RES shall be re-
ported.
• Only if the client was not subscribed before receiving this entry:
– SoAd_EnableSpecificRouting with SdEventActivationRef and the Socket
Connection depending on current number of subscribed clients with different
endpoint information and the SdEventHandlerMulticastThreshhold.
– SoAd_IfSpecificRoutingGroupTransmit with SdEventTriggeringRef and the
Socket Connection.
c()
[SWS_Sd_00753] dIf SdEventHandlerUdp is configured: For every SubscribeEvent-
group entry of this Eventhandler and if the SubscribeEventgroup entry references a
Multicast Option, the following shall be done:
• The relevant Routing Groups shall be identified by SdEventHandlerUdp.
• The relevant UDP Socket Connection of this client shall be identified using the
Eventgroup multicast endpoint (Address/Port) of the Multicast Option referenced
in the SubscribeEventgroup entry and the SdServerServiceUdpRef, or shall be
set up (SoAd_SetUniqueRemoteAddr()), if not existed before.
– If no Wildcard Socket Connection is left, SD_E_OUT_OF_RES shall be re-
ported.
• The following action shall be performed, if no other client has already subscribed
with the same Comsumed Eventgroup Multicast endpoint information:
– Call SoAd_EnableSpecificRouting with SdEventActivationRef and the corre-
sponding Socket Connection. The corresponding Socket Connection shall
be the configured Socket Connection referenced by SdMulticastEventSo-
ConRef, if the number of subscribed clients with different endpoint informa-
tion has reached SdEventHandlerMulticastThreshold. Otherwise the identi-
fied Socket Connection (described in the previous point)
• Only if the client was not subscribed before receiving this entry:
– SoAd_IfSpecificRoutingGroupTransmit with SdEventTriggeringRef and the
Socket Connection.
c()
Note:
• SdClientServices which subscribe with the same Consumed Eventgroup multi-
cast endpoint, share the same SoAdSocketConnection on SdServerService side
• A SdServiceService could send the same event at the same time to a Consumed
Eventgroup unicast endpoint or Consumed Eventgroup multicast endpoint. This
is announced within the SubscriptionEventgroup entry which could reference ei-
ther a IPv4/IPv6 Endpoint option (unicast endpoint) or via IPv4/IPv6 Multicast
option (multicast endpoint).
• Transmission of initial Events (SdEventTriggeringRef is configured) in combinan-
tion with a subscription using a Consumed Eventgroup multicast endpoint has
to be used carefully. This has to be ensured by the network communication de-
sign. Rational: every subscription to the same Consumed Eventgroup multicast
endpoint would trigger a transmission of an initial Event, which is received by all
currently subscribed Clients. This could cause misbehavior for communication
for example which use sequence counters (e.g. E2E communication).
[SWS_Sd_00754] dEach Eventhandler shall qualify based on the configured SdEven-
tHandlerMulticastThreshhold and the number of clients with different endpoint infor-
mation (either received as Eventgroup unicast endpoint or as Eventgroup multicast
endpoint), if the threshold has been reached to transmit the Events via the configured
Evenhandler multicast endpoint (see SdMulticastEventSoConRef).c()
[SWS_Sd_00455] dThe number of subscribed clients with different endpoint informa-
tion shall be used to control when to enable/disable Consumed Eventgroup unicast or
Consumed Eventgroup multicast connention, or when to enable/disable Evenhandler
Multicast connection by calling SoAd_EnableSpecificRouting and SoAd_DisableSpeci-
ficRouting:
• If SdEventHandlerMulticastThreshhold = 0: Setup a Consumed Eventgroup uni-
cast connection or a Consumed Eventgroup multicast connection connection to
every subscribed client (please note: Eventhandler Multicast connection is al-
ways disabled).
• If SdEventHandlerMulticastThreshhold = 1: Setup a Eventhandler Multicast con-
nection if one or more clients are subscribed (please note: Consumed Event-
group unicast connections and Consumed Eventgroup multicast connections are
always disabled).
• If SdEventHandlerMulticastThreshhold > 1:
– Setup a Consumed Evengroup unicast connection or a Consumed Event-
group multicast connection for all subscribed clients if the number of sub-
c()
[SWS_Sd_00462] dAs long as a service is not requested by the BswM, the Service
Discovery shall not send FindService Entry entries.c()
[SWS_Sd_00463] dIf an OfferService Entry is received during Down Phase,
• The Service Discovery shall store the state of this Service instance.
• A timer shall be set/reset to the TTL value of the received OfferService entry (TTL
timer).
• Until the TTL Timer expires or a StopOfferService entry is received, the Service
instance is considered Available.
c()
[SWS_Sd_00464] dIf a SdClientService is set to state SD_CLIENT_SERVICE_RE-
QUESTED (by call of Sd_ClientServiceSetState() or Sd_ServiceGroupStart()) while
being in Down Phase:
• If no OfferService entry was received before or its TTL timer expired already:
– The Initial Wait Phase shall be entered,
• If an OfferService entry was received and its TTL timer did not expire yet:
– If SoAd_OpenSoCon() was not called before, the API SoAd_OpenSoCon()
shall be called for all Socket Connections associated with this Client Service
Instance.
– The API SoAd_EnableSpecificRouting() shall be called with SdClientService
ActivationRef (see SdConsumedMethods) and the relevant Socket Connec-
tions for this Client Service Instance.
– Open TCP connection if SdClientServiceTcpRef is configured and was not
opened before.
– The Main Phase shall be entered.
c()
This chapter describes the behavior of the Service Discovery in regard of a Client
Service Instance in the Initial Wait Phase.
[SWS_Sd_00350] dIf the following conditions apply, the Initial Wait Phase for this con-
figured Client Service Instance shall be entered:
ing in Initial Wait Phase, this phase shall be left and the Service shall enter Down
Phase.c()
[SWS_Sd_00456] dIf for any reasons the Initial Wait Phase is left, the calculated ran-
dom timer (of the Initial Wait Phase) for this Service Instance shall be stopped.c()
[SWS_Sd_00357] dIf Sd_LocalIpAddrAssignmentChg() is called with a state other
than "TCPIP_IPADDR_STATE_ASSIGNED" while being in Initial Wait Phase, the Down
Phase shall be entered.c()
[SWS_Sd_00354] dIf the API Sd_Init() is called while being in Initial Wait Phase, the
Down Phase shall be entered.c()
[SWS_Sd_00358] dWhen the Repetition Phase is entered, the Service Discovery Mod-
ule shall start the timer SdClientTimerInitialFindRepetitionsBaseDelayc()
[SWS_Sd_00457] dWhen the timer SdClientTimerInitialFindRepetitionsBaseDelay ex-
pires within the Repetition Phase, a FindOffer Message shall be sent.c()
[SWS_Sd_00363] dIn the Repetition Phase up to SdClientTimerInitialFindRepetitions
Max FindServer entries shall be sent with doubling intervals (BaseDelay, first FindSer-
vice Entry, 2x BaseDelay, second FindService Entry, 4x BaseDelay, third FindService
Entry,... ).c()
Note: Example config and resulting behavior (no OfferService received during exam-
ple):
SdClientTimerInitialFindRepetitionBaseDelay=30
SdClientTimerInitialFindRepetitionMax=3
[Initial Wait Phase starts]
Wait Initial Wait Delay based on Configured Min and Max
Send entry.
[Initial Wait Phase ends]
[Repetition Phase starts]
Wait 30ms (=30ms * 20).
Send entry.
Wait 60ms (=30ms * 21).
Send entry.
Wait 120ms (=30ms * 22).
Send entry.
[SWS_Sd_00375] dThe Service Discovery Module shall stay in the Main Phase as
long as the following conditions apply:
• Client Service was set to state "SD_CLIENT_SERVICE_REQUESTED" (indi-
cated by a call of Sd_ClientServiceSetState() or Sd_ServiceGroupStart())
• IP address assigned and can be used (i.e. Sd_LocalIpAddrAssignmentChg has
been called with status TCPIP_IPADDR_STATE_ASSIGNED).
c()
[SWS_Sd_00376] dIf the Service Discovery Module receives an OfferService Entry,
the following step(s) shall be performed in the following order:
• If received TTL is not equal to the max value, update the timer by the received
TTL value.
• Open TCP connection if SdClientServiceTcpRef is configured and was not
opened before.
• For each currently requested Consumed Eventgroup of this Client Service In-
stance (Consumed Eventgroups are requested using Sd_ConsumedEventGroup
SetState and with state SD_CONSUMED_EVENTGROUP_REQUESTED or au-
tomatically on startup if SdConsumedEventGroupAutoRequire is configured to
true), the following shall be done in exactly this order:
– StopSubscribeEventgroup entry shall be sent out, if the last SubscribeEvent-
group entry was sent as reaction to an OfferService entry received via Multi-
cast, it was never answered with a SubscribeEventgroupAck, and the current
OfferService entry was received via Multicast.
– A SubscribeEventgroup entry shall be sent out.
• If SdSubscribeEventgroupRetryEnable is set to TRUE and if SdSubscribeEvent-
groupRetryMax is greater 0, the Eventgroup subscription retry counter shall be
reset to 1.
c()
Note: The amount of separate Service Discovery messages shall be reduced, i.e.:
Combine as much information as possible into one Service Discovery message before
calling the Socket Adaptor’s transmit API.
[SWS_Sd_00721] dIf an OfferService entry was received and its TTL timer did not
expire yet, the associated Socket Connections are in state SOAD_SOCON_ONLINE
in the Main phase:
• If the client service has not been reported as SD_CLIENT_SERVICE_AVAIL-
ABLE:
[SWS_Sd_00713] dIf the Consumed Event Group is not requested anymore as in-
dicated by a call of Sd_ConsumedEventGroupSetState with state SD_CONSUMED_
EVENTGROUP_RELEASED, the Service Discovery module shall perform the follow-
ing steps for the consumed event group:
• A StopSubscribeEventgroup shall be sent.
• The status shall be set to SD_CONSUMED_EVENTGROUP_DOWN and be re-
ported to the BswM by calling the API BswM_Sd_ConsumedEventGroupCurrent
State(), if the status is not currently SD_CONSUMED_EVENTGROUP_DOWN.
• If SdSubscribeEventgroupRetryEnable is set to TRUE and if SdSubscribeEvent-
groupRetryMax is greater 0, cancel the corresponding client service subscription
retry delay timer and reset subscription retry counter of all corresponding Event-
groups to 0.
c()
[SWS_Sd_00600] dIf the TTL Timer of a Client Service expires, the Service Discovery
module shall perform the following steps:
• Enter the Initial Wait Phase and indicate the state SD_CLIENT_SERVICE_
DOWN to the BswM by calling the API BswM_Sd_ClientServiceCurrentState ().
• All subscribed Eventgroups of this Client Service shall expired in this instance
(stop TTL timer) and the expiration shall be handled as describe in SWS_
SD_00601.
c()
[SWS_Sd_00601] dIf the TTL Timer of an Eventgroup expires, the Service Discovery
module shall perform the following step(s):
• the status shall be set to SD_CONSUMED_EVENTGROUP_DOWN and re-
ported to BswM by calling the API BswM_Sd_ConsumedEventGroupCurrent
State().
c()
[SWS_Sd_00382] dWhen the Main Phase is left,
• The API SoAd_DisableSpecificRouting()shall be called for all Socket Connections
associated with this Client Service ID that have been opened before.
• Close all Socket Connections associated with this Client Service Instance that
have been opened before.
c()
This section describes the interaction between Service Discovery and Socket Adaptor
(SoAd) to configure the RX path for receiving events (fan in).
[SWS_Sd_00702] dIf SdConsumedEventGroupTcpActivationRef is configured: When
sending SubscribeEventgroup entries for this Eventgroup, the following shall be done:
• The relevant Routing Group shall be identified by following SdConsumedEvent
GroupTcpActivationRef.
• The relevant TCP Socket Connection shall be identified by SdClientServiceTcp
Ref.
• A TCP Endpoint option shall be constructed with these parameters.
• Only if this client is currently not subscribed yet:
– SoAd_EnableSpecificRouting with the two parameters above.
c()
[SWS_Sd_00703] dIf SdConsumedEventGroupUdpActivationRef is configured: When
sending SubscribeEventgroup entries for this Eventgroup, the following shall be done:
• The relevant Routing Group shall be identified by following SdConsumedEvent
GroupUdpActivationRef.
• The relevant TCP Socket Connection shall be identified by SdClientServiceUdp
Ref.
• A UDP Endpoint option shall be constructed with these parameters.
• Only if this client is currently not subscribed yet:
– SoAd_EnableSpecificRouting with the two parameters above.
c()
[SWS_Sd_00704] dIf SdConsumedEventGroupMulticastActivationRef is configured:
When receiving SubscribeEventgroupAck entries for this Eventgroup and with a ref-
erenced Multicast Option, the following shall be done if this client is currently not sub-
scribed yet:
• The relevant Routing Group shall be identified by following SdConsumedEvent
GroupMulticastActivationRef.
• The relevant UDP Socket Connection shall be identified:
– Find the relevant Socket Connection Group using SdConsumedEventGroup
MulticastGroupRef with the local Address and Port of the Multicast Option
or set one up.
– Find the relevant Socket Connection in this Socket Connection Group by
finding the Address and Port of this Services Endpoint or set one up.
[SWS_Sd_00748] dBy default, all SdServiceGroupS shall be in the state stopped and
they shall not be started automatically by a call to Sd_Init.c()
[SWS_SD_00107] d
Type of error Related error code Error value
SD has not been initialized SD_E_UNINIT 0x01
Null pointer has been passed as an argument SD_E_PARAM_POINTER 0x02
Invalid mode request SD_E_INV_MODE 0x03
Invalid Id SD_E_INV_ID 0x04
Initialization failed SD_E_INIT_FAILED 0x05
c()
[SWS_Sd_00108] dThe detection of development errors shall be configurable (ON /
OFF) at pre-compile time. The switch SdDevErrorDetect (see chapter 9) shall activate
or deactivate the detection of all development errors.c()
[SWS_Sd_00109] dIf the SdDevErrorDetect switch is enabled API parameter checking
is enabled.c()
Note: The detection of production code errors cannot be switched off.
[SWS_Sd_00110] dDetected development errors shall be reported to the Det_Report
Error service of the Default Error Tracer (DET) if the pre-processor switch SdDevError
Detect is set (see chapter 10).c()
[SWS_SD_00742] d
Type of error Related error code Error value
Retry was not successful SD_E_COUNT_OF_RETRY_SUBSCRIPTION_ 0x06
EXCEEDED
c()
7.9.5.1 SD_E_OUT_OF_RES
7.9.5.2 SD_E_MALFORMED_MSG
7.9.5.3 SD_E_SUBSCR_NACK_RECV
8 API specification
c()
8.2.1 Sd_ConfigType
[SWS_SD_00690] d
Name Sd_ConfigType
Kind Structure
Elements implementation specific
Type –
Comment The content of the configuration data structure is implementation
specific.
Description Configuration data structure of Sd module.
Available via Sd.h
c()
8.2.2 Sd_ServerServiceSetStateType
[SWS_SD_00118] d
Name Sd_ServerServiceSetStateType
Kind Enumeration
Range SD_SERVER_SERVICE_ 0x00 –
DOWN
SD_SERVER_SERVICE_ 0x01 –
AVAILABLE
Description This type defines the Server states that are reported to the SD using the expected API Sd_Server
ServiceSetState.
Available via Sd.h
c()
8.2.3 Sd_ClientServiceSetStateType
[SWS_SD_00405] d
Name Sd_ClientServiceSetStateType
Kind Enumeration
Range SD_CLIENT_SERVICE_ 0x00 –
RELEASED
SD_CLIENT_SERVICE_ 0x01 –
REQUESTED
Description This type defines the Client states that are reported to the BswM using the expected API Sd_Client
ServiceSetState.
Available via Sd.h
c()
8.2.4 Sd_ConsumedEventGroupSetStateType
[SWS_SD_00550] d
Name Sd_ConsumedEventGroupSetStateType
Kind Enumeration
Range SD_CONSUMED_ 0x00 –
EVENTGROUP_
RELEASED
SD_CONSUMED_ 0x01 –
EVENTGROUP_
REQUESTED
Description This type defines the subscription policy by consumed EventGroup for the Client Service.
Available via Sd.h
c()
8.2.5 Sd_ClientServiceCurrentStateType
[SWS_SD_00551] d
Name Sd_ClientServiceCurrentStateType
Kind Enumeration
Range SD_CLIENT_SERVICE_ 0x00 –
DOWN
SD_CLIENT_SERVICE_ 0x01 –
AVAILABLE
Description This type defines the modes to indicate the current mode request of a Client Service.
Available via Sd.h
c()
8.2.6 Sd_ConsumedEventGroupCurrentStateType
[SWS_SD_00552] d
Name Sd_ConsumedEventGroupCurrentStateType
Kind Enumeration
Range SD_CONSUMED_ 0x00 –
EVENTGROUP_DOWN
SD_CONSUMED_ 0x01 –
EVENTGROUP_
AVAILABLE
Description This type defines the subscription policy by consumed EventGroup for the Client Service.
Available via Sd.h
c()
8.2.7 Sd_EventHandlerCurrentStateType
[SWS_SD_00553] d
Name Sd_EventHandlerCurrentStateType
Kind Enumeration
Range SD_EVENT_HANDLER_ 0x00 –
RELEASED
SD_EVENT_HANDLER_ 0x01 –
REQUESTED
Description This type defines the subscription policy by EventHandler for the Server Service.
Available via Sd.h
c()
8.2.8 Sd_ConfigOptionStringType
[SWS_SD_91002] d
Name Sd_ConfigOptionStringType
Kind Const Pointer
Type const uint8*
Description Type for a zero-terminated string of configuration options.
Available via Sd.h
c()
8.2.9 Sd_ServiceGroupIdType
[SWS_SD_91008] d
Name Sd_ServiceGroupIdType
Kind Type
Derived from uint16
Range 0..65535 – Zero-based integer number
Description The AUTOSAR ServiceDiscovery module’s SdServiceGroup object identifier.
Available via Sd.h
c()
8.3.1 Sd_Init
[SWS_SD_00119] d
Service Name Sd_Init
Syntax void Sd_Init (
const Sd_ConfigType* ConfigPtr
)
Service ID [hex] 0x01
Sync/Async Synchronous
Reentrancy Non Reentrant
Parameters (in) ConfigPtr Pointer to a selected configuration structure.
Parameters (inout) None
Parameters (out) None
5
4
Return value None
Description Initializes the Service Discovery.
Available via Sd.h
c()
[SWS_Sd_00120] dThe Sd_Init function shall initialize the state machines for all Ser-
vice Instances according to SWS_SD_00020 and SWS_SD_00021.c()
[SWS_Sd_00121] dThe Sd_Init function shall internally store the configuration data
address to enable subsequent API calls to access the configuration data.c()
[SWS_Sd_00122] dThe Sd_Init function shall remember internally the successful ini-
tialization for other API functions to check for proper module initialization.c()
8.3.2 Sd_GetVersionInfo
[SWS_SD_00124] d
Service Name Sd_GetVersionInfo
Syntax void Sd_GetVersionInfo (
Std_VersionInfoType* versioninfo
)
Service ID [hex] 0x02
Sync/Async Synchronous
Reentrancy Reentrant
Parameters (in) None
Parameters (inout) None
Parameters (out) versioninfo Pointer to where to store the version information of this module.
Return value None
Description Returns the version information of this module.
Available via Sd.h
c()
[SWS_Sd_00125] dThe Sd_GetVersionInfo function shall return the version informa-
tion of this module. The version information includes:
- Module Id
- Vendor Id
- Vendor specific version numbersc()
[SWS_Sd_00126] dConfiguration of Sd_GetVersionInfo: This function shall be pre
compile time configurable On/Off by the configuration parameter: SdVersionInfoApic
()
[SWS_Sd_00497] dIf development error detection for the Service Discovery module
is enabled, then the function Sd_GetVersionInfo shall check whether the parameter
8.3.3 Sd_ServerServiceSetState
[SWS_SD_00496] d
Service Name Sd_ServerServiceSetState
Syntax Std_ReturnType Sd_ServerServiceSetState (
uint16 SdServerServiceHandleId,
Sd_ServerServiceSetStateType ServerServiceState
)
Service ID [hex] 0x07
Sync/Async Asynchronous
Reentrancy Reentrant
Parameters (in) SdServerServiceHandleId ID to identify the Server Service Instance.
ServerServiceState The state the Server Service Instance shall be set to.
Parameters (inout) None
Parameters (out) None
Return value Std_ReturnType E_OK: State accepted
E_NOT_OK: State not accepted
Description This API function is used by the BswM to set the Server Service Instance state.
Available via Sd.h
c()
[SWS_Sd_00407] dIf development error detection is enabled and the Service Dis-
covery module has not been initialized using Sd_Init(), the Sd_ServerServiceSetState
function shall raise the development error code SD_E_UNINIT and the Sd_ServerSer-
viceSetState function shall return E_NOT_OK.c()
[SWS_Sd_00408] dIf the parameter ServerServiceState has an undefined value, the
Service Discovery module shall not store the requested mode and return E_NOT_OK.
In case development error detection is enabled, the Service Discovery module shall
additionally raise the development error code SD_E_INV_MODE.c()
[SWS_Sd_00607] dIf the parameter SdServerServiceHandleId has an invalid value,
the Service Discovery Module shall not store the requested mode and return E_NOT_
OK. In case development error detection is enabled, the Service Discovery module
shall additionally raise the development error code SD_E_INV_ID.c()
8.3.4 Sd_ClientServiceSetState
[SWS_SD_00409] d
Service Name Sd_ClientServiceSetState
Syntax Std_ReturnType Sd_ClientServiceSetState (
uint16 ClientServiceHandleId,
Sd_ClientServiceSetStateType ClientServiceState
)
Service ID [hex] 0x08
Sync/Async Asynchronous
Reentrancy Reentrant
Parameters (in) ClientServiceHandleId ID to identify the Client Service Instance.
ClientServiceState The state the Client Service Instance shall be set to.
Parameters (inout) None
Parameters (out) None
Return value Std_ReturnType E_OK: State accepted
E_NOT_OK: State not accepted
Description This API function is used by the BswM to set the Client Service Instance state.
Available via Sd.h
c()
[SWS_Sd_00410] dIf development error detection is enabled and the Service Discov-
ery module has not been initialized using Sd_Init(), the Sd_ClientServiceSetState func-
tion shall raise the development error code SD_E_UNINIT and the Sd_ClientService
SetState function shall return E_NOT_OK.c()
[SWS_Sd_00411] dIf the parameter ClientServiceState has an undefined value, the
Service Discovery module shall not store the requested mode and return E_NOT_OK.
In case development error detection is enabled, the Service Discovery module shall
additionally raise the development error code SD_E_INV_MODE.c()
[SWS_Sd_00608] dIf the parameter ClientServiceHandleId has an invalid value, the
Service Discovery module shall not store the requested mode and return E_NOT_OK.
In case development error detection is enabled, the Service Discovery module shall
additionally raise the development error code SD_E_INV_ID.c()
8.3.5 Sd_ConsumedEventGroupSetState
[SWS_SD_00560] d
Service Name Sd_ConsumedEventGroupSetState
Syntax Std_ReturnType Sd_ConsumedEventGroupSetState (
uint16 SdConsumedEventGroupHandleId,
Sd_ConsumedEventGroupSetStateType ConsumedEventGroupState
)
Service ID [hex] 0x09
5
4
Sync/Async Asynchronous
Reentrancy Reentrant
Parameters (in) SdConsumedEventGroup ID to identify the Consumed Eventgroup
HandleId
ConsumedEventGroup The state the EventGroup shall be set to.
State
Parameters (inout) None
Parameters (out) None
Return value Std_ReturnType E_OK: State accepted
E_NOT_OK: State not accepted
Description This API function is used by the BswM to set the requested state of the EventGroupStatus.
Available via Sd.h
c()
[SWS_Sd_00469] dIf development error detection is enabled and the Service Discov-
ery module has not been initialized using Sd_Init(), the Sd_ConsumedEventGroupSet
State function shall raise the development error code SD_E_UNINIT and the Sd_Con-
sumedEventGroupSetState function shall return E_NOT_OK.c()
[SWS_Sd_00470] dIf ConsumedEventGroupSetState has an undefined value, the Ser-
vice Discovery module shall not store the requested mode and return E_NOT_OK.
In case development error detection is enabled, the Service Discovery module shall
additionally raise the development error code SD_E_INV_MODE.c()
[SWS_Sd_00609] dIf the parameter SdConsumedEventGroupHandleId has an invalid
value, the Service Discovery module shall not store the requested mode and return
E_NOT_OK. In case development error detection is enabled, the Service Discovery
module shall additionally raise the development error code SD_E_INV_ID.c()
8.3.6 Sd_LocalIpAddrAssignmentChg
[SWS_SD_00412] d
Service Name Sd_LocalIpAddrAssignmentChg
Syntax void Sd_LocalIpAddrAssignmentChg (
SoAd_SoConIdType SoConId,
TcpIp_IpAddrStateType State
)
Service ID [hex] 0x05
Sync/Async Synchronous
Reentrancy Reentrant for different SoConIds. Non Reentrant for the same SoConId.
Parameters (in) SoConId socket connection index specifying the socket connection where
the IP address assigment has changed.
State state of IP address assignment.
Parameters (inout) None
5
4
Parameters (out) None
Return value None
Description This function gets called by the SoAd if an IP address assignment related to a socket
connection changes (i.e. new address assigned or assigned address becomes invalid).
Available via Sd.h
c()
[SWS_Sd_00471] dIf development error detection is enabled and the Service Discov-
ery module has not been initialized using Sd_Init(), the Sd_LocalIpAddrAssignment
Chg function shall raise the development error code SD_E_UNINIT and the Sd_Local
IpAddrAssignmentChg function shall return without further action.c()
[SWS_Sd_00472] dIf the parameter State has an undefined value, the Service Discov-
ery module shall not store the requested mode and return.
In case development error detection is enabled, the Service Discovery module shall
additionally raise the development error code SD_E_INV_MODE.c()
[SWS_Sd_00610] dIf the parameter SoConId has an invalid value, the Service Dis-
covery module shall not store the requested mode and return. In case development
error detection is enabled, the Service Discovery module shall additionally raise the
development error code SD_E_INV_ID.c()
8.3.7 Sd_SoConModeChg
[SWS_SD_91003] d
Service Name Sd_SoConModeChg
Syntax void Sd_SoConModeChg (
SoAd_SoConIdType SoConId,
SoAd_SoConModeType Mode
)
Service ID [hex] 0x43
Sync/Async Synchronous
Reentrancy Reentrant for different SoConIds. Non reentrant for the same SoConId.
Parameters (in) SoConId socket connection index specifying the socket connection with the
mode change.
Mode new mode
Parameters (inout) None
Parameters (out) None
Return value None
Description Notification about a SoAd socket connection state change, e.g. socket connection gets online
Available via Sd.h
c()
8.3.8 Sd_ServiceGroupStart
[SWS_SD_91006] d
Service Name Sd_ServiceGroupStart
Syntax void Sd_ServiceGroupStart (
Sd_ServiceGroupIdType ServiceGroupId
)
Service ID [hex] 0x44
Sync/Async Synchronous
Reentrancy Reentrant for different SdServiceGroupS. Non reentrant for the same SdServiceGroup.
Parameters (in) ServiceGroupId Id of SdServiceGroup to be started
Parameters (inout) None
Parameters (out) None
Return value None
Description Starts a preconfigured SdServiceGroup. For example, OfferService entries will be sent out after
the call of Sd_ServiceGroupStart() for all ServerServives of a SdServiceGroup, which are not
requested yet.
Available via Sd.h
c()
8.3.9 Sd_ServiceGroupStop
[SWS_SD_91007] d
Service Name Sd_ServiceGroupStop
Syntax void Sd_ServiceGroupStop (
Sd_ServiceGroupIdType ServiceGroupId
)
Service ID [hex] 0x45
Sync/Async Synchronous
Reentrancy Reentrant for different SdServiceGroupS. Non reentrant for the same SdServiceGroup.
Parameters (in) ServiceGroupId Id of SdServiceGroup to be stopped
Parameters (inout) None
Parameters (out) None
Return value None
Description Stops a preconfigured SdServiceGroup. For example, StopOfferService entries will be sent out
after the call of Sd_ServiceGroupStop() for all ServerServices of a SdServiceGroup, which are
not requested by another SdServiceGroup.
Available via Sd.h
c()
8.4.1 Sd_RxIndication
[SWS_SD_00129] d
Service Name Sd_RxIndication
Syntax void Sd_RxIndication (
PduIdType RxPduId,
const PduInfoType* PduInfoPtr
)
Service ID [hex] 0x42
Sync/Async Synchronous
Reentrancy Reentrant for different PduIds. Non reentrant for the same PduId.
Parameters (in) RxPduId ID of the received PDU.
PduInfoPtr Contains the length (SduLength) of the received PDU, a pointer
to a buffer (SduDataPtr) containing the PDU, and the MetaData
related to this PDU.
Parameters (inout) None
Parameters (out) None
Return value None
Description Indication of a received PDU from a lower layer communication interface module.
Available via Sd.h
c()
[SWS_Sd_00473] dIf development error detection is enabled and the Service Dis-
covery module has not been initialized using Sd_Init(), the Sd_RxIndication function
shall raise the development error code SD_E_UNINIT and the Sd_RxIndication func-
tion shall return without further action.c()
[SWS_Sd_00474] dIf RxPduId has an undefined value, the Service Discovery module
shall discard the message and return without further action.
In case development error detection is enabled, the Service Discovery module shall
additionally raise the development error code SD_E_INV_ID.c()
[SWS_Sd_00475] dIf development error detection is enabled: The function shall check
parameter PduInfoPtr for being a null pointer. In this case, the function shall raise the
development error SD_E_PARAM_POINTER and return without further action.c()
8.5.1 Sd_MainFunction
[SWS_SD_00130] d
Service Name Sd_MainFunction
Syntax void Sd_MainFunction (
void
)
Service ID [hex] 0x06
Description –
Available via SchM_Sd.h
c()
[SWS_Sd_00131] dThe Sd_MainFunction shall update all counters, timers, states and
phases and prozess the Rx and Tx data path.c()
This chapter defines all interfaces, which are required to fulfill the core functionality of
the module.
[SWS_SD_00133] d
API Function Header File Description
Dem_SetEventStatus Dem.h Called by SW-Cs or BSW modules to report monitor
status information to the Dem. BSW modules calling
Dem_SetEventStatus can safely ignore the return
value. This API will be available only if ({Dem/Dem
ConfigSet/DemEventParameter/DemEvent
ReportingType} == STANDARD_REPORTING)
SoAd_DisableSpecificRouting SoAd.h Disables routing of a group of PDUs in the SoAd
related to the RoutingGroup specified by parameter
id only on the socket connection identified by SoCon
Id.
SoAd_EnableSpecificRouting SoAd.h Enables routing of a group of PDUs in the SoAd
related to the RoutingGroup specified by parameter
id only on the socket connection identified by SoCon
Id.
SoAd_GetLocalAddr SoAd.h Retrieves the local address (IP address and port)
actually used for the SoAd socket connection
specified by SoConId, the netmask and default
router
SoAd_GetPhysAddr SoAd.h Retrieves the physical source address of the EthIf
controller used by the SoAd socket connection
specified by SoConId.
5
4
API Function Header File Description
SoAd_GetRemoteAddr SoAd.h Retrieves the remote address (IP address and port)
actually used for the SoAd socket connection
specified by SoConId
SoAd_GetSoConMode SoAd.h Returns current state of the socket connection
specified by SoConId.
SoAd_IfSpecificRoutingGroupTransmit SoAd.h Triggers the transmission of all If-TxPDUs identified
by the parameter id on the socket connection
specified by SoConId after requesting the data from
the related upper layer.
SoAd_IfTransmit SoAd.h Requests transmission of a PDU.
SoAd_ReleaseRemoteAddr SoAd.h By this API service the remote address (IP address
and port) of the specified socket connection shall be
released, i.e. set back to the configured remote
address setting.
SoAd_SetRemoteAddr SoAd.h By this API service the remote address (IP address
and port) of the specified socket connection shall be
set.
c()
This chapter defines all interfaces, which are required to fulfill an optional functionality
of the module.
[SWS_SD_00134] d
API Function Header File Description
BswM_Sd_ClientServiceCurrentState BswM_Sd.h Function called by Service Discovery to indicate
current state of the Client Service (available/down).
BswM_Sd_ConsumedEventGroup BswM_Sd.h Function called by Service Discovery to indicate
CurrentState current status of the Consumed Eventgroup
(available/down).
BswM_Sd_EventHandlerCurrentState BswM_Sd.h Function called by Service Discovery to indicate
current status of the EventHandler (requested/
released).
Det_ReportError Det.h Service to report development errors.
SoAd_CloseSoCon SoAd.h This service closes the socket connection specified
by SoConId.
SoAd_DisableRouting SoAd.h Disables routing of a group of PDUs in the SoAd
related to the RoutingGroup specified by parameter
id. Routing of PDUs can be either forwarding of
PDUs from the upper layer to a TCP or UDP socket
of the TCP/IP stack specified by a PduRoute or the
other way around specified by a SocketRoute.
SoAd_EnableRouting SoAd.h Enables routing of a group of PDUs in the SoAd
related to the RoutingGroup specified by parameter
id. Routing of PDUs can be either forwarding of
PDUs from the upper layer to a TCP or UDP socket
of the TCP/IP stack specified by a PduRoute or the
other way around specified by a SocketRoute.
5
4
API Function Header File Description
SoAd_GetSoConId SoAd.h Returns socket connection index related to the
specified TxPduId.
SoAd_IfRoutingGroupTransmit SoAd.h Triggers the transmission of all If-TxPDUs identified
by the parameter id after requesting the data from
the related upper layer.
SoAd_OpenSoCon SoAd.h This service opens the socket connection specified
by SoConId.
SoAd_ReleaseIpAddrAssignment SoAd.h By this API service the local IP address assignment
used for the socket connection specified by SoConId
is released.
SoAd_RequestIpAddrAssignment SoAd.h By this API service the local IP address assignment
which shall be used for the socket connection
specified by SoConId is initiated.
SoAd_SetUniqueRemoteAddr SoAd.h This API service shall either return the socket
connection index of the SoAdSocketConnection
Group where the specified remote address (IP
address and port) is set or assign the remote
address to an unused socket connection from the
same SoAdSocketConnectionGroup.
c()
8.6.3.1 Sd_CapabilityRecordMatchCallout
[SWS_SD_91001] d
Service Name <SdCapabilityRecordMatchCallout>
Syntax boolean <SdCapabilityRecordMatchCallout> (
PduIdType pduID,
uint8 type,
uint16 serviceID,
uint16 instanceID,
uint8 majorVersion,
uint32 minorVersion,
const Sd_ConfigOptionStringType* receivedConfigOptionPtrArray,
const Sd_ConfigOptionStringType* configuredConfigOptionPtrArray
)
Service ID [hex] 0x10
Sync/Async Synchronous
Reentrancy Reentrant for different PduIds. Non reentrant for the same PduId.
Parameters (in) pduID ID of the received I-PDU (used to to distinguish between different
SD instances)
type Content of the Type field of the received entry (see section 7.3.8)
serviceID Content of the Service ID field of the received entry (see section
7.3.8)
instanceID Content of the Instance ID field of the received entry (see section
7.3.8)
majorVersion Content of the Major Version field of the received entry (see
section 7.3.8)
5
4
minorVersion Content of the Minor Version field of the received entry (see
section 7.3.8)
receivedConfigOptionPtr NULL_PTR terminated array of pointers to zero-terminated
Array configuration strings received in the incoming entry, i.e. received
SD message (see Figure 6 - Configuration Option)
configuredConfigOption NULL_PTR terminated array of pointers to zero-terminated
PtrArray configuration strings configured in the local SD configuration (see
Figure 6 - Configuration Option)
Parameters (inout) None
Parameters (out) None
Return value boolean TRUE: The received configuration options match the configured
ones.
FALSE: The received configuration options do not match the
configured ones.
Description This callout is invoked to determine whether the configuration options contained in a received
SD message match the ones configured in the local SD configuration (i.e., SdServerCapability
Record or SdClientCapabilityRecord).
Available via Sd_Externals.h
9 Sequence diagrams
buildOfferServiceEntry()
determineRequestResponseDelay(SdServerTimerRequestResponseMinDelay,
SdServerTimerRequestResponseMaxDelay)
[entry==SubscribeEventgroup]
addClientToFanOut()
buildSubscribeAckEntry()
[entry==StopSubscribeEventgroup]
removeClientFromFanOut()
[else]
disassembleIncomingMessage(entries, options)
updateState()
SoAd_OpenSoCon(SdClientServiceTcpRef)
SoAd_EnableSpecificRouting(SdClientServiceActivationRef, TcpSoConId)
SoAd_EnableSpecificRouting(SdClientServiceActivationRef, TcpSoConId)
buildSubscribeEventgroupEntry()
[entry==StopOfferService]
updateStateOfServiceAndRelatedEventgroups()
DisableRoutingForServiceAndEventgroups
()
cleanUpSoCons()
[entry==SubscribeEventgroupAck]
SoAd_EnableSpecificRouting(SdConsumedEventGroupMulticastActivationRef, SoConId)
[entry==SubscribeEventgroupNack]
DEM_reportError()
[else]
SoAd_GetLocalAddr(Std_ReturnType, SoAd_SoConIdType,
TcpIp_SockAddrType*, uint8*, TcpIp_SockAddrType*)
buildEndpointOptionUdp(LocalAddrPtr)
SoAd_GetLocalAddr(Std_ReturnType, SoAd_SoConIdType,
TcpIp_SockAddrType*, uint8*, TcpIp_SockAddrType*)
buildEndpointOptionTcp(LocalAddrPtr)
buildConfigurationOption()
buildOfferServiceEntry()
buildEndpointOptionUdp(LocalAddrPtr)
SoAd_EnableSpecificRouting(SdConsumedEventGroupUdpActivationRef, UdpSoConId)
buildEndpointOptionTcp(LocalAddrPtr)
SoAd_EnableSpecificRouting(SdConsumedEventGroupTcpActivationRef, TcpSoConId)
buildConfigurationOption()
buildSubscribeEventgroupEntry()
buildMulticastOption()
buildConfigurationOption()
buildSubscribeEventgroupAckEntry()
alt
[unicast entries]
SoAd_SetRemoteAddr(unicastAddress)
[multicast entries]
SoAd_GetLocalAddr(multicastSoConId): destination
SoAd_SetRemoteAddr(destination)
numOfSubs++()
opt if no SoConId is known for client and eventgroup (first for TCP, then for UDP)
addToSendQueue()
exit()
[UDP] SoAd_SetUniqueRemoteAddr( )
rememberSoConId()
SoAd_EnableSpecificRouting(SdEventHandlerTcp->SdEventActivationRef, TcpSoConId)
SoAd_IfSpecificRoutingGroupTransmit(SdEventHandlerTcp->SdEventTriggeringRef, TcpSoConId)
opt
SD_EVENTGROUP_REQUESTED_AND_AVAILABLE
[numOfSubs==0]
BswM_Sd_EventHandlerCurrentState( )
alt
[MulticastThreshhold==0 || numOfSubs<MulticastThreshhold]
SoAd_EnableSpecificRouting(SdEventHandlerUdp->SdEventActivationRef, SoConId)
[numOfSubs==MulticastThreshhold]
SoAd_EnableSpecificRouting(SdEventHandlerMulticast->SdEventActivationRef,
SdEventHandlerMulticast->SdMulticastEventSoConRef)
loop over all subscribed clients (new client needs only Activate)
SoAd_DisableSpecificRouting(SdEventHandlerUdp--
>SdEventActivationRef, SoConId)
SoAd_IfSpecificRoutingGroupTransmit(SdEventHandlerUdp-
>SdEventTriggeringRef, UdpSoConId)
"Available"()
seq DOWN
Sd_ServerServiceSetState(SdServerServiceHandleId,
SD_SERVER_SERVICE_AVAILABLE)
check
HandleID()
update
State()
SoAd_EnableRouting(SdServerServiceActivationRef)
opt LocalIPAddrAssignment==TCPIP_IPADDR_STATE_ASSIGNED
SoAd_OpenSoCon(SoConId)
calculateInitialWaitTimer(SdServerTimerInitialOfferDelayMin,
SdServerTimerInitialOfferDelayMax)
startTimer(initialWait)
SD_SERVER_SERVICE_AVAILABLE
buildOfferServiceEntry()
addToSendQueue(dest, entry,
options, sendTime)
buildOfferServiceEntryAndOptions()
Sd_ClientServiceSetState(ClientServiceHandleId,
SD_CLIENT_SERVICE_REQUESTED)
update State()
startTimer(InitialWait)
timeExpired(InitialWait)
buildFindEventgroupEntry()
buildFindEventgroupEntry()
addToSendQueue(dest, entry, options, sendTime)
SD_CLIENT_SERVICE_REQUESTED_AND_AVAILABLE
BswM_Sd_ClientServiceCurrentState(SdClientServiceHandleId,
SD_CLIENT_SERVICE_AVAILABLE)
ModeSwitch(AVAILABLE)
10 Configuration specification
In general, this chapter defines configuration parameters and their clustering into con-
tainers. In order to support the specification Chapter 10.1 describes fundamentals.
It also specifies a template (table) you shall use for the parameter specification. We
intend to leave Chapter 10.1 in the specification to guarantee comprehension.
Chapter 10.2 specifies the structure (containers) and the parameters of the module
SD.
Chapter 10.3 specifies published information of the module SD.
[SWS_Sd_00135] dThe Service Discovery module shall support tool based configura-
tion.c()
[SWS_Sd_00136] dThe configuration tool shall check the consistency of the configu-
ration parameters at system configuration time.c()
[SWS_Sd_00459] dFor all SD messages sent and received via the Socket Adaptor
module, the header mode shall be activated.c()
[SWS_Sd_00460] dFor all SD messages sent and received via the Socket Adap-
tor module, the SoAdTxPduHeaderId and the SoAdRxPduHeaderId shall be set to
0xFFFF8100 respectively by Socket Adaptor.c()
Note: This ensures that the SoAd creates the first part of the SOME/IP header (32bit
Message ID followed by a 32bit Length field) as needed for SOME/IP-SD. The remain-
der of the SD messages is created by this module (see chapter 7.3).
10.2.1 Sd
Included Containers
Container Name Multiplicity Scope / Dependency
SdConfig 1 This container contains the configuration parameters and sub
containers of the AUTOSAR Service Discovery module.
SdGeneral 1 This container lists the general configuration parameters for the
Service Discovery module.
min = 0
max = 65535
SdServerService:
EcucParamConfContainerDef
+subContainer
lowerMultiplicity = 0 SdClientService:
upperMultiplicity = * EcucParamConfContainerDef
+subContainer lowerMultiplicity = 0
upperMultiplicity = *
SdServerTimer:
+subContainer EcucParamConfContainerDef
lowerMultiplicity = 0
SdClientTimer:
upperMultiplicity = *
+subContainer EcucParamConfContainerDef
lowerMultiplicity = 0
upperMultiplicity = *
+parameter SdInstanceHostname:
EcucStringParamDef
lowerMultiplicity = 0 SdInstanceLocalAdressCheckLength:
upperMultiplicity = 1 EcucIntegerParamDef
+parameter
min = 0
max = 128
lowerMultiplicity = 0
upperMultiplicity = 1
SdInstanceDemEventParameterRefs:
EcucParamConfContainerDef SD_E_MALFORMED_MSG:
+reference EcucReferenceDef
lowerMultiplicity = 0
upperMultiplicity = 1 lowerMultiplicity = 0
upperMultiplicity = 1
requiresSymbolicNameValue = true
+subContainer
SD_E_OUT_OF_RES:
+reference EcucReferenceDef
lowerMultiplicity = 0
upperMultiplicity = 1
requiresSymbolicNameValue = true
+reference SD_E_SUBSCR_NACK_RECV:
EcucReferenceDef
lowerMultiplicity = 0
upperMultiplicity = 1
requiresSymbolicNameValue = true
10.2.2 SdGeneral
4
Description If SdSetRemAddrOfClientRxMulticastSoCon is set to TRUE, the Service Discovery
module shall choose an multicast socket connection which match to the received
Endpoint option of the corresponding OfferService. If no particular socket connection
exist, then an unused socket connection with its remote address set to wildcard shall be
used and the remote address shall be updated accordingly. If SdSetRemAddrOfClient
RxMulticastSoCon is set to FALSE, the Service Discovery shall choose an unused
socket connection with its remote address set to wildcard and skip to update the
remote address, i.e. the wildcard for the remote address is kept.
Note: setting SdSetRemAddrOfClientRxMulticastSoCon to FALSE supports the re-use
of a multicast socket connection for multiple ClientServices which are located on the
same ECU and subscribed to ServerServices which are located on different ECUs.
The configuration of the ECU where the ClientServices are located, could be simplified
by only configuring one socket connection within the multicast socket connection group.
Multiplicity 1
Type EcucBooleanParamDef
Default value true
Post-Build Variant Value false
Value Configuration Class Pre-compile time X All Variants
Link time –
Post-build time –
Scope / Dependency scope: ECU
dependency: If SdSetRemAddrOfClientRxMulticastSoCon is set to FALSE, then all
affected Socket Connections shall set SoAdSocketMsgAcceptanceFilterEnabled to
FALSE. Please note, a socket connection with SoAdSocketMsgAcceptanceFilter
Enabled set to FALSE, accept all received events without checking the remote source
address.
4
Scope / Dependency scope: local
No Included Containers
SdGeneral: SdDevErrorDetect:
+parameter
EcucParamConfContainerDef EcucBooleanParamDef
defaultValue = false
+parameter SdVersionInfoApi:
EcucBooleanParamDef
defaultValue = false
SdMainFunctionCycleTime:
+parameter EcucFloatParamDef
min = 0
max = INF
+parameter SdSubscribeEventgroupRetryEnable:
EcucBooleanParamDef
defaultValue = false
+parameter SdSetRemAddrOfClientRxMulticastSoCon:
EcucBooleanParamDef
defaultValue = true
10.2.3 SdConfig
Included Containers
Container Name Multiplicity Scope / Dependency
SdCapabilityRecordMatchCallout 0..* Callout that is invoked by the Sd implementation to determine
whether the configuration options contained in the entries of a
received SD message match the capability record elements
configured in SdServerCapabilityRecord or SdClientCapability
Record.
SdInstance 0..* This container represents an instance of the SD; i.e. the SD
configuration for a certain link.
SdServiceGroup 0..* This container represents a group of ClientServices and Server
Services, respectively.
10.2.4 SdCapabilityRecordMatchCallout
No Included Containers
10.2.5 SdInstance
4
Multiplicity 0..1
Type EcucStringParamDef
Default value –
Regular Expression –
Post-Build Variant Multiplicity true
Post-Build Variant Value true
Multiplicity Configuration Class Pre-compile time X VARIANT-PRE-COMPILE
Link time X VARIANT-LINK-TIME
Post-build time X VARIANT-POST-BUILD
Value Configuration Class Pre-compile time X VARIANT-PRE-COMPILE
Link time X VARIANT-LINK-TIME
Post-build time X VARIANT-POST-BUILD
Scope / Dependency scope: local
Included Containers
Container Name Multiplicity Scope / Dependency
SdClientService 0..* This container specifies all parameters used by Client services.
SdClientTimer 0..* This container specifies all timers used by the Service Discovery
module for Client Services.
SdInstanceDemEventParameter 0..1 Container for the references to DemEventParameter elements
Refs which shall be invoked using the API Dem_SetEventStatus in
case the corresponding error occurs. The EventId is taken from
the referenced DemEventParameter’s DemEventId symbolic
value. The standardized errors are provided in this container and
can be extended by vendor-specific error references.
SdInstanceMulticastRxPdu 1 This container specifies the received PDU.
5
4
Included Containers
Container Name Multiplicity Scope / Dependency
SdInstanceTxPdu 1 This container specifies the transmitted PDU.
SdInstanceUnicastRxPdu 1 This container specifies the received PDU.
SdServerService 0..* This container specifies all parameters used by Server services.
SdServerTimer 0..* This container specifies all timers used by the Service Discovery
module for Server Services.
10.2.6 SdServiceGroup
4
Post-Build Variant Multiplicity true
Post-Build Variant Value true
Multiplicity Configuration Class Pre-compile time X VARIANT-PRE-COMPILE
Link time X VARIANT-LINK-TIME
Post-build time X VARIANT-POST-BUILD
Value Configuration Class Pre-compile time X VARIANT-PRE-COMPILE
Link time X VARIANT-LINK-TIME
Post-build time X VARIANT-POST-BUILD
Scope / Dependency scope: ECU
4
Post-Build Variant Value true
Value Configuration Class Pre-compile time X VARIANT-PRE-COMPILE
Link time X VARIANT-LINK-TIME
Post-build time X VARIANT-POST-BUILD
Scope / Dependency scope: ECU
No Included Containers
No Included Containers
10.2.7 SdServerTimer
4
Default value –
Post-Build Variant Multiplicity true
Post-Build Variant Value true
Multiplicity Configuration Class Pre-compile time X VARIANT-PRE-COMPILE
Link time X VARIANT-LINK-TIME
Post-build time X VARIANT-POST-BUILD
Value Configuration Class Pre-compile time X VARIANT-PRE-COMPILE
Link time X VARIANT-LINK-TIME
Post-build time X VARIANT-POST-BUILD
Scope / Dependency scope: ECU
4
Scope / Dependency scope: ECU
4
Default value –
Post-Build Variant Value true
Value Configuration Class Pre-compile time X VARIANT-PRE-COMPILE
Link time X VARIANT-LINK-TIME
Post-build time X VARIANT-POST-BUILD
Scope / Dependency scope: ECU
No Included Containers
10.2.8 SdInstanceTxPdu
No Included Containers
10.2.9 SdInstanceMulticastRxPdu
4
Link time X VARIANT-LINK-TIME
Post-build time X VARIANT-POST-BUILD
Scope / Dependency scope: local
No Included Containers
10.2.10 SdInstanceUnicastRxPdu
No Included Containers
10.2.11 SdServerService
4
Post-build time X VARIANT-POST-BUILD
Scope / Dependency scope: local
Included Containers
Container Name Multiplicity Scope / Dependency
SdEventHandler 0..* Container Element for representing an EventGroup as part of the
Service Instance.
SdProvidedMethods 0..1 Container element for representing the needed elements of the
data path for the methods provided by the service.
SdServerCapabilityRecord 0..* Sd uses capability records to store arbitrary name/value pairs
conveying additional information about the named service.
The following use cases are supported: 1) Key present, with no
value (e.g. "passreq" – password required for this service)
2) Key present, with empty value (e.g. "PlugIns=" server
supports plugins, but none are presently installed)
3) Key present, with non-empty value (e.g. "Plug
Ins=JPEG,MPEG2,MPEG4")
10.2.12 SdClientService
4
Post-Build Variant Value true
Value Configuration Class Pre-compile time X VARIANT-PRE-COMPILE
Link time X VARIANT-LINK-TIME
Post-build time X VARIANT-POST-BUILD
Scope / Dependency scope: local
dependency: SdClientServiceAutoRequire could only be set to true, if the SdClient
Service is NOT referencing a SdServiceGroup
4
Post-build time X VARIANT-POST-BUILD
Scope / Dependency scope: local
4
Post-Build Variant Multiplicity false
Post-Build Variant Value true
Multiplicity Configuration Class Pre-compile time X VARIANT-PRE-COMPILE
Link time X VARIANT-LINK-TIME,
VARIANT-POST-BUILD
Post-build time –
Value Configuration Class Pre-compile time X VARIANT-PRE-COMPILE
Link time X VARIANT-LINK-TIME
Post-build time X VARIANT-POST-BUILD
Scope / Dependency scope: local
4
Post-build time X VARIANT-POST-BUILD
Scope / Dependency scope: local
dependency: This parameter is only valid if SdClientServiceUdpRef is NOT configured.
4
Post-Build Variant Multiplicity true
Post-Build Variant Value true
Multiplicity Configuration Class Pre-compile time X VARIANT-PRE-COMPILE
Link time X VARIANT-LINK-TIME
Post-build time X VARIANT-POST-BUILD
Value Configuration Class Pre-compile time X VARIANT-PRE-COMPILE
Link time X VARIANT-LINK-TIME
Post-build time X VARIANT-POST-BUILD
Scope / Dependency scope: local
dependency: This parameter is only valid if SdClientServiceMulticastRef is NOT
configured.
Included Containers
Container Name Multiplicity Scope / Dependency
SdBlocklistedVersions 0..1 Collection of blocklisted versions.
Tags: atp.Status=draft
SdClientCapabilityRecord 0..* Sd uses capability records to store arbitrary name/value pairs
conveying additional information about the named service.
The following use cases are supported: 1) Key present, with no
value (e.g. "passreq" – password required for this service)
2) Key present, with empty value (e.g. "PlugIns=" server
supports plugins, but none are presently installed)
3) Key present, with non-empty value (e.g. "Plug
Ins=JPEG,MPEG2,MPEG4")
SdConsumedEventGroup 0..* This container specifies all parameters for consumed event
groups.
SdConsumedMethods 0..1 Container element for representing the data path for accessing
the server methods.
10.2.13 SdClientCapabilityRecord
No Included Containers
10.2.14 SdConsumedEventGroup
4
Value Configuration Class Pre-compile time X All Variants
Link time –
Post-build time –
Scope / Dependency scope: local
4
Description The reference of the Routing Group for activation of the data path for receiving TCP
events.
This element is also being used for getting the IP address and port number for building
the TCP endpoint option for the Subscribe EventGroup entry.
If no TCP methods are used in the service, this element is also being used for setting
the remote address (TCP Endpoint option referenced by the Offer Service entry) and
opening the TCP connection to the server before sending the Subscribe EventGroup
entry. If multiple EventGroups of the same Service Instance are subscribed the TCP
connection will be shared and must be opened only once.
Multiplicity 0..1
Type Symbolic name reference to SoAdRoutingGroup
Post-Build Variant Multiplicity true
Post-Build Variant Value true
Multiplicity Configuration Class Pre-compile time X VARIANT-PRE-COMPILE
Link time X VARIANT-LINK-TIME
Post-build time X VARIANT-POST-BUILD
Value Configuration Class Pre-compile time X VARIANT-PRE-COMPILE
Link time X VARIANT-LINK-TIME
Post-build time X VARIANT-POST-BUILD
Scope / Dependency scope: local
4
Multiplicity Configuration Class Pre-compile time X VARIANT-PRE-COMPILE
Link time X VARIANT-LINK-TIME
Post-build time X VARIANT-POST-BUILD
Value Configuration Class Pre-compile time X VARIANT-PRE-COMPILE
Link time X VARIANT-LINK-TIME
Post-build time X VARIANT-POST-BUILD
Scope / Dependency scope: local
No Included Containers
SdConsumedEventGroup: SdConsumedEventGroupHandleId:
EcucParamConfContainerDef EcucIntegerParamDef
+parameter
lowerMultiplicity = 0 min = 0
upperMultiplicity = * max = 65535
symbolicNameValue = true
SdConsumedEventGroupId: EcucIntegerParamDef
+parameter
min = 0
max = 65534
SdConsumedEventGroupUdpActivationRef:
+reference EcucReferenceDef SoAdRoutingGroup:
+destination EcucParamConfContainerDef
lowerMultiplicity = 0
upperMultiplicity = 1 lowerMultiplicity = 0
requiresSymbolicNameValue = true upperMultiplicity = *
SdConsumedEventGroupTcpActivationRef:
+reference EcucReferenceDef +destination
+parame
lowerMultiplicity = 0
upperMultiplicity = 1
requiresSymbolicNameValue = true
SdConsumedEventGroupMulticastActivationRef:
EcucReferenceDef
+reference +destination
lowerMultiplicity = 0
upperMultiplicity = 1
requiresSymbolicNameValue = true
SdConsumedEventGroupMulticastGroupRef: SoAdSocketConnectionGroup:
+reference EcucReferenceDef +destination EcucParamConfContainerDef
lowerMultiplicity = 0 lowerMultiplicity = 1
upperMultiplicity = * upperMultiplicity = *
SdConsumedEventGroupAutoRequire:
+parameter EcucBooleanParamDef
defaultValue = false
lowerMultiplicity = 1
upperMultiplicity = 1
10.2.15 SdConsumedMethods
No Included Containers
10.2.16 SdEventHandler
4
Post-build time X VARIANT-POST-BUILD
Scope / Dependency scope: local
Included Containers
Container Name Multiplicity Scope / Dependency
SdEventHandlerMulticast 0..1 The subcontainer including the Routing Group for Activation of
Events sent over Multicast.
The activation ref is also being used for identification of the
related Socket Connection in order to find the Multicast Address
used in the Multicast Option referenced by the Subscribe Event
Group Ack entry.
SdEventHandlerTcp 0..1 The subcontainer including the Routing Groups for Activation
and Trigger Transmit for Events sent over TCP.
The activation ref (or triggering ref if no activation ref exists) is
also being used for identification of the related socket
connections in order to find the related client by iterating the Sd
EventHandlerTcp elements (remote address statically configured
or automatically set by opening TCP connection before
subscription).
SdEventHandlerUdp 0..1 The subcontainer including the Routing Groups for Activation
and Trigger Transmit for Events sent over UDP.
The activation ref (or triggering ref if no activation ref exists) is
also being used for identification of the related socket
connections in order to set the remote address (either unicast
address or multicast address) of the client or find the related
client by iterating the SdEventHandlerUdp elements (remote
address statically configured or automatically set by method call
before subscription).
SdEventHandler: SdEventHandlerHandleId:
EcucParamConfContainerDef EcucIntegerParamDef
+parameter
lowerMultiplicity = 0 min = 0
upperMultiplicity = * max = 65535
symbolicNameValue = true
SdEventHandlerEventGroupId:
+parameter EcucIntegerParamDef
min = 0
max = 65534
SdEventTriggeringRef:
+reference EcucReferenceDef +desti
SdEventHandlerUdp:
+subContainer EcucParamConfContainerDef lowerMultiplicity = 0
+reference upperMultiplicity = 1
lowerMultiplicity = 0
requiresSymbolicNameValue = true
upperMultiplicity = 1
SdEventHandlerTcp: +reference
EcucParamConfContainerDef SdEventActivationRef:
+subContainer
+reference EcucReferenceDef +desti
lowerMultiplicity = 0
upperMultiplicity = 1 lowerMultiplicity = 0
+reference
upperMultiplicity = 1
requiresSymbolicNameValue = true
SdEventHandlerMulticast:
EcucParamConfContainerDef
+subContainer lowerMultiplicity = 0
upperMultiplicity = 1
+reference SdMulticastEventSoConRef:
EcucReferenceDef +desti
lowerMultiplicity = 1
upperMultiplicity = 1
requiresSymbolicNameValue = true
SdEventHandlerTimerRef: SdServerTimer:
EcucReferenceDef +destination EcucParamConfContainerDef
+reference
lowerMultiplicity = 1 lowerMultiplicity = 0
upperMultiplicity = 1 upperMultiplicity = *
SdEventHandlerMulticastThreshold:
+parameter EcucIntegerParamDef
min = 0
max = 65535
10.2.17 SdEventHandlerMulticast
No Included Containers
10.2.18 SdEventHandlerTcp
4
Description The subcontainer including the Routing Groups for Activation and Trigger Transmit for
Events sent over TCP.
The activation ref (or triggering ref if no activation ref exists) is also being used for
identification of the related socket connections in order to find the related client by
iterating the SdEventHandlerTcp elements (remote address statically configured or
automatically set by opening TCP connection before subscription).
Configuration Parameters
No Included Containers
10.2.19 SdEventHandlerUdp
No Included Containers
10.2.20 SdProvidedMethods
No Included Containers
10.2.21 SdServerCapabilityRecord
4
Default value –
Post-Build Variant Multiplicity true
Post-Build Variant Value true
Multiplicity Configuration Class Pre-compile time X VARIANT-PRE-COMPILE
Link time X VARIANT-LINK-TIME
Post-build time X VARIANT-POST-BUILD
Value Configuration Class Pre-compile time X VARIANT-PRE-COMPILE
Link time X VARIANT-LINK-TIME
Post-build time X VARIANT-POST-BUILD
Scope / Dependency scope: local
No Included Containers
4
Post-Build Variant Value true
Multiplicity Configuration Class Pre-compile time X All Variants
Link time –
Post-build time –
Value Configuration Class Pre-compile time X VARIANT-PRE-COMPILE
Link time X VARIANT-LINK-TIME
Post-build time X VARIANT-POST-BUILD
Scope / Dependency scope: local
No Included Containers
4
Regular Expression –
Post-Build Variant Value false
Value Configuration Class Pre-compile time X All Variants
Link time –
Post-build time –
Scope / Dependency scope: local
No Included Containers