]> rtime.felk.cvut.cz Git - arc.git/blob - include/ComStack_Types.h
Bug: mpc560x was forced to defined sleep
[arc.git] / include / ComStack_Types.h
1 /* -------------------------------- Arctic Core ------------------------------\r
2  * Arctic Core - the open source AUTOSAR platform http://arccore.com\r
3  *\r
4  * Copyright (C) 2009  ArcCore AB <contact@arccore.com>\r
5  *\r
6  * This source code is free software; you can redistribute it and/or modify it\r
7  * under the terms of the GNU General Public License version 2 as published by the\r
8  * Free Software Foundation; See <http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt>.\r
9  *\r
10  * This program is distributed in the hope that it will be useful, but\r
11  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY\r
12  * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License\r
13  * for more details.\r
14  * -------------------------------- Arctic Core ------------------------------*/\r
15 \r
16 \r
17 \r
18 \r
19 \r
20 \r
21 \r
22 \r
23 #ifndef COMSTACK_TYPES_H_\r
24 #define COMSTACK_TYPES_H_\r
25 \r
26 #define ECUC_SW_MAJOR_VERSION   1\r
27 #define ECUC_SW_MINOR_VERSION   0\r
28 #define ECUC_SW_PATCH_VERSION   0\r
29 \r
30 #include "Std_Types.h"\r
31 \r
32 \r
33 // Zero-based integer number\r
34 // The size of this global type depends on the maximum\r
35 // number of PDUs used within one software module.\r
36 // Example :\r
37 // If  no software module deals with more PDUs that\r
38 // 256, this type can be set to uint8.\r
39 // If at least one software module handles more than\r
40 // 256 PDUs, this type must globally be set to uint16.\r
41 \r
42 // In order to be able to perform table-indexing within a software\r
43 // module, variables of this type shall be zero-based and consecutive.\r
44 // There might be several ranges of PduIds in a module, one for each type of\r
45 // operation performed within that module (e.g. sending and receiving).\r
46 \r
47 typedef uint16 PduIdType;\r
48 typedef uint16 PduLengthType;\r
49 typedef struct {\r
50         uint8 *SduDataPtr;                      // payload\r
51         PduLengthType SduLength;        // length of SDU\r
52 } PduInfoType;\r
53 \r
54 typedef enum {\r
55         TP_DATACONF,\r
56         TP_DATARETRY,\r
57         TP_CONFPENDING,\r
58         TP_NORETRY,\r
59 } TpDataStateType;\r
60 \r
61 typedef struct {\r
62         TpDataStateType TpDataState;\r
63         PduLengthType TxTpDataCnt;\r
64 } RetryInfoType;\r
65 \r
66 /*\r
67 typedef struct {\r
68    P2VAR(uint8,AUTOMATIC,AUTOSAR_COMSTACKDATA) SduDataPtr\r
69    PduLengthType   SduLength;\r
70 } PduInfoType;\r
71 */\r
72 \r
73 typedef enum {\r
74         BUFREQ_OK=0,\r
75         BUFREQ_NOT_OK,\r
76         BUFREQ_BUSY,\r
77         BUFREQ_OVFL\r
78 } BufReq_ReturnType;\r
79 \r
80 // 0x00--0x1e General return types\r
81 // 0x1f--0x3c Error notif, CAN\r
82 // 0x3d--0x5a Error notif, LIN\r
83 // more\r
84 typedef uint8 NotifResultType;\r
85 \r
86 #define NTFRSLT_OK                                              0x00\r
87 #define NTFRSLT_E_NOT_OK                                0x01\r
88 #define NTFRSLT_E_CANCELATION_NOT_OK    0x0C\r
89 #define NTFRSLT_E_WRONG_SN                              0x05\r
90 #define NTFRSLT_E_NO_BUFFER                     0x09\r
91 \r
92 \r
93 // TODO, more\r
94 \r
95 typedef uint8 BusTrcvErrorType;\r
96 \r
97 \r
98 #define BUSTRCV_NO_ERROR        0x00\r
99 #define BUSBUSTRCV_E_ERROR      0x01\r
100 \r
101 \r
102 #define COMSTACKTYPE_AR_MINOR_VERSION           1\r
103 #define COMSTACKTYPE_AR_MAJOR_VERSION           0\r
104 #define COMSTACKTYPE_AR_PATCH_VERSION           0\r
105 \r
106 typedef uint8 NetworkHandleType;\r
107 \r
108 #endif /*COMSTACK_TYPES_H_*/\r