Skip to main content

SomeIpGetRequestId

Valid for: CANoe DE • CANoe4SW DE

Function Syntax

dword SomeIpGetRequestId ( dword messageHandle );

Description

This function returns the Request ID from the SOME/IP message header.

Parameters

Return Values

  • Request ID: In the event of an error, the function returns the value 0. The SomeIpGetLastError function can then be used to check whether the value is valid or an error has occurred.

Example

void OnSomeIpMessage( DWORD messageHandle )
{
  DWORD requestId    = 0;
  LONG  errorCode    = 0;
  LONG  errorOccured = 0;

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

  if(errorOccured == 0)
  {
    write("SOME/IP message with Request ID 0x%08x received",requestId);
  } // if
}
See Also