规范标准

  • ECUs shall distribute available Service Instances and Service Instances needed as well as the Eventgroups of these Service Instances. For this purpose, they exchange entries using Service Discovery messages. This chapter describes how these entries are encoded to offer and find services as well as find and subscribe Eventgroups.
    ECU应分发已有的的Service Instances和所需的Service Instances以及包含这些Service Instances的Eventgroup。 为此,他们使用Service Discovery消息来交换entry。 本章介绍如何对这些条目进行编码以offer和find服务以及find和subscribe 这些Eventgroups。
  • The following overview table shows to which value the Type field and the TTL field have to be set:
    以下概览表显示了Type字段和TTL字段必须设置为哪个值:

Entry Format Type

Two types of Entries exist: Type 1 Entries for Services and Type 2 Entries for Eventgroups.

Layout of Type 1 Entries (Entries for Service)
Layout of Type 2 Entries (Entries for Eventgroups)

Type field of the Entry:

  • Layout of Type 1 Entries (Entries for Service):
    0x00:FindService
    0x01:OfferService和StopOfferService
  • Layout of Type 2 Entries ( Entries for Eventgroups)
    0x06:SubscribeEventgroup和StopSubscribeEventgroup
    0x07:SubscribeEventgroupAck和SubscribeEventgroupNack

Entry Format

  • If the number of options is set to zero, the option run is considered empty.
    如果option的数量设置为零,则option run被视为空。
  • For empty runs the Index shall be set to zero.
    如果option run为空,index也应设置为零。
  • Implementations shall accept and process incoming SD messages with option run length set to zero and option index not set to zero.
    实施应接受并处理option run length设置为0且option index未设置为0的SD传入消息。

Index 1st options

the index of the first option of the first option run of this entry in the option array
option array中的第一个 option run中的第一个option的索引

Index 2st options

the index of the first option of the second option run of this entry in the option array
option array中的第二个option run中的第一个option的索引

# of opt 1

the “Number of Option 1” shall carry the number of options the first option run uses
“Number of Option 1”应包含first option run使用的选项的数量

#of opt 2

the “Number of Option 2” shall carry the number of options the second option run uses
“Number of Option 2”应包含second option run使用的选项的数量

Service ID and Instance ID

  • Service ID 和 instance ID字段应具有固定的16位大小。
    Servcie或者Eventgroups的Service ID使用参数SdServerServiceID和SdClientServiceID进行静态配置,具体取决于服务器或客户端entry。
    Service或者Eventgroups Service的Instance ID使用参数SdServerServiceInstanceID和SdClientServiceInstanceID进行静态配置,具体取决于服务器还是客户端entry。
  • If not a single but all instances are addressed, the Instance ID field of the Type 1 Entry format layout shall be set to 0xFFFF
    对于Entries for Service,如果不是单个实例而是所有实例都被寻址,instance ID字段应设置为0xFFFF。

Major version

  • The Major Version field shall have a fixed size of 8 bits.
    Major Version字段应具有固定的8位大小。
  • The Major Version field shall carry the SdServerServiceMajorVersion and SdClientServiceMajorVersion, depending on being a server or client entry.
    Major Version字段应包含SdServerServiceMajorVersion和SdClientServiceMajorVersion,具体取决于服务器或客户端entry。

Minor Version

  • The Minor Version field of the Type 1 Entry format layout shall have a fixed size of 32 bits.
    Type类型1条目格式布局的Minor Version应具有固定的32位大小。
  • The Minor Version field of the Type 1 Entry format layout shall carry the SdServerServiceMinorVersion and SdClientServiceMinorVersion.
    Type类型1条目格式布局的Minor Version字段应携带SdServerServiceMinorVersion和SdClientServiceMinorVersion。

TTL

  • The TTL field shall have a fixed size of 24 bits.
    TTL字段应具有固定的24位大小。
  • The TTL defines the lifetime of the entry.
    TTL字段定义条目的生存期。
  • The TTL field defines the lifetime of the entry in seconds configured using the parameter SdServerTimerTTL and SdClientTimerTTL, except for Stop- or Nack-Entries, which use a TTL of 0.
    TTL字段使用参数SdServerTimerTTL和SdClientTimerTTL以秒为单位定义生命周期,除了TTL本身为0的Stop-或Nack-Entry外。

Reserved Field

  • The Reserved field shall have a fixed size of 16 bits.
    保留字段应具有固定的16位大小。
  • The Reserved field, which follows the TTL field shall be statically set to 0x0000.
    TTL字段后面的保留字段应静态设置为0x0000。

