I am trying to delete diagnostic information but I am strugling to find the configuration in Tresos which would enable ClearDTC interface.
What would be the right way to clear all DTC's internally from the context of SWC?
AUTOSAR Dem component has a standardized Client/Server Interface "ClearDTC", which has two operations:
In your authoring tool (not Tresos), you have to add these to your project with your SWC. (They can be found also in the AUTOSAR Blueprints)
You add a new R-Port (e.g. rDemClearDTC) with that PortInterface. In your runnable entity, you should add then for both operations of that interface a SynchronousServerCallPoint.
Finally, in your implementation you should then call these operations over the port by Rte calls.
void MySwc_Runnable(void) {
Std_ReturnType ret;
// sscp_SelectDTC
ret = Rte_Call_rDemClearDTC_SelectDTC(0xFFFFFFu, DEM_DTC_FORMAT_UDS, DEM_DTC_ORIGIN_PRIMARY_MEMORY);
// sscp_ClearDTC
ret = Rte_Call_rDemClearDTC_ClearDTC();
}
You might have to configure also in Dem a second DemClient, because this ClientId should be part of the Tresos-generated Dem ServiceSwComponent as port-defined argument.
The C/S Interface ClearDTC is (according to the Dem SWS) actually only related to ComplexDrivers and not normal ApplicationSwComponents. The question is also, why you would want to call ClearDTC at all from your SWC.