Difference between revisions of "Extensions.DiagCom.ResultState"

From emotive
Jump to navigation Jump to search
 
(20 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{DISPLAYTITLE:Data Type '''ResultState'''}}
+
{{DISPLAYTITLE:Data Type '''ResultState'''}}[[Category:DataType]][[Category:DiagCom]]
 
== Classification ==
 
== Classification ==
{{ClassificationDataType | ResultState | State of [[Result]] | [[Simple Data Type]] | - | @ResultState:ALL_FAILED | Literal=Yes }}
+
{{ClassificationDataType | ResultState | State of [[Extensions.DiagCom.Result|Result]] | [[Core.DataTypes.SimpleDataType|Simple Data Type]] | [[Core.DataTypes.SimpleDataType.SimpleType|SimpleType]] | DefaultValue=ALL_FAILED | Literal=Yes }}
  
 
== Description ==
 
== Description ==
'''ResultState''' is an enumeration type describing the state of a [[Result]].  
+
'''ResultState''' is an enumeration type describing the state of a [[Extensions.DiagCom.Result|Result]].  
  
 
The list of allowed enumeration values is defined as follows:
 
The list of allowed enumeration values is defined as follows:
Line 10: Line 10:
 
{| {{TableHeader}}
 
{| {{TableHeader}}
 
|- {{TableHeaderRow}}
 
|- {{TableHeaderRow}}
| '''Value''' || '''Literal''' || '''Description'''
+
| '''Value''' || '''[[Literals|<span style="color:white;">Literal</span>]]''' || '''Description'''
 
|- {{TableRow1}}
 
|- {{TableRow1}}
 
| '''ALL_FAILED''' || @ResultState:ALL_FAILED || All ECUs in a functional group (listening to the same functional address) failed to answer, in case of physical addressing: the one requested ECU failed to answer.
 
| '''ALL_FAILED''' || @ResultState:ALL_FAILED || All ECUs in a functional group (listening to the same functional address) failed to answer, in case of physical addressing: the one requested ECU failed to answer.
Line 30: Line 30:
  
 
==Order Relation==
 
==Order Relation==
ResultState values may occur as operands of comparisons. For this case, the following order relation is defined:
+
ResultState values may occur as operands of comparisons. For this case, the following order relation is defined. Started with the lowest value ALL_FAILED = 0:
  
 
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;">
 
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;">
ALL_FAILED < ALL_INVALID < ALL_NEGATIVE < ALL_POSITIVE < FAILED < INVALID < NEGA-TIVE < POSITIVE
+
ALL_FAILED < ALL_INVALID < ALL_NEGATIVE < ALL_POSITIVE < FAILED < INVALID < NEGATIVE < POSITIVE
 
</syntaxhighlight>
 
</syntaxhighlight>
  
 
==Literal==
 
==Literal==
The general [[Literal]] syntax should be used:
+
The syntax for [[Literals| Literals for complex data types]] will be used, where the '''member value''' is one of the values in the list.
  
 
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;">
 
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;">
@ResultState:{ALL_FAILED|ALL_INVALID|ALL_NEGATIVE|ALL_POSITIVE| FAILED|INVALID|NEGATIVE|POSITIVE}
+
@ResultState:ALL_FAILED|ALL_INVALID|ALL_NEGATIVE|ALL_POSITIVE| FAILED|INVALID|NEGATIVE|POSITIVE
 
</syntaxhighlight>
 
</syntaxhighlight>
  
==Conversion==
+
{{ConversionTable |
The following table shows the rules for conversion to another data type:
+
Integer=Returns the index of the value in the ResultStates enumeration (smallest index is 0) | IntegerSample=<tt>Integer val = ToInteger(@ResultState:ALL_FAILED); // Returns 0</tt> |
 
+
String=Returns the name of the enumeration value | StringSample=<tt>String s = ToString(@ResultState:ALL_FAILED); // Returns "ALL_FAILED"</tt>
{| {{TableHeader}}
+
}}
|- {{TableHeaderRow}}
 
| '''Conversion''' || '''Result''' || '''Sample'''
 
|- {{TableRow1}}
 
| '''ToBoolean''' || {{MarkUndefined}} ||
 
|- {{TableRow2}}
 
| '''ToInteger''' || Returns the index of the value in the ResultStates enumeration (smallest index is 0) || <tt>Integer val = ToInteger(@ResultState:ALL_FAILED); // Returns 0</tt>
 
|- {{TableRow1}}
 
| '''ToFloat''' || {{MarkUndefined}} ||
 
|- {{TableRow2}}
 
| '''ToString''' || Returns the name of the enumeration value || <tt>String s = ToString(@ResultState:ALL_FAILED); // Returns "ALL_FAILED"</tt>
 
|- {{TableRow1}}
 
| '''ToByteField''' || {{MarkUndefined}} ||
 
|}
 
  
 
==Sample==
 
==Sample==
 
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;">
 
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;">
ResultState MyResultStateVariable = @ResultState:POSITIVE;
+
DiagCom.ResultState ResultStateVariable = @ResultState:ALL_FAILED;
 
</syntaxhighlight>
 
</syntaxhighlight>

Latest revision as of 09:57, 12 September 2019

Classification

Name ResultState
Short Description State of Result
Class Simple Data Type
Base Data Type SimpleType
Default Value ALL_FAILED
Provide a Literal Yes
SpecifiedBy ISO 13209-3
Standard Compliant Yes

Description

ResultState is an enumeration type describing the state of a Result.

The list of allowed enumeration values is defined as follows:

Value Literal Description
ALL_FAILED @ResultState:ALL_FAILED All ECUs in a functional group (listening to the same functional address) failed to answer, in case of physical addressing: the one requested ECU failed to answer.
ALL_INVALID @ResultState:ALL_INVALID All ECUs in a functional group (listening to the same functional address) returned an invalid answer, in case of physical addressing: the one requested ECU returned an invalid response.
ALL_NEGATIVE @ResultState:ALL_NEGATIVE All ECUs in a functional group (listening to the same functional address) returned a negative response, in case of physical addressing: the one requested ECU returned a negative response.
ALL_POSITIVE @ResultState:ALL_POSITIVE All ECUs in a functional group (listening to the same functional address) returned a positive response, in case of physical addressing: the one requested ECU returned a positive response.
FAILED @ResultState:FAILED Some of the ECUs in a functional group (listening to the same functional address) failed to answer.
INVALID @ResultState:INVALID Some of the ECUs in a functional group (listening to the same functional address) returned an invalid response.
NEGATIVE @ResultState:NEGATIVE Some of the ECUs in a functional group (listening to the same functional address) returned a negative response.
POSITIVE @ResultState:POSITIVE Some of the ECUs in a functional group (listening to the same functional address) returned a positive response.

Order Relation

ResultState values may occur as operands of comparisons. For this case, the following order relation is defined. Started with the lowest value ALL_FAILED = 0:

ALL_FAILED < ALL_INVALID < ALL_NEGATIVE < ALL_POSITIVE < FAILED < INVALID < NEGATIVE < POSITIVE

Literal

The syntax for Literals for complex data types will be used, where the member value is one of the values in the list.

@ResultState:ALL_FAILED|ALL_INVALID|ALL_NEGATIVE|ALL_POSITIVE| FAILED|INVALID|NEGATIVE|POSITIVE

Core Conversion

The following table shows the rules for conversion to another data type:

Conversion Result Sample
ToBoolean Undefined (should not be used)
ToInteger Returns the index of the value in the ResultStates enumeration (smallest index is 0) Integer val = ToInteger(@ResultState:ALL_FAILED); // Returns 0
ToFloat Undefined (should not be used)
ToString Returns the name of the enumeration value String s = ToString(@ResultState:ALL_FAILED); // Returns "ALL_FAILED"
ToByteField Undefined (should not be used)

Sample

DiagCom.ResultState ResultStateVariable = @ResultState:ALL_FAILED;