Eventgroup ID

  • The Eventgroup ID field shall have a fixed size of 16 bits.
    Eventgroup ID字段应具有固定的16位大小。
  • The Eventgroup ID field shall carry the ID of an Eventgroup, configured using the parameter SdConsumedEventGroupID.
    Eventgroup ID字段应携带使用参数SdConsumedEventGroupID配置的事件组的ID。
  • An eventgroup shall be identified using the Eventgroup-ID.
    一个事件组需要使用Eventgroup ID。
  • Different eventgroups of a service shall have different Eventgroup-IDs.
    服务的不同Eventgroup应具有不同的 Eventgroup ID。
  • An event shall be part of zero to many eventgroups and an eventgroup shall contain zero to many events. A field shall be part of zero to – many eventgroups and an eventgroup can contain zero to many fields.
    一个Event应该是许多Eventgroup的一部分,一个Eventgroup应包含许多Event。一个Field应该是许多Eventgroup的一部分,而Eventgroup可以包含许多Field。
  • Currently empty eventgroups are not used and events as well as fields are mapped to at least one eventgroup.
    目前没有使用空的Eventgroups ,Event以及Field被映射到至少一个Eventgroup 。

Entries Array

  • When SOME/IP-SD find or offers Service Instances or handles subscriptions this is done by so called entries, which are transported in the entry array of the SOME/IP-SD message.
    当SOME / IP-SD寻找或提供服务实例或处理订阅时,这由所谓的entry完成,entry在SOME / IP-SD 报文的entry数组中传输。

Length of Entries Array

  • The length of the first field of the Entries Array shall be 32 bits.
    Entries Array的第一个字段的长度应为32位。
  • The first field of the Entries Array shall carry the amount of bytes of the Entries Array (excluding this 32 bit field carrying the length information).
    Entries Array的第一个字段应携带Entries Array的字节数量(不包括携带长度信息的32位字段)。

Reserved field [24 Bit]

  • The length of the Reserved field shall be 24 bits.
    保留字段的长度应为24位。
  • This Reserved field is not currently used and left empty for further enhancements of the SOME/IP-SD protocol.
    此保留字段当前未被使用并留空以进一步增强SOME / IP-SD协议。
  • All bits of the Reserved field shall be statically set to 0 binary.
    保留字段的所有位应静态设置为0。

Flags [8 Bit]

  • The length of the Flags field shall be 8 bits.
    Flag字段的长度应为8位。
  • 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.
    SOME / IP-SD Header开始便是Flags字段。它用于标识全局Service Discovery信息,其中包括当前最后一次重新启动的状态以及接收单播消息的能力。
  • Undefined bits within the Flag field shall be statically set to ‘0’.
    Flag字段中的未定义位应静态设置为 ‘0’。

Reboot Flag [8 Bit]

  • The first bit of the Flags field (highest order bit) shall be called Reboot Flag.
    Flag字段(最高位)的第一位称为重启标志。
  • The Reboot Flag shall be set to ‘1’ for all messages after reboot until the Session ID of the Request ID field wraps and thus starts with 0x0001 again. After that the Reboot Flag shall be set to ‘0’.
    重启后,所有消息的Reboot Flag必须设置为 ‘1’,直到Request ID字段中的 Session ID循环并因此再次以0x0001开头。之后, Reboot Flag将被设置为 ‘0’。
  • The Service Discovery shall keep track of the last received of a communication partner Session ID value and Reboot Flag value independently for unicast and multicast. This means that the communication partners values received over multicast shall not be updated by a unicast message.
    Service Discovery应独立记录通信伙伴最后收到的单播和多播的Session ID值和and Reboot Flag值。这意味着通过多播接收的通信伙伴值不应被单播消息更新。
  • A reboot of the communication partner shall be detected based on consecutive Service Discovery messages (for communication partner; unicast and multicast separated) in the following two ways:
    应根据连续的服务发现消息(用于通信伙伴;单播和多播分开)检测通信伙伴是否重新启动,具体方法有如下两种:
    • Reboot Flag changes from ‘0’ to ‘1’
      Reboot Flag标志从 ‘0’更改为 ‘1’
    • Session ID decreases, while Reboot Flag stays ‘1’
      Session ID减少,同时Reboot Flag标志保持 ‘1’
  • The Service Discovery may also detect reboots based on the unicast information.
    服务发现还可以检测基于单播信息的重新启动。
  • A reboot detected with Session ID and Reboot Flag shall lead to expiration of the local state that is controlled by this communication partner.
    使用Session ID和Reboot Flag标志检测到的Reboot应导致由此通信伙伴控制的本地状态到期。
  • 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) .
    如果客户端在使用服务的服务器Reboot ,则客户端应按照收到Stop Offer entry的方式处理这个Reboot (另请参阅SWS_SD_00367了解更多详细信息)。
  • 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).
    如果客户端在使用服务的服务器Reboot ,则服务器应像收到StopSubscribeEventgroup条目一样处理这个Reboot (另请参阅SWS_SD_00345了解更多详细信息)。

Unicast Flag [1 Bit]

  • The second bit of the Flag field (second highest order bit) shall be called Unicast Flag.
    标志字段的第二位(第二高位)应称为单播标志。
  • The Unicast Flag of the Flag field shall be set to Unicast Flag and shall be set to ‘1’ , meaning: This ECU supports receiving Unicast messages.
    标志字段的单播标志应设置为单播标志,并设置为 ‘1’,表示:该ECU支持接收单播消息。