Skip to main content

J1939GetSourceAddress

Valid for: CANoe DE • CANoe4SW DE

Function Syntax

dword J1939GetSourceAddress (pg* aPG); // form 1
dword J1939GetSourceAddress (dword canId); // form 2

Description

Returns the source address of a parameter group or CAN ID.

Parameters

  • aPG: The function returns the source address of this parameter group.
  • canId: The function returns the source address of this CAN ID.

Return Values

  • 0..255: Source address.

Example

void MessageIsReceived(dword canId)
{
  write("Receive message with sa %u, da %u, priority %u and data page %u",
    J1939GetPGN(
      J1939GetSourceAddress(canId),
      J1939GetDestAddress(canId),
      J1939GetPrio(canId),
      J1939GetDatapage(canId)
    );
}
J1939 General Functions