欢迎来到尧图网

客户服务 关于我们

您的位置:首页 > 新闻 > 国际 > SOME/IP-SD -- 协议英文原文讲解11

SOME/IP-SD -- 协议英文原文讲解11

2025/4/9 10:00:38 来源:https://blog.csdn.net/weixin_44209111/article/details/146936588  浏览:    关键词:SOME/IP-SD -- 协议英文原文讲解11

前言
SOME/IP协议越来越多的用于汽车电子行业中,关于协议详细完全的中文资料却没有,所以我将结合工作经验并对照英文原版协议做一系列的文章。基本分三大块:

1. SOME/IP协议讲解

2. SOME/IP-SD协议讲解

3. python/C++举例调试讲解


[PRS_SOMEIPSD_00461]
Upstream requirements: RS_SOMEIPSD_00015
The client shall open a TCP connection to the server before sending the Subscribe
Eventgroup entry if the Service is offered over TCP and the client requests an Eventgroup over TCP according to the configuration.
之前有提:tcp订阅的事件,client要先建立TCP连接
[PRS_SOMEIPSD_00830]
Upstream requirements: RS_SOMEIPSD_00015
A client which wants to subscribe to an eventgroup of a service which demands a security association shall start (if not already started) to establish the security and wait until the security association is established. The client shall send a SubscribeEventgroup
entry for an eventgroup of this service after the security association is established.

Note: For security associations which demand that only one participant is allowed to
start establishing the security association (like TLS/DTLS), each ECU shall use different endpoints for server services and client service to ensure that the ECU is acting for
each secured connection either as a client (which shall start establishing the security
association) or as a server.
TCP 连接如果带了TLS 安全连接的话,要先建立TLS的安全连接

[PRS_SOMEIPSD_00462]
Upstream requirements: RS_SOMEIPSD_00015
After a client has sent a Subscribe Eventgroup entry the server shall send a Subscribe
Eventgroup Ack entry.
之前有提:client订阅报文 server需要回复
[PRS_SOMEIPSD_00463]
Upstream requirements: RS_SOMEIPSD_00015
The client shall wait for the Subscribe Eventgroup Ack entry acknowledging a Subscribe Eventgroup entry. If this Subscribe Eventgroup Ack entry does not arrive before
the next Subscribe Eventgroup entry is sent, the client shall do the following:
• Send a Stop Subscribe Eventgroup entry and a Subscribe Eventgroup entry in
the same SOME/IP-SD message the Subscribe Eventgroup entry would have
been sent with

Note:
This behavior exists to cope with short durations of communication loss, so new Initial
Events are triggered to lower the effects of the loss of messages.
client在发出订阅包之后 迟迟拿不到回复,但是下一包订阅有需要发送了,则在发送下一包订阅之前 需要发送停止订阅包。
可以把停止订阅和订阅包 放在同一条报文中,一般这样做是为了防止漏掉field事件那种带初始化信息回复。


[PRS_SOMEIPSD_00577]
Upstream requirements: RS_SOMEIPSD_00015
The requirement [PRS_SOMEIPSD_00463] shall not be applied to Offer Service entries that are a reaction to Find Service entries. This means that the Subscribe Eventgroup Ack entry of a Subscribe Eventgroup entry that was triggered by a unicast Offer
Service entry is not monitored as well as upon a unicast Offer Service entry the Stop
Subscribe Eventgroup entry/Subscribe Eventgroup entry is not sent.
Rationale:
If a client sends a Subscribe Eventgroup entry as a reaction to a unicast offer, and a
multicast offer arrives immediately after that but before the the Subscribe Eventgroup
Ack entry could be sent by the server and received, the client shall not complain (i.e.
Stop Subscribe/Subscribe) about a not yet received acknowledgement.
Note:
This behavior exists to cope with short durations of communication loss. The receiver
of a Stop Subscribe Eventgroup and Subscribe Eventgroup combination would send
out initial values for field notifiers to lower the effects of the loss of messages (see
[PRS_SOMEIPSD_00122]).
结合上一条需求,针对client发送的find报文时 client回复的单播offer 不需要遵循上面的stopsub+sub的规则,因为后面的多播offer会覆盖前面的多播offer状态


