]> rtime.felk.cvut.cz Git - arc.git/blob - include/CanTp.h
Merge branch 'mikulka' of git@rtime.felk.cvut.cz:arc into mikulka
[arc.git] / include / CanTp.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 /** @addtogroup TBD\r
17  *  @{ */\r
18 \r
19 /** @file CanTp.h\r
20  * TBD.\r
21  */\r
22 \r
23 /** @req CANTP157 */\r
24 \r
25 #ifndef CANTP_H_\r
26 #define CANTP_H_\r
27 \r
28 #define CANTP_MODULE_ID                         MODULE_ID_CANTP /** @req CANTP115 */\r
29 #define CANTP_VENDOR_ID                         1\r
30 \r
31 #define CANTP_SW_MAJOR_VERSION          1\r
32 #define CANTP_SW_MINOR_VERSION          0\r
33 #define CANTP_SW_PATCH_VERSION          0\r
34 #define CANTP_AR_MAJOR_VERSION          3\r
35 #define CANTP_AR_MINOR_VERSION          0\r
36 #define CANTP_AR_PATCH_VERSION          1\r
37 \r
38 \r
39 #include "ComStack_Types.h"\r
40 #include "Std_Types.h"\r
41 #include "CanTp_Cfg.h"  /** @req CANTP221 */\r
42 //#include "Dem.h"\r
43 \r
44 /*\r
45  *\r
46  * Errors described by CanTp 7.4 Error classification.\r
47  *\r
48  ****************************/\r
49 /** @req CANTP101 */\r
50 #define CANTP_E_PARAM_CONFIG            0x01\r
51 #define CANTP_E_PARAM_ID                        0x02\r
52 #define CANTP_E_PARAM_ADDRESS           0x04\r
53 \r
54 #define CANTP_E_UNINIT                          0x20\r
55 #define CANTP_E_INVALID_TX_ID           0x30\r
56 #define CANTP_E_INVALID_RX_ID           0x40\r
57 #define CANTP_E_INVALID_TX_BUFFER       0x50\r
58 #define CANTP_E_INVALID_RX_BUFFER       0x60\r
59 #define CANTP_E_INVALID_TX_LENGHT       0x70\r
60 #define CANTP_E_INVALID_RX_LENGTH       0x80\r
61 #define CANTP_E_INVALID_TATYPE          0x90\r
62 \r
63 /*\r
64  * Service IDs for CanTP function definitions.\r
65  */\r
66 \r
67 #define SERVICE_ID_CANTP_INIT                                           0x01\r
68 #define SERVICE_ID_CANTP_GET_VERSION_INFO                       0x07\r
69 #define SERVICE_ID_CANTP_SHUTDOWN                                       0x02\r
70 #define SERVICE_ID_CANTP_TRANSMIT                                       0x03\r
71 #define SERVICE_ID_CANTP_CANCEL_TRANSMIT_REQUEST        0x03\r
72 #define SERVICE_ID_CANTP_MAIN_FUNCTION                          0x06\r
73 #define SERVICE_ID_CANTP_RX_INDICATION                          0x04\r
74 #define SERVICE_ID_CANTP_TX_CONFIRMATION                        0x05\r
75 \r
76 \r
77 /*\r
78  * Structs\r
79  ****************************/\r
80 \r
81 typedef enum {\r
82         FRTP_CNLDO,\r
83         FRTP_CNLNB,\r
84         FRTP_CNLOR\r
85 } FrTp_CancelReasonType;\r
86 \r
87 \r
88 \r
89 /*\r
90  * Implemented functions\r
91  ****************************/\r
92 \r
93 void CanTp_Init(void); /** @req CANTP208 **/\r
94 \r
95 #if ( CANTP_VERSION_INFO_API == STD_ON ) /** @req CANTP162 *//** @req CANTP163 */\r
96 #define CanTp_GetVersionInfo(_vi) STD_GET_VERSION_INFO(_vi,CANTP) /** @req CANTP210 */ /* @req CANTP218 */\r
97 #endif /* CANTP_VERSION_INFO_API */\r
98 \r
99 void CanTp_Shutdown(void); /** @req CANTP211 */\r
100 \r
101 Std_ReturnType CanTp_Transmit( PduIdType CanTpTxSduId, const PduInfoType * CanTpTxInfoPtr ); /** @req CANTP212 */\r
102 \r
103 Std_ReturnType FrTp_CancelTransmitRequest( PduIdType FrTpTxPduId, FrTp_CancelReasonType FrTpCancelReason ); /** @req CANTP246 */\r
104 \r
105 void CanTp_MainFunction(void); /** @req CANTP213 */\r
106 \r
107 \r
108 #endif /* CANTP_H_ */\r