Woman, Life, Freedom


Adaptive AUTOSAR
ARA public interface header documentation
ara::diag::DTCInformation Class Reference

A class to process Diagnostic Trouble Code (DTC) information. More...

#include <dtc_information.h>

Public Member Functions

 DTCInformation (const core::InstanceSpecifier &specifier)
 Constructor. More...
 
core::Result< UdsDtcStatusByteTypeGetCurrentStatus (uint32_t dtc)
 Get UDS DTC status byte of a certain DTC. More...
 
void SetCurrentStatus (uint32_t dtc, UdsDtcStatusBitType mask, UdsDtcStatusByteType status)
 Set UDS DTC status byte of a certain DTC. More...
 
core::Result< void > SetDTCStatusChangedNotifier (std::function< void(uint32_t, UdsDtcStatusByteType, UdsDtcStatusByteType)> notifier)
 Set a notifer on any DTC status change. More...
 
core::Result< uint32_t > GetNumberOfStoredEntries ()
 Get the number of stored DTC. More...
 
core::Result< void > SetNumberOfStoredEntriesNotifier (std::function< void(uint32_t)> notifier)
 Set a notifer on the number of stored DTC change. More...
 
core::Result< void > Clear (uint32_t dtc)
 Clear a DTC. More...
 
core::Result< ControlDtcStatusTypeGetControlDTCStatus ()
 Indicate whether the UDS DTC byte update is enabled or not. More...
 
core::Result< void > SetControlDtcStatusNotifier (std::function< void(ControlDtcStatusType)> notifier)
 Set a notifer on the control DTC status change. More...
 
core::Result< void > EnableControlDtc ()
 Enforce enabling the USD DTC status byte update. More...
 

Detailed Description

A class to process Diagnostic Trouble Code (DTC) information.

Note
Despite of the ARA standard, snapshots and overflow are not supported within this class.

Constructor & Destructor Documentation

◆ DTCInformation()

ara::diag::DTCInformation::DTCInformation ( const core::InstanceSpecifier specifier)
explicit

Constructor.

Parameters
specifierInstance specifier that owns the DTC information

Member Function Documentation

◆ Clear()

core::Result< void > ara::diag::DTCInformation::Clear ( uint32_t  dtc)

Clear a DTC.

Parameters
dtcID of the DTC that should be removed
Returns
Error if the requested DTC ID does not exist

◆ EnableControlDtc()

core::Result< void > ara::diag::DTCInformation::EnableControlDtc ( )

Enforce enabling the USD DTC status byte update.

Returns
No error

◆ GetControlDTCStatus()

core::Result< ControlDtcStatusType > ara::diag::DTCInformation::GetControlDTCStatus ( )

Indicate whether the UDS DTC byte update is enabled or not.

Returns
Control UDS status relates to the UDS service 0x85

◆ GetCurrentStatus()

core::Result< UdsDtcStatusByteType > ara::diag::DTCInformation::GetCurrentStatus ( uint32_t  dtc)

Get UDS DTC status byte of a certain DTC.

Parameters
dtcDTC ID of interest
Returns
Requested USD DTC status byte if the DTC ID exists, otherwise an error

◆ GetNumberOfStoredEntries()

core::Result< uint32_t > ara::diag::DTCInformation::GetNumberOfStoredEntries ( )

Get the number of stored DTC.

Returns
Number of currently stored DTC in the primary fault memory

◆ SetControlDtcStatusNotifier()

core::Result< void > ara::diag::DTCInformation::SetControlDtcStatusNotifier ( std::function< void(ControlDtcStatusType)>  notifier)

Set a notifer on the control DTC status change.

Parameters
notifierCallback to be invoked if the control DTC status is changed
Returns
Error in case of invalid callback pointer

◆ SetCurrentStatus()

void ara::diag::DTCInformation::SetCurrentStatus ( uint32_t  dtc,
UdsDtcStatusBitType  mask,
UdsDtcStatusByteType  status 
)

Set UDS DTC status byte of a certain DTC.

Parameters
dtcDTC ID of interest
maskDTC status byte mask
statusDTC status byte
Note
The function is not ARA compatible.

◆ SetDTCStatusChangedNotifier()

core::Result< void > ara::diag::DTCInformation::SetDTCStatusChangedNotifier ( std::function< void(uint32_t, UdsDtcStatusByteType, UdsDtcStatusByteType)>  notifier)

Set a notifer on any DTC status change.

Parameters
notifierCallback to be invoked if the status of any DTC is changed
Returns
Error in case of invalid callback pointer

◆ SetNumberOfStoredEntriesNotifier()

core::Result< void > ara::diag::DTCInformation::SetNumberOfStoredEntriesNotifier ( std::function< void(uint32_t)>  notifier)

Set a notifer on the number of stored DTC change.

Parameters
notifierCallback to be invoked if the number of stored DTC is changed
Returns
Error in case of invalid callback pointer