]> rtime.felk.cvut.cz Git - arc.git/blob - include/J1939Tp.h
Merge branch 'mikulka' of git@rtime.felk.cvut.cz:arc into mikulka
[arc.git] / include / J1939Tp.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 /** Global requirements */\r
17 /** @req J1939TP0005*/\r
18 \r
19 #ifndef J1939TP_H_\r
20 #define J1939TP_H_\r
21 \r
22 #include "Std_Types.h"\r
23 /** @req J1939TP0016 */\r
24 #include "ComStack_Types.h"\r
25 #include "J1939Tp_ConfigTypes.h"\r
26 /** @req J1939TP0009 */\r
27 #include "CanIf.h"\r
28 \r
29 \r
30 #define J1939TP_VENDOR_ID                       1\r
31 #define J1939TP_MODULE_ID                       MODULE_ID_J1939TP\r
32 \r
33 #define J1939TP_AR_MAJOR_VERSION        1\r
34 #define J1939TP_AR_MINOR_VERSION        0\r
35 #define J1939TP_AR_PATCH_VERSION        0\r
36 \r
37 #define J1939TP_SW_MAJOR_VERSION        1\r
38 #define J1939TP_SW_MINOR_VERSION        0\r
39 #define J1939TP_SW_PATCH_VERSION        0\r
40 \r
41 #include "J1939Tp_Cfg.h"\r
42 \r
43 typedef int TPParameterType;\r
44 \r
45 #if (J1939TP_VERSION_INFO_API == STD_ON)\r
46 #define J1939TP_GetVersionInfo(_vi) STD_GET_VERSION_INFO(_vi,J1939TP)\r
47 #endif\r
48 \r
49 /** Initializes the module */\r
50 void J1939Tp_Init(const J1939Tp_ConfigType* ConfigPtr);\r
51 \r
52 /** Close down communication, usually called by EcuM */\r
53 void J1939Tp_Shutdown(void);\r
54 \r
55 /** Returns the version info of J1939Tp */\r
56 void J1939Tp_GetVersionInfo(Std_VersionInfoType* VersionInfo);\r
57 \r
58 /** Used to request the transfer of a J1939Tp N-SDU*/\r
59 Std_ReturnType J1939Tp_Transmit(PduIdType TxSduId, const PduInfoType* TxInfoPtr);\r
60 \r
61 /** Used to cancel the ongoing transmission of a J1939Tp N-SDU */\r
62 Std_ReturnType J1939Tp_CancelTransmitRequest(PduIdType TxSduId);\r
63 \r
64 /** Used to cancel the ongoing reception of a J1939Tp N-SDU */\r
65 Std_ReturnType J1939Tp_CancelReceiveRequest(PduIdType RxSduId);\r
66 \r
67 /** Used to change reception or transmission parameters of J1939Tp for a specific N-SDU */\r
68 Std_ReturnType J1939Tp_ChangeParameterRequest(PduIdType SduId, TPParameterType Parameter, uint16 value);\r
69 \r
70 /** Main function, used for scheduling purpose and timeout supervision */\r
71 void J1939Tp_MainFunction(void);\r
72 \r
73 #endif\r