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
+ if (PduRTpBuffer(i)->bufferSize < TpSduLength) {\r
failRetVal = BUFREQ_OVFL;\r
} else {\r
PduRTpRouteBuffer(PduId) = PduRTpBuffer(i);\r
+ PduRTpBuffer(i)->pduInfoPtr->SduLength = TpSduLength;\r
PduRTpRouteBuffer(PduId)->status = PDUR_BUFFER_RX_BUSY;\r
return BUFREQ_OK;\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
+ if ((length >= PduRTpRouteBuffer(PduId)->pduInfoPtr->SduLength) || (length == 0)) {\r
PduRTpRouteBuffer(PduId)->status = PDUR_BUFFER_TX_BUSY;\r
return BUFREQ_OK;\r
} else {\r
typedef struct {\r
PduInfoType *pduInfoPtr;\r
PduRTpBufferStatus_type status;\r
+ const uint16 bufferSize;\r
} PduRTpBufferInfo_type;\r
\r
typedef struct {\r
*\r
* Comment: Only required if a TX buffer is configured.\r
*/\r
- const uint8 SduLength;\r
+ const uint16 SduLength;\r
\r
/**\r
* Chunk size for routing on the fly.\r