1 /* -------------------------------- Arctic Core ------------------------------
\r
2 * Arctic Core - the open source AUTOSAR platform http://arccore.com
\r
4 * Copyright (C) 2009 ArcCore AB <contact@arccore.com>
\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
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
14 * -------------------------------- Arctic Core ------------------------------*/
\r
22 #if defined(USE_DEM)
\r
27 #if PDUR_CANIF_SUPPORT == STD_ON
\r
30 #if PDUR_CANTP_SUPPORT == STD_ON
\r
33 #if PDUR_LINIF_SUPPORT == STD_ON
\r
36 #if PDUR_COM_SUPPORT == STD_ON
\r
39 #if PDUR_DCM_SUPPORT == STD_ON
\r
42 #if PDUR_SOAD_SUPPORT == STD_ON
\r
47 #if PDUR_ZERO_COST_OPERATION == STD_OFF
\r
49 Std_ReturnType PduR_ARC_RouteTransmit(const PduRDestPdu_type * destination, const PduInfoType * pduInfo) {
\r
50 Std_ReturnType retVal = E_NOT_OK;
\r
51 switch (destination->DestModule) {
\r
52 case ARC_PDUR_CANIF:
\r
53 #if PDUR_CANIF_SUPPORT == STD_ON
\r
54 retVal = CanIf_Transmit(destination->DestPduId, pduInfo);
\r
57 case ARC_PDUR_LINIF:
\r
58 #if PDUR_LINIF_SUPPORT == STD_ON
\r
59 retVal = LinIf_Transmit(destination->DestPduId, pduInfo);
\r
62 case ARC_PDUR_CANTP:
\r
63 #if PDUR_CANTP_SUPPORT == STD_ON
\r
64 retVal = CanTp_Transmit(destination->DestPduId, pduInfo);
\r
67 case ARC_PDUR_SOADIF:
\r
68 #if PDUR_SOAD_SUPPORT == STD_ON
\r
69 retVal = SoAdIf_Transmit(destination->DestPduId, pduInfo);
\r
72 case ARC_PDUR_SOADTP:
\r
73 #if PDUR_SOAD_SUPPORT == STD_ON
\r
74 retVal = SoAdTp_Transmit(destination->DestPduId, pduInfo);
\r
81 // TODO error reporting here.
\r
85 void PduR_ARC_RouteRxIndication(const PduRDestPdu_type * destination, const PduInfoType *PduInfo) {
\r
87 switch (destination->DestModule) {
\r
89 #if PDUR_COM_SUPPORT == STD_ON
\r
90 Com_RxIndication(destination->DestPduId, PduInfo);
\r
94 #if PDUR_DCM_SUPPORT == STD_ON
\r
95 Dcm_RxIndication(destination->DestPduId, *PduInfo->SduDataPtr);
\r
101 // TODO error reporting here.
\r
104 void PduR_ARC_RouteTxConfirmation(const PduRRoutingPath_type *route, uint8 result) {
\r
105 switch (route->SrcModule) {
\r
107 #if PDUR_COM_SUPPORT == STD_ON
\r
108 Com_TxConfirmation(route->SrcPduId);
\r
112 #if PDUR_DCM_SUPPORT == STD_ON
\r
113 Dcm_TxConfirmation(route->SrcPduId, result);
\r
119 // TODO error reporting here.
\r
122 Std_ReturnType PduR_ARC_RouteTriggerTransmit(const PduRRoutingPath_type *route, PduInfoType * pduInfo) {
\r
123 Std_ReturnType retVal = E_NOT_OK;
\r
124 switch (route->SrcModule) {
\r
126 #if PDUR_COM_SUPPORT == STD_ON
\r
127 retVal = Com_TriggerTransmit(route->SrcPduId, pduInfo);
\r
134 // TODO error reporting here.
\r
138 BufReq_ReturnType PduR_ARC_RouteProvideRxBuffer(const PduRDestPdu_type * destination, PduLengthType TpSduLength, PduInfoType** PduInfoPtr) {
\r
139 BufReq_ReturnType retVal;
\r
140 switch (destination->DestModule) {
\r
142 #if PDUR_DCM_SUPPORT == STD_ON
\r
143 retVal = Dcm_ProvideRxBuffer(destination->DestPduId, TpSduLength, PduInfoPtr);
\r
147 retVal = BUFREQ_NOT_OK;
\r
150 // TODO error reporting here.
\r
154 BufReq_ReturnType PduR_ARC_RouteProvideTxBuffer(const PduRRoutingPath_type *route, PduLengthType TpSduLength, PduInfoType** PduInfoPtr) {
\r
155 BufReq_ReturnType retVal;
\r
156 switch (route->SrcModule) {
\r
158 #if PDUR_DCM_SUPPORT == STD_ON
\r
159 retVal = Dcm_ProvideTxBuffer(route->SrcPduId, PduInfoPtr, TpSduLength);
\r
163 retVal = BUFREQ_NOT_OK;
\r
166 // TODO error reporting here.
\r