Skip to main content

diagInterpretRespAs

Valid for: CANoe DE

Function Syntax

long diagInterpretRespAs(diagRequest response, char primitiveQualifier[]);

Method Syntax

Method Syntax
diagRequest::InterpretRespAs(char primitiveQualifier[]);

Description

Treats the data of the request’s response as the specified primitive. This will cause a reinterpretation of the data, but the data will not be changed. Note: The specified primitive must be defined for the service the response currently refers to! Please refer to diagnostic descriptions with overloaded responses for details.

Parameters

  • request: Request that has to contain a response object received by waiting for a response.
  • primitiveQualifier: Qualifier of the service primitive that should be used for reinterpretation.

Return Values

Example

A tester module tries to interpret the response received for a request.
if( 1 == testWaitForDiagResponse( request, 2000))
{ 
   if( 0 == diagInterpretRespAs( request, "ServiEcu1PR"))
   {
      if( 27.5 < diagGetRespParameter( request, "Voltage"))
         TestStepPass( "Voltage is high enough");
      else
         TestStepFail( "Voltage too low");
   } else
   { 
      TestStepFail( "Unexpected response version");
   }
} else
{ 
   TestStepFail( "No response received");
}