-
Notifications
You must be signed in to change notification settings - Fork 2
/
ComStack_Types.h
120 lines (109 loc) · 6.47 KB
/
ComStack_Types.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
/*******************************************************************************
** **
** Copyright (C) AUTOSarZs olc (2019) **
** **
** All rights reserved. **
** **
** This document contains proprietary information belonging to AUTOSarZs **
** olc . Passing on and copying of this document, and communication **
** of its contents is not permitted without prior written authorization. **
** **
********************************************************************************
** **
** FILENAME : ComStack_Types.h **
** **
** VERSION : 1.0.0 **
** **
** DATE : 2019-09-22 **
** **
** VARIANT : Variant PB **
** **
** PLATFORM : TIVA C **
** **
** AUTHOR : AUTOSarZs-DevTeam **
** **
** VENDOR : AUTOSarZs OLC **
** **
** **
** DESCRIPTION : CAN Driver source file **
** **
** SPECIFICATION(S) : Specification of CAN Driver, AUTOSAR Release 4.3.1 **
** **
** MAY BE CHANGED BY USER : no **
** **
*******************************************************************************/
#ifndef __COMSTACK_H__
#define __COMSTACK_H__
/* Module Version 1.0.0 */
#define COMSTACK_TYPES_SW_MAJOR_VERSION (1U)
#define COMSTACK_TYPES_SW_MINOR_VERSION (0U)
#define COMSTACK_TYPES_SW_PATCH_VERSION (0U)
/* AUTOSAR Version 4.3.1 */
#define COMSTACK_TYPES_AR_RELEASE_MAJOR_VERSION (4U)
#define COMSTACK_TYPES_AR_RELEASE_MINOR_VERSION (3U)
#define COMSTACK_TYPES_AR_RELEASE_PATCH_VERSION (1U)
#include "Std_Types.h"
/* AUTOSAR checking between Std_Types and ComStack_Types Modules */
#if ((STD_TYPES_AR_RELEASE_MAJOR_VERSION != COMSTACK_TYPES_AR_RELEASE_MAJOR_VERSION)\
|| (STD_TYPES_AR_RELEASE_MINOR_VERSION != COMSTACK_TYPES_AR_RELEASE_MINOR_VERSION)\
|| (STD_TYPES_AR_RELEASE_PATCH_VERSION != COMSTACK_TYPES_AR_RELEASE_PATCH_VERSION))
#error "The AR version of Std_Types.h does not match the expected version"
#endif
/*
[SWS_COMTYPE_00005]
This type is used within the entire AUTOSAR Com Stack except for bus drivers.
Zero-based integer number The size of this global type depends on the maximum
number of PDUs used within one software module. This parameter shall be generated by the generator tool
depending on the value configured in EcuC virtual layer. This parameter shall be generated in ComStack_Cfg.h file
Example : If '''no''' software module deals with more PDUs that 256, this type can be set to uint8.
If at least one software module handles more than 256 PDUs, this type must globally be set to uint16
*/
typedef uint16 PduIdType ;
/*
[SWS_COMTYPE_00008]
This type shall be used within the entire AUTOSAR Com Stack of an ECU except for bus drivers.
Zero-based integer number The size of this global type depends on the maximum length of PDUs to be sent by an ECU.
This parameter shall be generated by the generator tool depending on the value configured in EcuC virtual layer.
This parameter shall be generated in ComStack_Cfg.h file
Example : If no segmentation is used the length depends on the maximum payload size of a frame of the underlying
communication system (for FlexRay maximum size is 255, therefore uint8).
If segmentation is used it depends on the maximum length of a segmented N-PDU (in general uint16 is used)
*/
typedef uint32 PduLengthType ;
/*
[SWS_COMTYPE_00011]
Variables of this type shall be used to store the basic information about a PDU of any type,
namely a pointer variable pointing to its SDU (payload), a pointer to Meta Data of the PDU,
and the corresponding length of the SDU in bytes.
1- SduDataPtr: Pointer to the SDU (i.e. payload data) of the PDU.
The type of this pointer depends on the memory model being used at compile time.
2- MetaDataPtr: Pointer to the meta data (e.g. CAN ID, socket ID, diagnostic addresses) of the PDU,
consisting of a sequence of meta data items.
The length and type of the meta data items is statically configured for each PDU.
Meta data items with more than 8 bits use platform byte order.
3- SduLength: Length of the SDU in bytes.
*/
typedef struct
{
uint8* SduDataPtr ;
uint8* MetaDataPtr ;
PduLengthType SduLength ;
}PduInfoType;
/*
[SWS_COMTYPE_00039]
IcomConfigIdType defines the configuration ID. An ID of 0 is the defaultconfiguration.
An ID greater than 0 shall identify a configuration for Pretended Networking.
There is more than 1 configuration possible.
*/
typedef uint8 IcomConfigIdType;
/*
[SWS_COMTYPE_00040]
IcomSwitch_ErrorType defines the errors which can occur when activating or
deactivating Pretended Networking.
1- The activation of Pretended Networking was successful.
2- The activation of Pretended Networking was not successful
*/
typedef uint8 IcomSwitch_ErrorType;
#define ICOM_SWITCH_E_OK ((IcomSwitch_ErrorType) 0x00U)
#define ICOM_SWITCH_E_FAILED ((IcomSwitch_ErrorType) 0x01U)
#endif /* __COMSTACK_H__ */