SOME/IP報(bào)文-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允許客戶端區(qū)分相同的Method的多個(gè)call 。 Request ID對(duì)于客戶端和服務(wù)器的一個(gè)組合來(lái)說(shuō),需要時(shí)唯一的。 在生成響應(yīng)消息時(shí),服務(wù)器必須將請(qǐng)求中的Request ID復(fù)制到response消息中。 這允許客戶將響應(yīng)映射到發(fā)出的請(qǐng)求,即使有多個(gè)請(qǐng)求未完成。
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.
只要響應(yīng)已經(jīng)接收到或者不再期望這個(gè)響應(yīng)(超時(shí)),就可以重新使用Request ID。 在汽車使用案例中,只有很少數(shù)量的未完成的請(qǐng)求在被繼續(xù)等待。 小型系統(tǒng)里在沒(méi)有并行請(qǐng)求的可能性的情況下, Request ID可能總是設(shè)置為相同的值。
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 架構(gòu)下, Request ID需要結(jié)構(gòu)化。 即使對(duì)于非AUTOSAR系統(tǒng),也需要對(duì)調(diào)用者的客戶端ID進(jìn)行編碼
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 de?ne the Client-IDs as required by his implementation and the Server does not need to know this layout or de?nitions because he just copies the complete Request-ID in the response.
這意味著ECU的實(shí)施者可以按照他的實(shí)施要求來(lái)定義Client ID,并且服務(wù)器不需要知道這個(gè)布局或定義,因?yàn)樗皇菍⒄麄€(gè)Request-ID復(fù)制到Response中。
The Client ID is the unique identi?er for the calling client inside the ECU. The Session ID is a unique identi?er chosen by the client for each call. If session handling is not used, the Session ID shall be set to 0x0000.
Client ID是ECU內(nèi)Call客戶端的唯一標(biāo)識(shí)符。 Session ID是客戶端為每個(gè)call選擇的唯一標(biāo)識(shí)符。 如果不需要進(jìn)行Session處理,則Session ID應(yīng)設(shè)置為0x0000。
The Client ID shall also support being unique in the overall vehicle by having a con?gurable pre?x or ?xed value (e.g. the most signi?cant byte of Client ID being the diagnostics address or a con?gured Client ID for a given application/SW-C).c()
Client ID還應(yīng)通過(guò)具有可配置前綴或固定值支持其在整個(gè)車輛中唯一性(例如,Client ID的最高位是診斷地址或?yàn)樘囟☉?yīng)用程序/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開(kāi)頭的session 來(lái)處理
Events,noti?cation 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處理,如果應(yīng)用需要的話。比如因?yàn)楣δ馨踩男枰?
For events,noti?cation events,and Fire&Forget methods the Session ID should start with 1 and be incremented for every message sent.
對(duì)于events,noti?cation events,和 Fire&Forget methods ,Session ID需要以0x0001開(kāi)頭,且每次message發(fā)出的時(shí)候遞增。
When the Session ID reaches 0xFFFF, it shall start with 0x0001 again.
當(dāng)Session ID達(dá)到0xFFFF,則其回到0x0001重新開(kāi)始
