# null

# AREthGetReturnCode

[Valid for](../../../../Shared/FeatureAvailability.md): CANoe DE • CANoe4SW DE

## Function Syntax

```plaintext
dword AREthGetReturnCode ( dword messageHandle );
```

## Description

This function returns the Return Code from the SOME/IP message header.

## Parameters

* **messageHandle**: Handle of the SOME/IP message (e.g. see [OnAREthMessage](CAPLfunctionOnAREthMessage.md))

## Return Values

* **Return code**:
  * 0x00: E\_OK
  * 0x01: E\_NOT\_OK
  * 0x02: E\_UNKNOWN\_SERVICE
  * 0x03: E\_UNKNOWN\_METHOD
  * 0x04: E\_NOT\_READY
  * 0x05: E\_NOT\_REACHABLE
  * 0x06: E\_TIMEOUT
  * 0x07: E\_WRONG\_PROTOCOL\_VERSION
  * 0x08: E\_WRONG\_INTERFACE\_VERSION
  * 0x09: E\_MALFORMED\_MESSAGE
  * 0x09: 0x1F RESERVED

If message type is REQUEST, REQUEST\_NO\_RETURN or NOTIFICATION return code is N/A and set to 0x00 (E\_OK).

In the event of an error, the function returns the value 0. The [AREthGetLastError](CAPLfunctionAREthGetLastError.md) function can then be used to check whether the value is valid or an error has occurred.

## Example

```plaintext
void OnAREthMessage( dword messageHandle )
{
  dword retCode       = 0;
  LONG  errorCode     = 0;
  LONG  errorOccured  = 0;

  // get data from SOME/IP message
  if((retCode = AREthGetReturnCode(messageHandle)) == 0)
  {
    // check if last function was executed correct
    if((errorCode = AREthGetLastError()) != 0)
    {
      write("AUTOSAR Eth IL error occured: Error code: %d", errorCode);
      errorOccured = 1;
    } // if
  } // if

  if(errorOccured == 0)
  {
    write("SOME/IP message with Return Code 0x%02x received",retCode);
  } // if
}
```

[See Also](javascript:void\(0\);)
