/*
[SWS_Std_00004] ⌈It is not allowed to add any project or supplier specific extension
to this file. Any extension invalidates the AUTOSAR conformity.⌋(SRS_BSW_00161)
*/
/*
[SWS_Std_00014] ⌈The standard types header file shall be protected against multiple
inclusion:
*/
#ifndef STD_TYPES_H
#define STD_TYPES_H

#include "Compiler.h"
#include "Platform_Types.h"

// [SWS_Std_00005] ⌈
typedef uint8 Std_ReturnType;
// ⌋(SRS_BSW_00357)

// [SWS_Std_00006] ⌈
#ifndef STATUSTYPEDEFINED
#define STATUSTYPEDEFINED
#define E_OK 0x00U
typedef unsigned char StatusType; /* OSEK compliance */
#endif
#define E_NOT_OK 0x01U
// ⌋(SRS_BSW_00357)

// [SWS_Std_00015] ⌈
typedef struct {
    uint16 vendorID;
    uint16 moduleID;
    uint8 sw_major_version;
    uint8 sw_minor_version;
    uint8 sw_patch_version;
} Std_VersionInfoType;
// ⌋(SRS_BSW_00004)

// [SWS_Std_00022] ⌈
typedef uint8 Std_TransformerErrorCode;
// ⌋(SRS_Xfrm_00004, SRS_Xfrm_00008)

/*
[SWS_Std_00023] ⌈The underlying data type of the type Std_TransformerClass shall
be uint8.⌋(SRS_Xfrm_00009, SRS_Xfrm_00008)
*/
typedef uint8 Std_TransformerClass;

// [SWS_Std_00024] ⌈
#define STD_TRANSFORMER_UNSPECIFIED 0x00U
#define STD_TRANSFORMER_SERIALIZER 0x01U
#define STD_TRANSFORMER_SAFETY 0x02U
#define STD_TRANSFORMER_SECURITY 0x03U
#define STD_TRANSFORMER_CUSTOM 0xFFU
// ⌋(SRS_Xfrm_00004, SRS_Xfrm_00010)

// [SWS_Std_00021] ⌈
typedef struct {
    Std_TransformerErrorCode errorCode;
    Std_TransformerClass transformerClass;
} Std_TransformerError;
// ⌋(SRS_Xfrm_00004)

/*
[SWS_Std_00028]{DRAFT} ⌈
A safety transformer shall handle the forwarded status according to table 8.1.
⌋(SRS_Xfrm_00002)
*/
#define E_SAFETY_INVALID_REP 0x01U
#define E_SAFETY_INVALID_CRC 0x02U
#define E_SAFETY_INVALID_SEQ 0x03U

// [SWS_Std_00029]{DRAFT} ⌈
typedef uint8 Std_TransformerForwardCode;
// ⌋(SRS_Xfrm_00002)

// [SWS_Std_91001] ⌈
#define STD_MESSAGETYPE_REQUEST 0x00U
#define STD_MESSAGETYPE_RESPONSE 0x01U

typedef uint8 Std_MessageTypeType;
// ⌋(SRS_BSW_00305)

// [SWS_Std_91002] ⌈
#define STD_MESSAGERESULT_OK 0x00U
#define STD_MESSAGERESULT_ERROR 0x01U

typedef uint8 Std_MessageResultType;
// ⌋(SRS_BSW_00305)

// [SWS_Std_91003] ⌈
Std_ReturnType (*Std_ExtractProtocolHeaderFieldsType) (
    const uint8* buffer,
    uint32 bufferLength,
    Std_MessageTypeType* messageType,
    Std_MessageResultType* messageResult
);
// ⌋(SRS_BSW_00004)

// [SWS_Std_00007] ⌈
#define STD_HIGH 0x01U /* Physical state 5V or 3.3V */
#define STD_LOW 0x00U /* Physical state 0V */
// ⌋(SRS_BSW_00348)

// [SWS_Std_00013] ⌈
#define STD_ACTIVE 0x01U /* Logical state active */
#define STD_IDLE 0x00U /* Logical state idle */
// ⌋(SRS_BSW_00348)

// [SWS_Std_00010] ⌈
#define STD_ON 0x01U
#define STD_OFF 0x00U
// ⌋(SRS_BSW_00348)

// [SWS_Std_00031] ⌈
#define NULL_PTR ((void *)0)
// ⌋(SRS_BSW_00480)

#endif /* STD_TYPES_H */
/*
⌋(SRS_BSW_00059)
*/