[PRS_SOMEIPSD_00464]
Upstream requirements: RS_SOMEIPSD_00015
The server shall send the first notifications/events (i.e. initial values) according to
[PRS_SOMEIPSD_00120] immediately after sending the Subscribe Eventgroup Ack.
之前有提到:服务端 在收到客户端订阅 field 这种带初始化值的 事件 订阅包时,要立即回复初始化值给客户端

[PRS_SOMEIPSD_00465]
Upstream requirements: RS_SOMEIPSD_00015
The server shall not send initial values of events (i.e., pure events and not fields) upon
subscriptions.
如果只是普通的event不是field事件 则不需要回复 初始化值。

[PRS_SOMEIPSD_00120]
Upstream requirements: RS_SOMEIPSD_00015
The server shall send initial values of field notifiers (i.e., fields and not pure events)
upon subscriptions.
[PRS_SOMEIPSD_00861] Server based distinction between field notifiers and
pure events
Upstream requirements: RS_SOMEIPSD_00015
The distinction between field notifiers and pure events shall be taken based on the
configuration of the server.
是field还是单纯的event则 根据 客户指定 的server配置需求来。

[PRS_SOMEIPSD_00121]
Upstream requirements: RS_SOMEIPSD_00015
If a subscription was already valid and is updated by a Subscribe Eventgroup entry,
no initial values shall be sent.
Note: [PRS_SOMEIPSD_00465], [PRS_SOMEIPSD_00120], and
[PRS_SOMEIPSD_00861] imply that even if a client explicitly requests the
sending of initial values and thus the trigger on the server side according to
[PRS_SOMEIPSD_00122] is fullfilled, no initial values shall be sent by the server for
members of the Eventgroup which (according to the server’s own configuration) are
pure events (and not fields).

[PRS_SOMEIPSD_00122]
Upstream requirements: RS_SOMEIPSD_00015
The reception of a Stop Subscribe Eventgroup entry and a Subscribe Eventgroup
entry in the same SOME/IP-SD message shall trigger the server to send initial values
of field notifiers.

field 订阅后发过 初始化事件了,后面订阅不会再发了,除非遇到订阅重置(stopsub+sub)

 

[PRS_SOMEIPSD_00466]
Upstream requirements: RS_SOMEIPSD_00015, RS_SOMEIPSD_00016
Publish/Subscribe States (server behavior for unicast eventgroups) are defined as
follows:
• Eventgroup_PubSub (Unicast Eventgroup)
– Service Down
– Service Up
∗ Not Subscribed
∗ Subscribed
Initial entry points of Eventgroup_PubSub (Unicast Eventgroup) are inside the
following states:
• Eventgroup_PubSub (Unicast Eventgroup)
– Service Up
Transitions inside Eventgroup_PubSub (Unicast Eventgroup) are defined as
follows:
FROM entry point Eventgroup_PubSub (Unicast Eventgroup)
TO Service Down
WITH [Service==Down]
FROM Service Down
TO Service Up
WITH ServiceUp
FROM Service Up
TO Service Down
WITH ServiceDown
FROM entry point Eventgroup_PubSub (Unicast Eventgroup)
TO Service UP
WITH [Service==Up]

FROM entry point Service Up
TO Not Subscribed
FROM Not Subscribed
TO Subscribed
WITH receive(SubscribeEventgroup) /enableEvents()
send(SubscribeEventgroupAck)
FROM Subscribed
TO Subscribed
WITH receive(SubscribeEventgroup) /send(SubscribeEventgroupAck)
FROM Subscribed
TO Not Subscribed
WITH receive(StopSubscribeEventgroup) /disableEvents()
FROM Subscribed
TO Not Subscribed
WITH TTL_expired [SubscriptionCounter==1] /disableEvents()

对于server而言的 收到sub或是 stopsub后的 编程指导

 

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com

热搜词