#ifndef E2EPWSWC2
#include "E2E_SWC_Rx.h"
#endif

E2EImplementationDataType_0 E2E_InterSWC_Tmp;

FUNC(uint32, E2E_InterSWC_2) E2EPW_Read_E2E_InterSWC_2_PPortPrototype_0(E2EImplementationDataType_0 *E2E_InterSWC_Var2)
{	uint32 E2EPW_error= 0x01;
	Std_ReturnType E2E_error;



	/*Read the data provided over the port by SWC 1*/
	Rte_Read_RPort_E2E_Data_Alive_Cnt(&E2E_InterSWC_Tmp.Impl_Alive_Cnt);
	Rte_Read_RPort_E2E_Data_CKS(&E2E_InterSWC_Tmp.Impl_CKS);
	Rte_Read_RPort_E2E_Data_Data(&E2E_InterSWC_Tmp.Impl_Data);
	/**/

	E2E_P02ReceiverState_SWC2.NewDataAvailable = TRUE;

	/*Data serialization can be done here if necessary */
	/**/

	/* Check if the data received is correct (Checksum and alive counter)*/
	E2E_error = E2E_P02Check(&E2E_P02_StaticCfg_SWC2,&E2E_P02ReceiverState_SWC2,(uint8 *)&E2E_InterSWC_Tmp);

	if( ( E2E_P02ReceiverState_SWC2.Status == E2E_P02STATUS_OK ) ||
		( E2E_P02ReceiverState_SWC2.Status == E2E_P02STATUS_INITIAL ) ||
		( E2E_P02ReceiverState_SWC2.Status == E2E_P02STATUS_OKSOMELOST ) )
	{
		*E2E_InterSWC_Var2 = *(E2EImplementationDataType_0*)&E2E_InterSWC_Tmp;
	}
	/**/


	return ((RTE_E_OK) | (E2EPW_error << 8) | (E2E_error <<16 ) | (uint8)(E2E_P02ReceiverState_SWC2.Status << 24));
}



