]> rtime.felk.cvut.cz Git - arc.git/blob - include/ComStack_Types.h
Initial commit.
[arc.git] / include / ComStack_Types.h
1 /* -------------------------------- Arctic Core ------------------------------
2  * Arctic Core - the open source AUTOSAR platform http://arccore.com
3  *
4  * Copyright (C) 2009  ArcCore AB <contact@arccore.com>
5  *
6  * This source code is free software; you can redistribute it and/or modify it
7  * under the terms of the GNU General Public License version 2 as published by the
8  * Free Software Foundation; See <http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt>.
9  *
10  * This program is distributed in the hope that it will be useful, but
11  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12  * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
13  * for more details.
14  * -------------------------------- Arctic Core ------------------------------*/
15
16
17
18
19
20
21
22
23 #ifndef COMSTACK_TYPES_H_\r
24 #define COMSTACK_TYPES_H_\r
25 \r
26 #include "Std_Types.h"\r
27 \r
28 // Proposed by Mattias\r
29 // We need a place to store the global PDU ids?\r
30 #include "ComGlobals.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 /*\r
55 typedef struct {\r
56    P2VAR(uint8,AUTOMATIC,AUTOSAR_COMSTACKDATA) SduDataPtr\r
57    PduLengthType   SduLength;\r
58 } PduInfoType;\r
59 */\r
60 \r
61 typedef enum {\r
62         BEFREQ_OK=0,\r
63         BEFREQ_NOT_OK,\r
64         BEFREQ_BUSY,\r
65         BEFREQ_OVFL,\r
66 } BufReq_ReturnType;\r
67 \r
68 // 0x00--0x1e General return types\r
69 // 0x1f--0x3c Error notif, CAN\r
70 // 0x3d--0x5a Error notif, LIN\r
71 // more\r
72 typedef uint8 NotifResultType;\r
73 \r
74 #define NTFRSLT_OK                      0\r
75 #define NTFRSLT_NOT_OK          1\r
76 // TODO, more\r
77 \r
78 typedef uint8 BusTrcvErrorType;\r
79 \r
80 \r
81 #define BUSTRCV_NO_ERROR        0x00\r
82 #define BUSBUSTRCV_E_ERROR      0x01\r
83 \r
84 \r
85 #define COMSTACKTYPE_AR_MINOR_VERSION           1\r
86 #define COMSTACKTYPE_AR_MAJOR_VERSION           0\r
87 #define COMSTACKTYPE_AR_PATCH_VERSION           0\r
88 \r
89 typedef uint8 NetworkHandleType;\r
90 \r
91 #endif /*COMSTACK_TYPES_H_*/\r