]> rtime.felk.cvut.cz Git - arc.git/blobdiff - communication/PduR/PduR_CanTp.c
Starting 'pdur2' branch with copied content from remote repository.
[arc.git] / communication / PduR / PduR_CanTp.c
index 3e8a15faca4e56d379d81a77f2e2d10d7d01b9a9..b197dd0344e1f772ebb63ad80a2e14c784141801 100644 (file)
 \r
 \r
 #include "PduR.h"\r
-\r
-#if (PDUR_ZERO_COST_OPERATION == STD_OFF)\r
 #include "Det.h"\r
 #include "debug.h"\r
 \r
+#if PDUR_ZERO_COST_OPERATION == STD_OFF\r
 \r
 BufReq_ReturnType PduR_CanTpProvideRxBuffer(PduIdType CanTpRxPduId, PduLengthType TpSduLength, PduInfoType** PduInfoPtr) {\r
-       BufReq_ReturnType retVal = BUFREQ_NOT_OK;\r
-#if (PDUR_CANTP_SUPPORT == STD_ON)\r
-       /* Gateway and multicast modes not supported. */\r
-       PduRRoutingPath_type *route = &PduRConfig->PduRRoutingTable->PduRRoutingPath[CanTpRxPduId];\r
-       retVal = Dcm_ProvideRxBuffer(route->PduRDestPdu.DestPduId, TpSduLength, PduInfoPtr);\r
-#endif\r
-       return retVal;\r
+       return PduR_ARC_ProvideRxBuffer(CanTpRxPduId, TpSduLength, PduInfoPtr, 0x03);\r
 }\r
 \r
 \r
 void PduR_CanTpRxIndication(PduIdType CanTpRxPduId, NotifResultType Result) {\r
-#if (PDUR_CANTP_SUPPORT == STD_ON)\r
-\r
-       DEBUG(DEBUG_LOW,"----------------------\n");\r
-       DEBUG(DEBUG_LOW,"PduR_CanTpRxIndication: received indication with id %d and data %d\n", CanTpRxPduId);\r
-\r
-       /* Note that there is no support for CAN TP and gateway operation mode */\r
-       PduRRoutingPath_type *route = &PduRConfig->PduRRoutingTable->PduRRoutingPath[CanTpRxPduId];\r
-       Dcm_RxIndication(route->PduRDestPdu.DestPduId, Result); // Send PDU to next receptor.\r
-\r
-       DEBUG(DEBUG_LOW,"----------------------\n");\r
-#endif\r
+       PduInfoType PduInfo = {\r
+               .SduDataPtr = &Result\r
+       };\r
+       PduR_ARC_RxIndication(CanTpRxPduId, &PduInfo, 0x04);\r
 }\r
 \r
 \r
 BufReq_ReturnType PduR_CanTpProvideTxBuffer(PduIdType CanTpTxPduId, PduInfoType** PduInfoPtr, uint16 Length) {\r
-       BufReq_ReturnType retVal = BUFREQ_NOT_OK;\r
-#if (PDUR_CANTP_SUPPORT == STD_ON)\r
-       /* Gateway and multicast modes not supported. */\r
-       PduRRoutingPath_type *route = &PduRConfig->PduRRoutingTable->PduRRoutingPath[CanTpTxPduId];\r
-       retVal = Dcm_ProvideTxBuffer(route->PduRSrcPdu.SrcPduId, PduInfoPtr, Length);\r
-#endif\r
-       return retVal;\r
+       return PduR_ARC_ProvideTxBuffer(CanTpTxPduId, PduInfoPtr, Length, 0x03);\r
 }\r
 \r
 \r
 void PduR_CanTpTxConfirmation(PduIdType CanTpTxPduId, NotifResultType Result) {\r
-#if (PDUR_CANTP_SUPPORT == STD_ON)\r
-       PduR_DevCheck(CanTpTxPduId,1,0x0f);\r
-\r
-       DEBUG(DEBUG_LOW,"----------------------\n");\r
-       DEBUG(DEBUG_LOW,"PduR_CanIfTxConfirmation: received confirmation with id %d\n", CanTxPduId);\r
-\r
-       PduRRoutingPath_type *route = &PduRConfig->PduRRoutingTable->PduRRoutingPath[CanTpTxPduId];\r
-       Dcm_TxConfirmation(route->PduRSrcPdu.SrcPduId, Result); // Forward confirmation\r
-\r
-       DEBUG(DEBUG_LOW,"----------------------\n");\r
-#endif\r
+       PduR_ARC_TxConfirmation(CanTpTxPduId, Result, 0x0f);\r
 }\r
 \r
-\r
 #endif\r