Return Code返回代碼
- The Error Handling is based on an 8 Bit Std_returnType of AUTOSAR. The two most significant bits are reserved and shall be set to 0. The receiver of a return code shall ignore the values of the two most significant bits.
錯誤處理基于AUTOSAR的8位Std_returnType。兩個最高有效位保留,并應設置為0.接收返回代碼時應忽略兩個最高有效位的值。
- The system shall not return an error message for events/notifications.
系統不應針對events/notification返回錯誤消息。
- The system shall not return an error message for fire&forget methods.
系統不應針對fire&forget method返回錯誤消息。
- The system shall not return an error message for events/notifications and fire&forget methods if the Message Type is set incorrectly to Request or Response.
如果消息類型被不正確地設置為Request or Response ,則系統也不應返回錯誤消息給events/notification 和 fire&forget method。
- For request/response methods the error message shall copy over the fields of the SOME/IP header (i.e. Message ID, Request ID, and Interface Version) but not the payload. In addition Message Type and Return Code have to be set to the appropriate values.
對于Request/Response method, error消息應復制SOME / IP header(比如消息ID,請求ID和接口版本),但不包括payload。此外,必須將Message Type 和Return Code設置為適當的值。

- The SOME/IP implementation shall not use an unknown protocol version but write a supported protocol version in the header.
實施SOME / IP不應使用未知protocol version ,而是在header中寫入支持的協議版本。
- Generation and handling of return codes shall be configurable.
返回碼的生成和處理應該是可配置的。
- Implementations shall not answer with errors to SOME/IP message already carrying an error (i.e. return code 0x01 – 0x1f).
在實現上,不應用含有error的SOME/IP消息去回復已經攜帶了error的消息(比如. 返回碼 0x01 – 0x1f)。
- The following Return Codes are currently defined and shall be implemented as described:
目前定義了以下返回代碼,應按如下描述進行實施:
| ID | Name | Description |
| 0x00 | E_OK | No error occurred |
| 0x01 | E_NOT_OK | An unspeci?ed error occurred |
| 0x02 | E_UNKNOWN_SERVICE | The requested Service ID is unknown. |
| 0x03 | E_UNKNOWN_METHOD | The requested Method ID is unknown. Service ID is known. |
| 0x04 | E_NOT_READY | Service ID and Method ID are known. Application not running. |
| 0x05 | E_NOT_REACHABLE | System running the service is not reachable (internal error code only). |
| 0x06 | E_TIMEOUT | A timeout occurred (internal error code only). |
| 0x07 | E_WRONG_PROTOCOL_ VERSION | VersionofSOME/IPprotocolnotsupported |
| 0x08 | E_WRONG_INTERFACE_ VERSION | Interface version mismatch |
| 0x09 | E_MALFORMED_MESSAGE | Deserialization error, so that payload cannot be deserialized. |
| 0x0a | E_WRONG_MESSAGE_TYPE | An unexpected message type was received (e.g. REQUEST_NO_RETURN for a method de?ned as REQUEST.) |
| 0x0b – 0x1f | RESERVED | Reserved for generic SOME/IP errors. These errors will be speci?ed in future versions of this document. |
| 0x20 – 0x3f | RESERVED | Reservedforspeci?cerrorsofservicesand methods. These errors are speci?ed by the interface speci?cation. |
Error Message Format錯誤消息格式
- For a more flexible error handling, SOME/IP allows the user to specify a message layout specific for errors instead of using the message layout for response messages. This is defined by the interface specification and can be used to transport exceptions of higher level programming languages.
為了實現更靈活的error處理,SOME / IP允許用戶指定專門的error message布局,而不是沿用response message的布局。 這由接口規范定義,可用于傳輸更高級編程語言的異常。
- The recommended layout for the exception message is the following:
異常消息的推薦布局如下:
- -Union of specific exceptions. At least a generic exception without fields needs to exist.
特定異常的union。至少存在一個沒有字段的通用異常。
- -Dynamic Length String for exception description.
動態長度字符串用于異常描述。
- The union gives the flexibility to add new exceptions in the future in a type-safe manner. The string is used to transport human readable exception descriptions to ease testing and debugging.
union提供了以type-safe方式在將來添加新異常的靈活性。 該字符串用于傳輸具有可讀性的異常描述,以便于測試和調試。
