SOME/IP报文-Request ID
Request ID [32 Bit]
The Request ID allows a client to differentiate multiple calls to the same method. Therefore, the Request ID has to be unique for a single client and server combination only. When generating a response message, the server has to copy the Request ID from the request to the response message. This allows the client to map a response to the issued request even with more than one request outstanding.
Request ID允许客户端区分相同的Method的多个call 。 Request ID对于客户端和服务器的一个组合来说,需要时唯一的。 在生成响应消息时,服务器必须将请求中的Request ID复制到response消息中。 这允许客户将响应映射到发出的请求,即使有多个请求未完成。
Request ID might be reused as soon as the response arrived or is not expected to arrive anymore(timeout). In most automotive use cases a very low number of outstanding requests are expected. For small systems without the possibility of parallel requests, the Request ID might always set to the same value.
只要响应已经接收到或者不再期望这个响应(超时),就可以重新使用Request ID。 在汽车使用案例中,只有很少数量的未完成的请求在被继续等待。 小型系统里在没有并行请求的可能性的情况下, Request ID可能总是设置为相同的值。
For AUTOSAR systems the Request ID needs to be structured as shown in the next section. Even for non-AUTOSAR systems it is required to encode the callers Client ID as shown in the next section.
在AUTOSAR 架构下, Request ID需要结构化。 即使对于非AUTOSAR系统,也需要对调用者的客户端ID进行编码
Client ID [16 Bit]
In AUTOSAR the Request ID is constructed of the Client ID and Session ID:
Note注意:
This means that the implementer of an ECU can define the Client-IDs as required by his implementation and the Server does not need to know this layout or definitions because he just copies the complete Request-ID in the response.
这意味着ECU的实施者可以按照他的实施要求来定义Client ID,并且服务器不需要知道这个布局或定义,因为他只是将整个Request-ID复制到Response中。
The Client ID is the unique identifier for the calling client inside the ECU. The Session ID is a unique identifier chosen by the client for each call. If session handling is not used, the Session ID shall be set to 0x0000.
Client ID是ECU内Call客户端的唯一标识符。 Session ID是客户端为每个call选择的唯一标识符。 如果不需要进行Session处理,则Session ID应设置为0x0000。
The Client ID shall also support being unique in the overall vehicle by having a configurable prefix or fixed value (e.g. the most significant byte of Client ID being the diagnostics address or a configured Client ID for a given application/SW-C).c()
Client ID还应通过具有可配置前缀或固定值支持其在整个车辆中唯一性(例如,Client ID的最高位是诊断地址或为特定应用程序/SWC配置专门Client ID)
Client ID不用于Service Discovery
Session ID [16 Bit]
Request/Response methods shall use session handling with Session IDs starting with 0x0001.
Request/Response method需要使用以ID以0x0001开头的session 来处理
Events,notification events,and Fire&Forget methods shall use session handling if required by the application. This could be for example because of functional safety reasons.
Event, notification event和Fire&Forget methods 需要使用session处理,如果应用需要的话。比如因为功能安全的需要
For events,notification events,and Fire&Forget methods the Session ID should start with 1 and be incremented for every message sent.
对于events,notification events,和 Fire&Forget methods ,Session ID需要以0x0001开头,且每次message发出的时候递增。
When the Session ID reaches 0xFFFF, it shall start with 0x0001 again.
当Session ID达到0xFFFF,则其回到0x0001重新开始