]> rtime.felk.cvut.cz Git - arc.git/commitdiff
Added missing files.
authormaek <devnull@localhost>
Wed, 18 May 2011 17:42:18 +0000 (19:42 +0200)
committermaek <devnull@localhost>
Wed, 18 May 2011 17:42:18 +0000 (19:42 +0200)
communication/PduR/PduR_Logic.c [new file with mode: 0644]
communication/PduR/PduR_Routing.c [new file with mode: 0644]
communication/PduR/PduR_SoAd.c [new file with mode: 0644]
include/PduR_SoAd.h [new file with mode: 0644]

diff --git a/communication/PduR/PduR_Logic.c b/communication/PduR/PduR_Logic.c
new file mode 100644 (file)
index 0000000..c33aa48
--- /dev/null
@@ -0,0 +1,268 @@
+/* -------------------------------- Arctic Core ------------------------------\r
+ * Arctic Core - the open source AUTOSAR platform http://arccore.com\r
+ *\r
+ * Copyright (C) 2009  ArcCore AB <contact@arccore.com>\r
+ *\r
+ * This source code is free software; you can redistribute it and/or modify it\r
+ * under the terms of the GNU General Public License version 2 as published by the\r
+ * Free Software Foundation; See <http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt>.\r
+ *\r
+ * This program is distributed in the hope that it will be useful, but\r
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY\r
+ * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License\r
+ * for more details.\r
+ * -------------------------------- Arctic Core ------------------------------*/\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+#include "PduR.h"\r
+\r
+#include <string.h>\r
+#include "debug.h"\r
+#include "Det.h"\r
+#if defined(USE_DEM)\r
+#include "Dem.h"\r
+#endif\r
+\r
+#if PDUR_ZERO_COST_OPERATION == STD_OFF\r
+\r
+#define PduRTpBuffer(_id) (&PduRConfig->TpBuffers[_id])\r
+#define PduRTpRouteBuffer(_id) (PduRConfig->TpRouteBuffers[_id])\r
+\r
+\r
+BufReq_ReturnType PduR_ARC_AllocateRxBuffer(PduIdType PduId, PduLengthType TpSduLength) {\r
+       BufReq_ReturnType failRetVal = BUFREQ_BUSY;\r
+       for (uint8 i = 0; PduRTpBuffer(i)->pduInfoPtr != NULL; i++) {\r
+               if (PduRTpBuffer(i)->status == PDUR_BUFFER_FREE) {\r
+                       if (PduRTpBuffer(i)->pduInfoPtr->SduLength < TpSduLength) {\r
+                               failRetVal = BUFREQ_OVFL;\r
+                       } else {\r
+                               PduRTpRouteBuffer(PduId) = PduRTpBuffer(i);\r
+                               PduRTpRouteBuffer(PduId)->status = PDUR_BUFFER_RX_BUSY;\r
+                               return BUFREQ_OK;\r
+                       }\r
+               }\r
+       }\r
+       return failRetVal;\r
+}\r
+\r
+BufReq_ReturnType PduR_ARC_AllocateTxBuffer(PduIdType PduId, uint16 length) {\r
+       if (PduRTpRouteBuffer(PduId)->status == PDUR_BUFFER_TX_READY) {\r
+               if (length >= PduRTpRouteBuffer(PduId)->pduInfoPtr->SduLength) {\r
+                       PduRTpRouteBuffer(PduId)->status = PDUR_BUFFER_TX_BUSY;\r
+                       return BUFREQ_OK;\r
+               } else {\r
+                       return BUFREQ_NOT_OK;\r
+               }\r
+       }\r
+       return BUFREQ_BUSY;\r
+}\r
+\r
+BufReq_ReturnType PduR_ARC_ReleaseRxBuffer(PduIdType PduId) {\r
+       if (PduRTpRouteBuffer(PduId) == NULL) return BUFREQ_OK;\r
+       if (PduRTpRouteBuffer(PduId)->status == PDUR_BUFFER_RX_BUSY) {\r
+               PduRTpRouteBuffer(PduId)->status = PDUR_BUFFER_TX_READY;\r
+               return BUFREQ_BUSY;\r
+       }\r
+       return BUFREQ_OK;\r
+}\r
+\r
+BufReq_ReturnType PduR_ARC_ReleaseTxBuffer(PduIdType PduId) {\r
+       if (PduRTpRouteBuffer(PduId)->status == PDUR_BUFFER_TX_BUSY) {\r
+               PduRTpRouteBuffer(PduId)->status = PDUR_BUFFER_FREE;\r
+               PduRTpRouteBuffer(PduId) = NULL;\r
+               return BUFREQ_OK;\r
+       }\r
+       return BUFREQ_NOT_OK;\r
+}\r
+\r
+Std_ReturnType PduR_ARC_Transmit(PduIdType PduId, const PduInfoType* PduInfo, uint8 serviceId) {\r
+       PDUR_VALIDATE_INITIALIZED(serviceId,E_NOT_OK);\r
+       PDUR_VALIDATE_PDUPTR(serviceId, PduInfo, E_NOT_OK);\r
+       PDUR_VALIDATE_PDUID(serviceId, PduId, E_NOT_OK);\r
+\r
+       Std_ReturnType retVal = E_OK;\r
+       const PduRRoutingPath_type *route = PduRConfig->RoutingPaths[PduId];\r
+       for (int i = 0; route->PduRDestPdus[i] != NULL; i++) {\r
+               const PduRDestPdu_type * destination = route->PduRDestPdus[i];\r
+\r
+               retVal |= PduR_ARC_RouteTransmit(destination, PduInfo);\r
+       }\r
+       return retVal;\r
+}\r
+\r
+void PduR_ARC_RxIndicationTT(const PduRDestPdu_type * destination, const PduInfoType *PduInfo, uint8 BufferLength) {\r
+       Std_ReturnType retVal = E_OK;\r
+\r
+       uint8 bytesToCopy = 0;\r
+       if (PduInfo->SduLength > BufferLength) bytesToCopy = BufferLength;\r
+       else bytesToCopy = PduInfo->SduLength;\r
+\r
+       if (!memcpy(destination->TxBufferRef, PduInfo->SduDataPtr, bytesToCopy)) retVal |= E_NOT_OK;\r
+       retVal |= PduR_ARC_RouteTransmit(destination, PduInfo);\r
+\r
+       if (retVal != E_OK) {\r
+#if defined(USE_DEM)\r
+               Dem_ReportErrorStatus(PDUR_E_PDU_INSTANCE_LOST, DEM_EVENT_STATUS_FAILED);\r
+#endif\r
+       }\r
+       /*\r
+       // This is a gateway request which uses trigger transmit data provision. PDUR255\r
+       if (destination->TxBufferRef->TxConfP) { // Transfer confirmation pending.\r
+               // Enqueue the new I-PDU. This will flush the buffer if it is full according to the buffer specification.\r
+               PduR_BufferQueue(destination->TxBufferRef, PduInfo->SduDataPtr);\r
+               // TODO report PDUR_E_PDU_INSTANCE_LOST to DEM if needed.\r
+       }\r
+\r
+       if (destination->TxBufferRef->TxConfP) { // No transfer confirmation pending (anymore).\r
+               uint8 val[PduInfo->SduLength];\r
+               PduInfoType NewPduInfo = {\r
+                       .SduDataPtr = val,\r
+                       .SduLength = PduInfo->SduLength\r
+               };\r
+               PduR_BufferDeQueue(destination->TxBufferRef, val);\r
+               PduR_BufferQueue(destination->TxBufferRef, PduInfo->SduDataPtr);\r
+               retVal = PduR_ARC_RouteTransmit(destination, &NewPduInfo);\r
+               if (retVal == E_OK) {\r
+                       setTxConfP(destination->TxBufferRef);\r
+               }\r
+       }\r
+       */\r
+}\r
+\r
+void PduR_ARC_RxIndicationDirect(const PduRDestPdu_type * destination, const PduInfoType *PduInfo) {\r
+       Std_ReturnType retVal = PduR_ARC_RouteTransmit(destination, PduInfo);\r
+       if (retVal != E_OK) {\r
+#if defined(USE_DEM)\r
+               Dem_ReportErrorStatus(PDUR_E_PDU_INSTANCE_LOST, DEM_EVENT_STATUS_FAILED);\r
+#endif\r
+       }\r
+}\r
+\r
+void PduR_ARC_RxIndication(PduIdType PduId, const PduInfoType* PduInfo, uint8 serviceId) {\r
+       PDUR_VALIDATE_INITIALIZED(serviceId);\r
+       PDUR_VALIDATE_PDUPTR(serviceId, PduInfo);\r
+       PDUR_VALIDATE_PDUID(serviceId, PduId);\r
+\r
+       const PduRRoutingPath_type *route = PduRConfig->RoutingPaths[PduId];\r
+\r
+       for (int i = 0; route->PduRDestPdus[i] != NULL; i++) {\r
+               const PduRDestPdu_type * destination = route->PduRDestPdus[i];\r
+\r
+               if (PduR_IsUpModule(destination->DestModule)) {\r
+                       PduR_ARC_RouteRxIndication(destination, PduInfo);\r
+\r
+               } else if (PduR_IsLoModule(destination->DestModule)) {\r
+\r
+                       if (PduR_IsTpModule(destination->DestModule)) { // TP Gateway\r
+                               if (PduR_ARC_ReleaseRxBuffer(PduId) == BUFREQ_BUSY) {\r
+                                       // Transmit previous rx buffer\r
+                                       PduR_ARC_RouteTransmit(destination, PduRTpRouteBuffer(PduId)->pduInfoPtr);\r
+                               }\r
+\r
+                       } else if (destination->DataProvision == PDUR_TRIGGER_TRANSMIT) {\r
+                               PduR_ARC_RxIndicationTT(destination, PduInfo, route->SduLength);\r
+\r
+                       } else if (destination->DataProvision == PDUR_DIRECT) {\r
+                               PduR_ARC_RxIndicationDirect(destination, PduInfo);\r
+\r
+                       }\r
+               }\r
+       }\r
+}\r
+\r
+void PduR_ARC_TxConfirmation(PduIdType PduId, uint8 result, uint8 serviceId) {\r
+       PDUR_VALIDATE_INITIALIZED(serviceId);\r
+       PDUR_VALIDATE_PDUID(serviceId, PduId);\r
+\r
+       const PduRRoutingPath_type *route = PduRConfig->RoutingPaths[PduId];\r
+\r
+       if (PduR_IsUpModule(route->SrcModule)) {\r
+               PduR_ARC_RouteTxConfirmation(route, result);\r
+\r
+       } else if (PduR_IsLoModule(route->SrcModule)) {\r
+               // Release any buffer hold by this route.\r
+               PduR_ARC_ReleaseTxBuffer(PduId);\r
+       }\r
+}\r
+\r
+Std_ReturnType PduR_ARC_TriggerTransmit(PduIdType PduId, PduInfoType* PduInfo, uint8 serviceId) {\r
+       PDUR_VALIDATE_INITIALIZED(serviceId, E_NOT_OK);\r
+       PDUR_VALIDATE_PDUPTR(serviceId, PduInfo, E_NOT_OK);\r
+       PDUR_VALIDATE_PDUID(serviceId, PduId, E_NOT_OK);\r
+\r
+       Std_ReturnType retVal = E_OK;\r
+       const PduRRoutingPath_type *route = PduRConfig->RoutingPaths[PduId];\r
+       const PduRDestPdu_type * destination = route->PduRDestPdus[0];\r
+\r
+       if (PduR_IsUpModule(route->SrcModule)) {\r
+               retVal |= PduR_ARC_RouteTriggerTransmit(route, PduInfo);\r
+\r
+       } else if (PduR_IsLoModule(route->SrcModule)) {\r
+               if (destination->DataProvision == PDUR_TRIGGER_TRANSMIT) {\r
+                       uint8 bytesToCopy = 0;\r
+                       if (PduInfo->SduLength > route->SduLength) bytesToCopy = route->SduLength;\r
+                       else bytesToCopy = PduInfo->SduLength;\r
+\r
+                       if (!memcpy((void *)PduInfo->SduDataPtr, (void *)destination->TxBufferRef, bytesToCopy)) {\r
+                               retVal = E_NOT_OK;\r
+                       }\r
+               }\r
+       }\r
+       return retVal;\r
+}\r
+\r
+BufReq_ReturnType PduR_ARC_ProvideRxBuffer(PduIdType PduId, PduLengthType TpSduLength, PduInfoType** PduInfoPtr, uint8 serviceId) {\r
+       PDUR_VALIDATE_INITIALIZED(serviceId,BUFREQ_NOT_OK);\r
+       PDUR_VALIDATE_PDUPTR(serviceId, PduInfoPtr, BUFREQ_NOT_OK);\r
+       PDUR_VALIDATE_PDUID(serviceId, PduId, BUFREQ_NOT_OK);\r
+\r
+       BufReq_ReturnType retVal = BUFREQ_NOT_OK;\r
+       const PduRRoutingPath_type *route = PduRConfig->RoutingPaths[PduId];\r
+       const PduRDestPdu_type * destination = route->PduRDestPdus[0];\r
+\r
+       if (PduR_IsUpModule(destination->DestModule)) {\r
+               retVal = PduR_ARC_RouteProvideRxBuffer(destination, TpSduLength, PduInfoPtr);\r
+\r
+       } else if (PduR_IsLoModule(destination->DestModule)) {\r
+               if (PduR_ARC_ReleaseRxBuffer(PduId) == BUFREQ_BUSY) {\r
+                       // Transmit previous rx buffer\r
+                       PduR_ARC_RouteTransmit(destination, PduRTpRouteBuffer(PduId)->pduInfoPtr);\r
+               }\r
+\r
+               retVal = PduR_ARC_AllocateRxBuffer(PduId, TpSduLength);\r
+               if (retVal == BUFREQ_OK) {\r
+                       *PduInfoPtr = PduRTpRouteBuffer(PduId)->pduInfoPtr;\r
+               }\r
+       }\r
+       return retVal;\r
+}\r
+\r
+BufReq_ReturnType PduR_ARC_ProvideTxBuffer(PduIdType PduId, PduInfoType** PduInfoPtr, uint16 Length, uint8 serviceId) {\r
+       PDUR_VALIDATE_INITIALIZED(serviceId,BUFREQ_NOT_OK);\r
+       PDUR_VALIDATE_PDUPTR(serviceId, PduInfoPtr, BUFREQ_NOT_OK);\r
+       PDUR_VALIDATE_PDUID(serviceId, PduId, BUFREQ_NOT_OK);\r
+\r
+       BufReq_ReturnType retVal = BUFREQ_NOT_OK;\r
+       const PduRRoutingPath_type *route = PduRConfig->RoutingPaths[PduId];\r
+\r
+       if (PduR_IsUpModule(route->SrcModule)) {\r
+               retVal = PduR_ARC_RouteProvideTxBuffer(route, Length, PduInfoPtr);\r
+\r
+       } else if (PduR_IsLoModule(route->SrcModule)) {\r
+               retVal = PduR_ARC_AllocateTxBuffer(PduId, Length);\r
+               if (retVal == BUFREQ_OK) {\r
+                       *PduInfoPtr = PduRTpRouteBuffer(PduId)->pduInfoPtr;\r
+               }\r
+       }\r
+       return retVal;\r
+}\r
+\r
+\r
+\r
+#endif\r
diff --git a/communication/PduR/PduR_Routing.c b/communication/PduR/PduR_Routing.c
new file mode 100644 (file)
index 0000000..4648633
--- /dev/null
@@ -0,0 +1,163 @@
+/* -------------------------------- Arctic Core ------------------------------\r
+ * Arctic Core - the open source AUTOSAR platform http://arccore.com\r
+ *\r
+ * Copyright (C) 2009  ArcCore AB <contact@arccore.com>\r
+ *\r
+ * This source code is free software; you can redistribute it and/or modify it\r
+ * under the terms of the GNU General Public License version 2 as published by the\r
+ * Free Software Foundation; See <http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt>.\r
+ *\r
+ * This program is distributed in the hope that it will be useful, but\r
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY\r
+ * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License\r
+ * for more details.\r
+ * -------------------------------- Arctic Core ------------------------------*/\r
+\r
+\r
+#include "PduR.h"\r
+\r
+\r
+#include <string.h>\r
+#include "debug.h"\r
+#if defined(USE_DEM)\r
+#include "Dem.h"\r
+#endif\r
+\r
+\r
+#if PDUR_CANIF_SUPPORT == STD_ON\r
+#include "CanIf.h"\r
+#endif\r
+#if PDUR_CANTP_SUPPORT == STD_ON\r
+#include "CanTp.h"\r
+#endif\r
+#if PDUR_LINIF_SUPPORT == STD_ON\r
+#include "LinIf.h"\r
+#endif\r
+#if PDUR_COM_SUPPORT == STD_ON\r
+#include "Com.h"\r
+#endif\r
+#if PDUR_DCM_SUPPORT == STD_ON\r
+#include "Dcm.h"\r
+#endif\r
+#if PDUR_SOAD_SUPPORT == STD_ON\r
+#include "SoAd.h"\r
+#endif\r
+\r
+\r
+#if PDUR_ZERO_COST_OPERATION == STD_OFF\r
+\r
+Std_ReturnType PduR_ARC_RouteTransmit(const PduRDestPdu_type * destination, const PduInfoType * pduInfo) {\r
+\r
+       switch (destination->DestModule) {\r
+       case ARC_PDUR_CANIF:\r
+#if PDUR_CANIF_SUPPORT == STD_ON\r
+               return CanIf_Transmit(destination->DestPduId, pduInfo);\r
+#endif\r
+               break;\r
+       case ARC_PDUR_LINIF:\r
+#if PDUR_LINIF_SUPPORT == STD_ON\r
+               return LinIf_Transmit(destination->DestPduId, pduInfo);\r
+#endif\r
+               break;\r
+       case ARC_PDUR_CANTP:\r
+#if PDUR_CANTP_SUPPORT == STD_ON\r
+               return CanTp_Transmit(destination->DestPduId, pduInfo);\r
+#endif\r
+               break;\r
+       case ARC_PDUR_SOADIF:\r
+#if PDUR_SOAD_SUPPORT == STD_ON\r
+               return SoAdIf_Transmit(destination->DestPduId, pduInfo);\r
+#endif\r
+               break;\r
+       case ARC_PDUR_SOADTP:\r
+#if PDUR_SOAD_SUPPORT == STD_ON\r
+               return SoAdTp_Transmit(destination->DestPduId, pduInfo);\r
+#endif\r
+               break;\r
+       default:\r
+               break;\r
+       }\r
+       // TODO error reporting here.\r
+       return E_NOT_OK;\r
+}\r
+\r
+void PduR_ARC_RouteRxIndication(const PduRDestPdu_type * destination, const PduInfoType *PduInfo) {\r
+\r
+       switch (destination->DestModule) {\r
+       case ARC_PDUR_COM:\r
+#if PDUR_COM_SUPPORT == STD_ON\r
+               Com_RxIndication(destination->DestPduId, PduInfo);\r
+#endif\r
+               break;\r
+       case ARC_PDUR_DCM:\r
+#if PDUR_DCM_SUPPORT == STD_ON\r
+               Dcm_RxIndication(destination->DestPduId, *PduInfo->SduDataPtr);\r
+#endif\r
+               break;\r
+       default:\r
+               break;\r
+       }\r
+       // TODO error reporting here.\r
+}\r
+\r
+void PduR_ARC_RouteTxConfirmation(const PduRRoutingPath_type *route, uint8 result) {\r
+       switch (route->SrcModule) {\r
+       case ARC_PDUR_COM:\r
+#if PDUR_COM_SUPPORT == STD_ON\r
+               Com_TxConfirmation(route->SrcPduId);\r
+#endif\r
+               break;\r
+       case ARC_PDUR_DCM:\r
+#if PDUR_DCM_SUPPORT == STD_ON\r
+               Dcm_TxConfirmation(route->SrcPduId, result);\r
+#endif\r
+               break;\r
+       default:\r
+               break;\r
+       }\r
+       // TODO error reporting here.\r
+}\r
+\r
+Std_ReturnType PduR_ARC_RouteTriggerTransmit(const PduRRoutingPath_type *route, PduInfoType * pduInfo) {\r
+       switch (route->SrcModule) {\r
+       case ARC_PDUR_COM:\r
+#if PDUR_COM_SUPPORT == STD_ON\r
+               return Com_TriggerTransmit(route->SrcPduId, pduInfo);\r
+#endif\r
+               break;\r
+       default:\r
+               break;\r
+       }\r
+       // TODO error reporting here.\r
+       return E_NOT_OK;\r
+}\r
+\r
+BufReq_ReturnType PduR_ARC_RouteProvideRxBuffer(const PduRDestPdu_type * destination, PduLengthType TpSduLength, PduInfoType** PduInfoPtr) {\r
+       switch (destination->DestModule) {\r
+       case ARC_PDUR_DCM:\r
+#if PDUR_DCM_SUPPORT == STD_ON\r
+               return Dcm_ProvideRxBuffer(destination->DestPduId, TpSduLength, PduInfoPtr);\r
+#endif\r
+               break;\r
+       default:\r
+               break;\r
+       }\r
+       // TODO error reporting here.\r
+       return BUFREQ_NOT_OK;\r
+}\r
+\r
+BufReq_ReturnType PduR_ARC_RouteProvideTxBuffer(const PduRRoutingPath_type *route, PduLengthType TpSduLength, PduInfoType** PduInfoPtr) {\r
+       switch (route->SrcModule) {\r
+       case ARC_PDUR_DCM:\r
+#if PDUR_DCM_SUPPORT == STD_ON\r
+               return Dcm_ProvideTxBuffer(route->SrcPduId, PduInfoPtr, TpSduLength);\r
+#endif\r
+               break;\r
+       default:\r
+               break;\r
+       }\r
+       // TODO error reporting here.\r
+       return BUFREQ_NOT_OK;\r
+}\r
+\r
+#endif\r
diff --git a/communication/PduR/PduR_SoAd.c b/communication/PduR/PduR_SoAd.c
new file mode 100644 (file)
index 0000000..5a21a51
--- /dev/null
@@ -0,0 +1,68 @@
+/* -------------------------------- Arctic Core ------------------------------\r
+ * Arctic Core - the open source AUTOSAR platform http://arccore.com\r
+ *\r
+ * Copyright (C) 2009  ArcCore AB <contact@arccore.com>\r
+ *\r
+ * This source code is free software; you can redistribute it and/or modify it\r
+ * under the terms of the GNU General Public License version 2 as published by the\r
+ * Free Software Foundation; See <http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt>.\r
+ *\r
+ * This program is distributed in the hope that it will be useful, but\r
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY\r
+ * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License\r
+ * for more details.\r
+ * -------------------------------- Arctic Core ------------------------------*/\r
+\r
+\r
+#include "PduR.h"\r
+\r
+\r
+#include "Det.h"\r
+#include "debug.h"\r
+\r
+#if PDUR_ZERO_COST_OPERATION == STD_OFF\r
+\r
+BufReq_ReturnType PduR_SoAdTpProvideRxBuffer(PduIdType dcmRxPduId, PduLengthType sduLength, PduInfoType **pduInfoPtr) {\r
+    return PduR_ARC_ProvideRxBuffer(dcmRxPduId, sduLength, pduInfoPtr, 0x03);\r
+}\r
+\r
+void PduR_SoAdTpRxIndication(PduIdType dcmRxPduId, NotifResultType result)\r
+{\r
+       PduInfoType PduInfo = {\r
+               .SduDataPtr = &result\r
+       };\r
+       PduR_ARC_RxIndication(dcmRxPduId, &PduInfo, 0x04);\r
+}\r
+\r
+BufReq_ReturnType PduR_SoAdTpProvideTxBuffer(PduIdType dcmTxPduId, PduInfoType **pduInfoPtr, PduLengthType length)\r
+{\r
+       return PduR_ARC_ProvideTxBuffer(dcmTxPduId, pduInfoPtr, length, 0x03);\r
+}\r
+\r
+void PduR_SoAdTpTxConfirmation(PduIdType dcmTxPduId, NotifResultType Result)\r
+{\r
+       PduR_ARC_TxConfirmation(dcmTxPduId, Result, 0x0f);\r
+}\r
+\r
+\r
+/* PduR_SoAd interface API implementation */\r
+void PduR_SoAdIfRxIndication(PduIdType RxPduId, const uint8* SduPtr) {\r
+       PduInfoType PduInfo = {\r
+               .SduDataPtr = (uint8 *)SduPtr\r
+       };\r
+       PduR_ARC_RxIndication(RxPduId, &PduInfo, 0x01);\r
+}\r
+\r
+void PduR_SoAdIfTxConfirmation(PduIdType ComTxPduId) {\r
+       uint8 dummy = 0;\r
+       PduR_ARC_TxConfirmation(ComTxPduId, dummy, 0x02);\r
+}\r
+\r
+void PduR_SoAdIfTriggerTransmit(PduIdType TxPduId, uint8 *SduPtr) {\r
+       PduInfoType PduInfo = {\r
+               .SduDataPtr = SduPtr\r
+       };\r
+       PduR_ARC_TriggerTransmit(TxPduId, &PduInfo, 0x10);\r
+}\r
+\r
+#endif\r
diff --git a/include/PduR_SoAd.h b/include/PduR_SoAd.h
new file mode 100644 (file)
index 0000000..eae2935
--- /dev/null
@@ -0,0 +1,43 @@
+/* -------------------------------- Arctic Core ------------------------------\r
+ * Arctic Core - the open source AUTOSAR platform http://arccore.com\r
+ *\r
+ * Copyright (C) 2009  ArcCore AB <contact@arccore.com>\r
+ *\r
+ * This source code is free software; you can redistribute it and/or modify it\r
+ * under the terms of the GNU General Public License version 2 as published by the\r
+ * Free Software Foundation; See <http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt>.\r
+ *\r
+ * This program is distributed in the hope that it will be useful, but\r
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY\r
+ * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License\r
+ * for more details.\r
+ * -------------------------------- Arctic Core ------------------------------*/\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+#ifndef PDUR_SOAD_H_\r
+#define PDUR_SOAD_H_\r
+\r
+#include "PduR.h"\r
+\r
+#if PDUR_ZERO_COST_OPERATION == STD_OFF\r
+\r
+/* SoAd acts as transport protocol module */\r
+BufReq_ReturnType PduR_SoAdTpProvideRxBuffer(PduIdType dcmRxPduId, PduLengthType sduLength, PduInfoType **pduInfoPtr);\r
+void PduR_SoAdTpRxIndication(PduIdType dcmRxPduId, NotifResultType result);\r
+BufReq_ReturnType PduR_SoAdTpProvideTxBuffer(PduIdType dcmTxPduId, PduInfoType **pduInfoPtr, PduLengthType length);\r
+void PduR_SoAdTpTxConfirmation(PduIdType dcmTxPduId, NotifResultType result);\r
+\r
+/* SoAd acts as interface module */\r
+void PduR_SoAdIfRxIndication(PduIdType RxPduId, const uint8* SduPtr);\r
+void PduR_SoAdIfTxConfirmation(PduIdType ComTxPduId);\r
+void PduR_SoAdIfTriggerTransmit(PduIdType TxPduId, uint8 *SduPtr);\r
+\r
+#endif\r
+\r
+#endif /* PDUR_SOAD_H_ */\r