I add Port and DataElement in each SWC for SWC(SW Components) refer and modify one common variable (e.g. sensorData).
Then there are problems.Problem 1 : Runnable in SWC need to many of RTE Read API (Rte_Read_).Problem 2 : Only recent data received by the last RTE Read API is available.
This is the code that is currently implemented
// SWC1#include "Rte_Swc.1"void Runnable_Sender1(void){ SensorData_t sensorData; Rte_Read_Swc1_RpSender2Data_SensorData(&sensorData); Rte_Read_Swc1_RpSender3Data_SensorData(&sensorData); sensorData.sensorId = 1; sensorData.sensorValue = 100; Rte_Write_Swc1_PpSender1Data_SensorData(&sensorData);}
// SWC2#include "Rte_Swc.2"void Runnable_Sender2(void){ SensorData_t sensorData; Rte_Read_Swc2_RpSender1Data_SensorData(&sensorData); Rte_Read_Swc2_RpSender3Data_SensorData(&sensorData); sensorData.sensorId = 2; sensorData.sensorValue = 20 Rte_Write_Swc2_PpSender2Data_SensorData(&sensorData);}
// SWC3#include "Rte_Swc.3"void Runnable_Sender3(void){ SensorData_t sensorData; Rte_Read_Swc3_RpSender1Data_SensorData(&sensorData); Rte_Read_Swc3_RpSender2Data_SensorData(&sensorData); sensorData.sensorId = 3; sensorData.sensorValue = 300; Rte_Write_Swc3_PpSender3Data_SensorData(&sensorData);}
I wonder if there is a good solution.