Difference between revisions of "Extensions.DiagCom.GetDiagServiceFromException"

From emotive
Jump to navigation Jump to search
Line 1: Line 1:
 
{{DISPLAYTITLE:OTX '''GetDiagServiceFromException'''}}[[Category:DiagCom]]
 
{{DISPLAYTITLE:OTX '''GetDiagServiceFromException'''}}[[Category:DiagCom]]
 
== Classification ==
 
== Classification ==
{{ClassificationActivity | GetDiagServiceFromException | Diagnostic service that caused the exception | [[Term]] | [[Extensions.DiagCom|OTX DiagCom extension]] | [[DiagService related terms]] | [[Core.Actions.Throw.Exception.UnknownTargetException|UnknownTargetException]] <br/> [[Core.Actions.Throw.Exception.TypeMismatchException|TypeMismatchException]] | - }}
+
{{ClassificationActivity | GetDiagServiceFromException | Gets the handle of the '''DiagService''' that caused the exception | [[Term]] | [[Extensions.DiagCom|OTX DiagCom extension]] | [[Extensions.DiagCom#Terms|DiagService related terms]] | [[Extensions.DiagCom.UnknownTargetException|UnknownTargetException]] <br/> [[Core.DataTypes.ComplexDataType.TypeMismatchException|TypeMismatchException]] | - }}
  
 
== OTL Syntax ==
 
== OTL Syntax ==
 
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;">
 
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;">
DiagServiceTerm = DiagCom.GetDiagServiceFromException(ExceptionTerm);
+
DiagServiceTerm = DiagCom.GetDiagServiceFromException(ExceptionValue);
 
</syntaxhighlight>
 
</syntaxhighlight>
  
 
== Description ==
 
== Description ==
The '''GetDiagServiceFromException''' term returns the diagnostic service that caused the exception.
+
The '''GetDiagServiceFromException''' term accepts an '''ExceptionReference''' and shall return the handle of the '''DiagService''' that caused the exception to be thrown. It shall only be used together with exceptions of type [[Extensions.DiagCom.UnknownResponseException|UnknownResponseException]] that shall be thrown by the [[Extensions.DiagCom.ExecuteDiagService|ExecuteDiagService]] action in case the static response mapping does not map a response that has been returned from the vehicle.
  
{{TermReturnValue| [[Core.DataTypes.ComplexDataType.DiagService|DiagService]] | Diagnostics Service.}}
+
{{TermReturnValue| [[Extensions.DiagCom.DiagService|DiagService]] | The handle of the '''DiagService''' that caused the exception.}}
  
 
== Properties ==
 
== Properties ==
 
{| {{TableHeader}}
 
{| {{TableHeader}}
 
{{TableRowPropertiesHeader}}
 
{{TableRowPropertiesHeader}}
{{TableRowPropertie1| UnknownResponseException | [[Core.Actions.Throw.Exception|Exception]] | [[Term]] | - | [1] | Exception of type [[Core.Actions.Throw.Exception.UnknownResponseException|UnknownResponseException]], which is examined.}}
+
{{TableRowPropertie1| UnknownResponseException | [[Core.DataTypes.ComplexDataType.Exception|Exception]] | [[Value]] | - | [1] | Specifies the '''Exception''' for which the '''DiagService''' shall be retrieved that caused the exception when executed. It is only allowed to reference exceptions of type '''UnknownResponseException'''.}}
 
|}
 
|}
  
 
== OTL Examples ==
 
== OTL Examples ==
 
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;">
 
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;">
DiagCom.ComChannel myComCannel;
 
 
DiagCom.DiagService DiagService1;
 
DiagCom.DiagService DiagService1;
DiagCom.DiagComException Handle1;
+
DiagCom.UnknownResponseException Handle1;
 +
DiagCom.ComChannel ComChannel1;
  
myComCannel = DiagCom.GetComChannel("LL_AllEmissRelatUDSSyste", null, false);
+
/// Flow
DiagService1 = DiagCom.CreateDiagServiceByName(myComCannel, "DiagnServi_ReadDataByIdentCalibData");
 
  
 
try
 
try
 
{
 
{
  DiagCom.ExecuteDiagService(DiagService1, {}, {}, false, false);
+
ComChannel1 = DiagCom.GetComChannel("LL_AllEmissRelatUDSSyste", NULL, false);
 +
[#MetaData(RequestPdu), <#Data>22 F1 9E</#Data>]
 +
DiagCom.ExecuteDiagService(DiagCom.CreateDiagServiceByName(ComChannel1, "DiagnServi_ReadDataByIdentASAMODXFileIdent"), {}, {Resp_ReadDataByIdentASAMODXFileIdent.Expected = true}, NULL, NULL, false, false);
 
}
 
}
catch (DiagCom.DiagComException Handle1)
+
catch (DiagCom.UnknownResponseException Handle1)
 
{
 
{
 +
DiagService1 = DiagCom.GetDiagServiceFromException(Handle1);
 
}
 
}
 
DiagService1 = DiagCom.GetDiagServiceFromException(Handle1);
 
 
</syntaxhighlight>
 
</syntaxhighlight>
  
Line 46: Line 46:
 
[[Extensions.DiagCom.GetDiagServiceName|GetDiagServiceName]] <br/>
 
[[Extensions.DiagCom.GetDiagServiceName|GetDiagServiceName]] <br/>
 
[[Extensions.DiagCom.ExecuteDiagService|ExecuteDiagService]] <br/>
 
[[Extensions.DiagCom.ExecuteDiagService|ExecuteDiagService]] <br/>
[[Core.Actions.Throw.Exception.UnknownResponseException|UnknownResponseException]]
+
[[Extensions.DiagCom.GetComChannel|GetComChannel]]

Revision as of 04:33, 12 October 2018

Classification

Name GetDiagServiceFromException
Short Description Gets the handle of the DiagService that caused the exception
Class Term
Extension OTX DiagCom extension
Group DiagService related terms
Exceptions UnknownTargetException
TypeMismatchException
Checker Rules -
Standard Compliant Yes

OTL Syntax

DiagServiceTerm = DiagCom.GetDiagServiceFromException(ExceptionValue);

Description

The GetDiagServiceFromException term accepts an ExceptionReference and shall return the handle of the DiagService that caused the exception to be thrown. It shall only be used together with exceptions of type UnknownResponseException that shall be thrown by the ExecuteDiagService action in case the static response mapping does not map a response that has been returned from the vehicle.

Return Value

The Term returns the value, see table below.

Icons Note.png In OTX, Terms are categorized according to its return data type!
Data Type Description
DiagService The handle of the DiagService that caused the exception.

Properties

Name Data Type Class Default Cardinality Description
UnknownResponseException Exception Value - [1] Specifies the Exception for which the DiagService shall be retrieved that caused the exception when executed. It is only allowed to reference exceptions of type UnknownResponseException.

OTL Examples

DiagCom.DiagService DiagService1;
DiagCom.UnknownResponseException Handle1;
DiagCom.ComChannel ComChannel1;

/// Flow

try
{
	ComChannel1 = DiagCom.GetComChannel("LL_AllEmissRelatUDSSyste", NULL, false);
	[#MetaData(RequestPdu), <#Data>22 F1 9E</#Data>]
	DiagCom.ExecuteDiagService(DiagCom.CreateDiagServiceByName(ComChannel1, "DiagnServi_ReadDataByIdentASAMODXFileIdent"), {}, {Resp_ReadDataByIdentASAMODXFileIdent.Expected = true}, NULL, NULL, false, false);
}
catch (DiagCom.UnknownResponseException Handle1)
{
	DiagService1 = DiagCom.GetDiagServiceFromException(Handle1);
}

See also

CreateDiagServiceByName
CreateDiagServiceBySemantic
GetDiagServiceListBySemantic
GetDiagServiceFromResult
GetDiagServiceName
ExecuteDiagService
GetComChannel