Standard Types (Std_Types)
Standard types, return codes (Std_ReturnType, E_OK, E_NOT_OK), version info structures, and error codes shared across the entire AUTOSAR architecture.
Typen — Übersicht
enum Std_ReturnTypeThis type can be used as standard API return type which is shared between the RTE and the BSW modules.struct Std_VersionInfoTypeThis type shall be used to request the version of a BSW module using the _ Get Version Info() function.typedef Std_TransformerError-typedef Std_TransformerClass-typedef Std_TransformerForward- Tags: atp.Status=drafttypedef Std_TransformerForwardCode- Tags: atp.Status=draftStd_MessageTypeThis type is used to encode the different type of messages.enum Std_MessageResultTypeThis type is used to encode different types of results for response messages.typedef Std_ExtractProtocolHeaderFieldsTypeType for the function pointer to extract the relevant protocol header fields of the message and the type of the message result...E_OK / E_NOT_OKBecause E_ OK is already defined within OSEK, the symbol E_ OK has to be shared.STD_HIGH / STD_LOWThe symbols STD_ HIGH and STD_ LOW shall be defined as follows: #define STD_ HIGH 0x01u /* Physical state 5V or 3.STD_ACTIVE / STD_IDLEThe symbols STD_ ACTIVE and STD_ IDLE shall be defined as follows: #define STD_ ACTIVE 0x01u /* Logical state active */...STD_ON / STD_OFFThe symbols STD_ ON and STD_ OFF shall be defined as follows: #define STD_ ON 0x01u #define STD_ OFF 0x00u
Typen — Detailansicht
类型 Std_ReturnType [SWS_Std_00005] 📄 PDF
typedef uint8 Std_ReturnType;
This type can be used as standard API return type which is shared between the RTE and the BSW modules. It shall be defined as follows: typedef uint8 Std_ Return Type;
类型 Std_ReturnType 用作 API 函数的标准化返回类型,由 RTE 和 BSW 模块共同使用([SWS_Std_00005])。它可通过头文件 Std_Types.h 获取,并定义为 uint8([SWS_Std_00005])。
默认情况下,Std_ReturnType 被赋予值 E_OK(值 0)或 E_NOT_OK(值 1)([SWS_Std_00005]、[SWS_Std_00011])。如果这两个标准返回值不够用,标准允许定义特定于模块的错误值:
-
用户错误的值范围:对于用户自定义错误码,可以使用
0x02到0x3F的范围([SWS_Std_00005])。此处使用了六个最低有效位([SWS_Std_00011])。 - 命名规范:在命名特定于用户的错误值时,根据 BSW 规范必须强制加上相应的前缀([SWS_Std_00011])。
- RTE 保留:位 7 和位 8 保留并由 RTE 规范指定,返回类型的通用布局亦遵循该规范([SWS_Std_00011])。Interpretation:这可能是 8 位表示形式中的两个最高有效位,它们将六个低有效位补全为一个字节。 问题 Q-d97256956c510f58 (未决)
源材料中未对基本类型本身定义特定的错误处理机制(如 DET 或 DEM)以及重入性规范,而是由使用该类型作为返回值的各个 API 负责。
此使用说明由 AI 创建,基于 AUTOSAR Classic Release R20-11 的规范。
实现者指南即将推出(复杂度 I1)
类型 Std_VersionInfoType [SWS_Std_00015] 📄 PDF
typedef struct { uint16 vendorID; uint16 moduleID; uint8 sw_major_version; uint8 sw_minor_version; uint8 sw_patch_version; } Std_VersionInfoType;
This type shall be used to request the version of a BSW module using the
类型 Std_TransformerError [SWS_Std_00021] 📄 PDF
typedef uint8 Std_TransformerError;
-
根据需求 [SWS_Std_00021],数据类型 Std_TransformerError 作为标准化类型通过头文件 Std_Types.h 为 AUTOSAR Classic 平台提供。在结构上,该元素在规范中定义为结构体(Structure),由两个组件组成:具有基本类型 uint8 的元素 errorCode 以及具有类型 Std_TransformerClass 的元素 transformerClass [SWS_Std_00021]。
关于实际使用,规范中不包含具体的函数签名、参数描述或返回值。该结构体类型可能用作统一定义的数据容器,用于结构化传输数据转换期间发生的错误(Interpretation)。 问题 Q-6e0938f276d60fd3 (未决)其中字段 errorCode 可能会承载实际的数值错误键,而 transformerClass 则识别导致错误的或关联的 Transformer 类(Interpretation)。 问题 Q-d8806698683ec00e (未决)
[SWS_Std_00021] 中未定义诸如 DET 或 DEM 消息等特定的错误处理机制。源材料中也缺少关于并发性、可重入性或同步/异步语义的规范。由于这只是 Std_Types.h 中的纯类型定义,因此该类型本身不受任何运行时限制约束;这些限制仅由应用模块各自的上下文产生。
本段文本由人工智能基于 AUTOSAR 规范 R20-11 生成。
类型 Std_TransformerClass [SWS_Std_00024] 📄 PDF
typedef uint8 Std_TransformerClass;
-
类型 Std_TransformerForward [SWS_Std_00027] 📄 PDF
typedef uint8 Std_TransformerForward;
- Tags: atp.Status=draft
类型 Std_TransformerForwardCode [SWS_Std_00029] 📄 PDF
typedef uint8 Std_TransformerForwardCode;
- Tags: atp.Status=draft
类型 Std_MessageType [SWS_Std_91001] 📄 PDF
This type is used to encode the different type of messages. - Currently this encoding is limited to the distinction between requests and responses in C/ S c ommunication.
根据 [SWS_Std_91001],标准类型 Std_MessageType 用于对各种报文类型进行编码。在本规范中,此编码仅限于在客户端/服务器通信框架内区分请求(Request)与响应(Response)([SWS_Std_91001])。
该数据类型派生自基本类型 uint8,并通过头文件 Std_Types.h 提供给软件组件以及基础软件模块([SWS_Std_91001])。针对赋值和评估,指定了以下值和常量:
STD_MESSAGETYPE_REQUEST(值0x00):标识请求报文([SWS_Std_91001])。STD_MESSAGETYPE_RESPONSE(值0x01):标识响应报文([SWS_Std_91001])。- 值范围
0x02至0x3F:该范围保留用于未来的报文类型([SWS_Std_91001])。
关于应用和约束条件,实现模块应仅使用已定义的标识符。由于从 0x02 到 0x3F 的值保留用于未来的 AUTOSAR 扩展,因此不得擅自占用作其他用途([SWS_Std_91001])。规范中未为此数据类型定义特定的错误码、返回值、异步流程或向 DET 或 DEM 的报告([SWS_Std_91001])。
该文本由 AI 管理助手生成,基于 AUTOSAR R20-11 的规范。
类型 Std_MessageResultType [SWS_Std_91002] 📄 PDF
typedef uint8 Std_MessageResultType;
This type is used to encode different types of results for response messages. - Currently this encoding is limited to the distinction between OK and ERROR responses.
基础数据类型 Std_MessageResultType 在 AUTOSAR Classic 平台中用于对响应消息(Response Messages)的各种结果类型进行编码 [SWS_Std_00019]。该类型通过标准头文件 Std_Types.h 提供,并定义为基于 uint8 的标量类型 [SWS_Std_91002]。
使用与取值范围
该规范要求使用 Std_MessageResultType 对响应消息进行统一标识 [SWS_Std_00019]。目前,该编码的预期功能范围仅限于成功响应和错误响应之间的基本区分 [SWS_Std_91002]。为此定义了以下固定结果值:
STD_MESSAGERESULT_OK(值0x00):标识响应消息的常规、无错误结果 [SWS_Std_91002]。STD_MESSAGERESULT_ERROR(值0x01):指示错误响应消息(Error Response)的结果 [SWS_Std_91002]。
限制与未来扩展
从 0x02 到 0x3F 的取值范围显式保留用于未来的消息结果 [SWS_Std_91002]。解释:由于规范当前未规定其他有效返回值,解析模块可能必须进行防御性编程,以安全捕获该范围内意外或尚未分配的值 [SWS_Std_00019]。 问题 Q-5f652f73800b7d94 (未决)
本文档由 AI 创建,为开发人员总结了 AUTOSAR 规范的各项规定。
类型 Std_ExtractProtocolHeaderFieldsType [SWS_Std_91003] 📄 PDF
typedef Std_ReturnType (* Std_ExtractProtocolHeaderFieldsType)(const uint8* buffer, uint32 bufferLength, Std_MessageTypeType* messageType, Std_MessageResultType* messageResult);
Type for the function pointer to extract the relevant protocol header fields of the message and the type of the message result of a transformer. - At the time being, this is limited to the types used for C/ S communication (i.e., REQUE ST and RESPONSE and OK and ERROR).
类型 E_OK / E_NOT_OK [SWS_Std_00006] 📄 PDF
#define E_OK 0x00u #define E_NOT_OK 0x01u
Because E_ OK is already defined within OSEK, the symbol E_ OK has to be shared. To avoid name clashes and redefinition problems, the symbols have to be defined in the following way (approved within implementation): #ifndef STATUSTYPEDEFINED #define STATUSTYPEDEFINED #define E_ OK 0x00u typedef unsigned char Status Type; /* OSEK compliance */ #endif #define E_ NOT_ OK 0x01u
类型 STD_HIGH / STD_LOW [SWS_Std_00007] 📄 PDF
#define STD_HIGH 0x01u #define STD_LOW 0x00u
The symbols STD_ HIGH and STD_ LOW shall be defined as follows: #define STD_ HIGH 0x01u /* Physical state 5V or 3.3V */ #define STD_ LOW 0x00u /* Physical state 0V */
类型 STD_ACTIVE / STD_IDLE [SWS_Std_00013] 📄 PDF
#define STD_ACTIVE 0x01u #define STD_IDLE 0x00u
The symbols STD_ ACTIVE and STD_ IDLE shall be defined as follows: #define STD_ ACTIVE 0x01u /* Logical state active */ #define STD_ IDLE 0x00u /* Logical state idle */
类型 STD_ON / STD_OFF [SWS_Std_00010] 📄 PDF
#define STD_ON 0x01u #define STD_OFF 0x00u
The symbols STD_ ON and STD_ OFF shall be defined as follows: #define STD_ ON 0x01u #define STD_ OFF 0x00u
Request a governed re-review of this record. The record is not changed immediately.
- Record
AUTOSAR/AP/record/CP_MOD_Std- Status
- unspecified
- Version
AUTOSAR/AP/record/CP_MOD_Std@rel:R20-11#2235715d- Content hash
2235715d- Source
- https://www.autosar.org/fileadmin/standards/R20-11/CP/AUTOSAR_SWS_StandardTypes.pdf#nameddest=SWS_Std_00005
gemini-3.8-flash-low· 2026-10-13 · 德文原文