]> rtime.felk.cvut.cz Git - arc.git/blob - include/J1939Tp_ConfigTypes.h
3281abe807912fe20291a72864b34359eba5f48e
[arc.git] / include / J1939Tp_ConfigTypes.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 #ifndef J1939TP_CONFIGTYPES_H_\r
18 #define J1939TP_CONFIGTYPES_H_\r
19 \r
20 #include "ComStack_Types.h"\r
21 \r
22 typedef enum {\r
23         J1939TP_PROTOCOL_BAM,\r
24         J1939TP_PROTOCOL_CMDT\r
25 } J1939Tp_ProtocolType;\r
26 \r
27 typedef enum {\r
28         J1939TP_RX,\r
29         J1939TP_TX\r
30 } J1939Tp_DirectionType;\r
31 \r
32 /** This N-PDU represents the TP.CM frame that is used in reverese direction\r
33  * for a J1939 transport protocol session using CMDT. TP.CM in reverse direction\r
34  * is used for intermediate and final ack of received  data and to abort the connection
35  */\r
36 \r
37 \r
38 typedef struct J1939Tp_ChannelType_ J1939Tp_ChannelType;\r
39 typedef struct J1939Tp_PgType_ J1939Tp_PgType;\r
40 typedef uint32 J1939Tp_PgnType;\r
41 \r
42 struct J1939Tp_PgType_ {\r
43         const boolean                                   DynLength;\r
44         const J1939Tp_PgnType                   Pgn;\r
45         const PduIdType                                 DirectNPdu; /** only set when DynLength = true */\r
46         const PduIdType                                 NSdu;\r
47         const J1939Tp_ChannelType*              Channel;\r
48 };\r
49 \r
50 struct J1939Tp_ChannelType_ {\r
51         const J1939Tp_ProtocolType      Protocol;\r
52         const PduIdType                         DtNPdu;\r
53         const PduIdType                         CmNPdu;\r
54         const PduIdType                         FcNPdu; /** only set when Protocol == J1939TP_PROTOCOL_CMDT */\r
55         const J1939Tp_DirectionType Direction;\r
56 } ;\r
57 \r
58 /** @req J1939TP0175 */\r
59 typedef struct {\r
60         const J1939Tp_PgType* Pgs;\r
61         const J1939Tp_ChannelType* Channels;\r
62 } J1939Tp_ConfigType;\r
63 \r
64 #endif\r