AgIsoStack++
A control-function-focused implementation of the major ISOBUS and J1939 protocols
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | Friends | List of all members
isobus::DiagnosticProtocol::DiagnosticTroubleCode Class Reference

A storage class for describing a complete DTC. More...

#include <isobus_diagnostic_protocol.hpp>

Public Member Functions

 DiagnosticTroubleCode ()=default
 Constructor for a DTC, sets default values at construction time.
 
 DiagnosticTroubleCode (std::uint32_t spn, FailureModeIdentifier fmi, LampStatus lamp)
 Constructor for a DTC, sets all values explicitly.
 
bool operator== (const DiagnosticTroubleCode &obj) const
 A useful way to compare DTC objects to each other for equality.
 
std::uint8_t get_occurrence_count () const
 Returns the occurrence count, which will be kept track of by the protocol.
 
std::uint32_t get_suspect_parameter_number () const
 Returns the suspect parameter number.
 
FailureModeIdentifier get_failure_mode_identifier () const
 Returns the failure mode indicator.
 

Private Attributes

std::uint32_t suspectParameterNumber = 0xFFFFFFFF
 This 19-bit number is used to identify the item for which diagnostics are being reported.
 
FailureModeIdentifier failureModeIdentifier = FailureModeIdentifier::ConditionExists
 The FMI defines the type of failure detected in the sub-system identified by an SPN.
 
LampStatus lampState = LampStatus::None
 The J1939 lamp state for this DTC.
 
std::uint8_t occurrenceCount = 0
 Number of times the DTC has been active (0 to 126 with 127 being not available)
 

Friends

class DiagnosticProtocol
 Allows the protocol to set the occurrence count.
 

Detailed Description

A storage class for describing a complete DTC.

Definition at line 176 of file isobus_diagnostic_protocol.hpp.

Constructor & Destructor Documentation

◆ DiagnosticTroubleCode()

isobus::DiagnosticProtocol::DiagnosticTroubleCode::DiagnosticTroubleCode ( std::uint32_t spn,
FailureModeIdentifier fmi,
LampStatus lamp )

Constructor for a DTC, sets all values explicitly.

Parameters
[in]spnThe suspect parameter number
[in]fmiThe failure mode indicator
[in]lampThe J1939 lamp status. Set to None if you don't care about J1939

Definition at line 48 of file isobus_diagnostic_protocol.cpp.

Member Function Documentation

◆ get_failure_mode_identifier()

DiagnosticProtocol::FailureModeIdentifier isobus::DiagnosticProtocol::DiagnosticTroubleCode::get_failure_mode_identifier ( ) const

Returns the failure mode indicator.

Returns
The failure mode indicator

Definition at line 72 of file isobus_diagnostic_protocol.cpp.

◆ get_occurrence_count()

std::uint8_t isobus::DiagnosticProtocol::DiagnosticTroubleCode::get_occurrence_count ( ) const

Returns the occurrence count, which will be kept track of by the protocol.

Returns
The occurrence count (0 to 126 with 127 being not available)

Definition at line 62 of file isobus_diagnostic_protocol.cpp.

◆ get_suspect_parameter_number()

std::uint32_t isobus::DiagnosticProtocol::DiagnosticTroubleCode::get_suspect_parameter_number ( ) const

Returns the suspect parameter number.

Returns
The suspect parameter number

Definition at line 67 of file isobus_diagnostic_protocol.cpp.

◆ operator==()

bool isobus::DiagnosticProtocol::DiagnosticTroubleCode::operator== ( const DiagnosticTroubleCode & obj) const

A useful way to compare DTC objects to each other for equality.

Parameters
[in]objThe "rhs" of the comparison
Returns
true if the objects were equal

Definition at line 55 of file isobus_diagnostic_protocol.cpp.

Friends And Related Symbol Documentation

◆ DiagnosticProtocol

friend class DiagnosticProtocol
friend

Allows the protocol to set the occurrence count.

Definition at line 206 of file isobus_diagnostic_protocol.hpp.

Member Data Documentation

◆ failureModeIdentifier

FailureModeIdentifier isobus::DiagnosticProtocol::DiagnosticTroubleCode::failureModeIdentifier = FailureModeIdentifier::ConditionExists
private

The FMI defines the type of failure detected in the sub-system identified by an SPN.

Definition at line 208 of file isobus_diagnostic_protocol.hpp.

◆ lampState

LampStatus isobus::DiagnosticProtocol::DiagnosticTroubleCode::lampState = LampStatus::None
private

The J1939 lamp state for this DTC.

Definition at line 209 of file isobus_diagnostic_protocol.hpp.

◆ occurrenceCount

std::uint8_t isobus::DiagnosticProtocol::DiagnosticTroubleCode::occurrenceCount = 0
private

Number of times the DTC has been active (0 to 126 with 127 being not available)

Definition at line 210 of file isobus_diagnostic_protocol.hpp.

◆ suspectParameterNumber

std::uint32_t isobus::DiagnosticProtocol::DiagnosticTroubleCode::suspectParameterNumber = 0xFFFFFFFF
private

This 19-bit number is used to identify the item for which diagnostics are being reported.

Definition at line 207 of file isobus_diagnostic_protocol.hpp.


The documentation for this class was generated from the following files: