]> rtime.felk.cvut.cz Git - arc.git/commitdiff
Added J1939 to PduR. Warning: totally untested so far.
authormaek <devnull@localhost>
Thu, 15 Sep 2011 20:42:14 +0000 (22:42 +0200)
committermaek <devnull@localhost>
Thu, 15 Sep 2011 20:42:14 +0000 (22:42 +0200)
communication/PduR/PduR_J1939Tp.c [new file with mode: 0644]
communication/PduR/PduR_Routing.c
include/PduR.h
include/PduR_Types.h

diff --git a/communication/PduR/PduR_J1939Tp.c b/communication/PduR/PduR_J1939Tp.c
new file mode 100644 (file)
index 0000000..e2d12ce
--- /dev/null
@@ -0,0 +1,46 @@
+/* -------------------------------- Arctic Core ------------------------------
+ * Arctic Core - the open source AUTOSAR platform http://arccore.com
+ *
+ * Copyright (C) 2009  ArcCore AB <contact@arccore.com>
+ *
+ * This source code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published by the
+ * Free Software Foundation; See <http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt>.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * for more details.
+ * -------------------------------- Arctic Core ------------------------------*/
+
+
+#include "PduR.h"
+#include "Det.h"
+#include "debug.h"
+
+#if (PDUR_ZERO_COST_OPERATION == STD_OFF) && (PDUR_J1939TP_SUPPORT == STD_ON)
+
+BufReq_ReturnType PduR_J1939TpProvideRxBuffer(PduIdType J1939TpTxId, PduLengthType sduLength, PduInfoType **pduInfoPtr) {
+       return PduR_ARC_ProvideRxBuffer(J1939TpTxId, sduLength, pduInfoPtr, 0x03);
+}
+
+
+void PduR_J1939TpRxIndication(PduIdType id, NotifResultType Result) {
+       PduInfoType PduInfo = {
+               .SduDataPtr = &Result,
+               .SduLength = 0 // To fix PC-Lint 785
+       };
+       PduR_ARC_RxIndication(id, &PduInfo, 0x04);
+}
+
+BufReq_ReturnType PduR_J1939TpProvideTxBuffer(PduIdType J1939TpTxId,PduInfoType** PduInfoPtr, uint16 Length) {
+       return PduR_ARC_ProvideTxBuffer(J1939TpTxId, PduInfoPtr, Length, 0x03);
+}
+
+
+void PduR_J1939TpTxConfirmation(PduIdType J1939TpTxId, NotifResultType Result) {
+       PduR_ARC_TxConfirmation(J1939TpTxId, Result, 0x0f);
+}
+
+
+#endif
index 74f83db54769e17ec76a3d5f28cd66ddbdd606ed..ee4b663b9bfeaaabf59a0e7115a8cdd5fd773e17 100644 (file)
@@ -42,6 +42,9 @@
 #if PDUR_SOAD_SUPPORT == STD_ON\r
 #include "SoAd.h"\r
 #endif\r
+#if PDUR_J1939TP_SUPPORT == STD_ON\r
+#include "J1939Tp.h"\r
+#endif\r
 \r
 \r
 #if PDUR_ZERO_COST_OPERATION == STD_OFF\r
@@ -72,6 +75,11 @@ Std_ReturnType PduR_ARC_RouteTransmit(const PduRDestPdu_type * destination, cons
        case ARC_PDUR_SOADTP:\r
 #if PDUR_SOAD_SUPPORT == STD_ON\r
                retVal = SoAdTp_Transmit(destination->DestPduId, pduInfo);\r
+#endif\r
+               break;\r
+       case ARC_PDUR_J1939TP:\r
+#if PDUR_J1939TP_SUPPORT == STD_ON\r
+               retVal = J1939Tp_Transmit(destination->DestPduId, pduInfo);\r
 #endif\r
                break;\r
        default:\r
index 46427974557307e8436dbd681ac89363fa6b9765..7bfb8d388e9394e562a804c73e471f483b5218cb 100644 (file)
@@ -71,7 +71,9 @@
 #if PDUR_SOAD_SUPPORT == STD_ON\r
 #include "PduR_SoAd.h"\r
 #endif\r
-\r
+#if PDUR_J1939TP_SUPPORT == STD_ON\r
+#include "PduR_J1939Tp.h"\r
+#endif\r
 \r
 \r
 /* Contain the current state of the PDU router. The router is uninitialized\r
index 8e00ea3c3de2adfa23aafc8aa8dfc97da9034be6..a0c3fb91a3478c0407fcbdf41e7154125cfbe3be 100644 (file)
@@ -40,6 +40,7 @@ typedef enum {
        ARC_PDUR_LINTP,\r
        ARC_PDUR_SOADTP,\r
        ARC_PDUR_SOAD,\r
+       ARC_PDUR_J1939TP,\r
 \r
        ARC_PDUR_END_OF_MODULES\r
 \r