# null

# DoIP\_GetLastResponseCode

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

**Note**

The following DoIP CAPL function is only available with the modeling library **DoIP.dll** and eventually an appropriate implementation of the CAPL Callback Interface. Information about the DoIP DLL and the CAPL Callback Interface you find here:

* [DoIP CAPL Introduction](../CAPLDiagnosticDoIP.md)
* [AN-IND-1-012\_CAPL\_Callback\_Interface.pdf](javascript:startDemoLoader\('AN-IND-1-012_CAPL_Callback_Interface.pdf'\))
* [AN-IND-1-026\_DoIP\_in\_CANoe.pdf](javascript:startDemoLoader\('AN-IND-1-026_DoIP_in_CANoe.pdf'\))

## Function Syntax

```plaintext
long DoIP_GetLastResponseCode();
```

## Description

Returns the last negative response code received from the peer.

## Parameters

—

## Return Values

* **1**: No response code received yet, or this error does not have a specific response code
* **≥ 0**: Response code, depending on protocol and error type. Please refer to ISO13400 and HSFZ specifications for details.
* **Others**: reserved

## Example

```plaintext
void DoIP_ErrorInd( int error)
{
  write( "received error %d with error code %d", error, DoIP_GetLastResponseCode());
}
```

[DoIP\_ErrorInd](CAPLfunctionDoIPErrorInd.md)
