Skip to main content
Open topic with navigation CAPL Functions » Smart Charging » SCC Modeling Libraries (Simulation Setup) » Shared Callback Functions » SCC_PayloadPreSendInd

SCC_PayloadPreSendInd

Valid for:  CANoe DE  •  CANoe4SW DE Notes
  • This callback is called after SCC_PreSendInd (EVSE only), but before SCC_MessageTxInd.
  • The usual restrictions of the protocol apply once sending starts, i.e. minimum length of Ethernet packets, TCP fragmentation and retransmission.
  • The payload field of the application header is not affected when setting the payload length with this function. However, it can be altered as part of the payload.

Function Syntax

void SCC_PayloadPreSendInd(byte SessionOrRunID[], dword MessageID, byte Payload[], dword& PayloadLength)

Description

The callback is called each time a Vehicle2Grid, SECC Discovery or SLAC message is ready to be sent by the simulation DLL. It allows to peek for the payload and its length before sending. Also, both payload and length may be changed for the purpose of fault injection.

Parameters

  • SessionOrRunID: 8-byte long SessionID (V2G) or RunID (SLAC) of the connection, range: 0 – 0xFF FF FF FF FF FF FF FF.
  • MessageID: Type of sent message:
    • For SLAC messages, MMType (2 byte) according to specification.
    • For V2G messages see help page MessageID.
  • Payload: The ETH/UDP/TCP payload data (writable).
  • PayloadLength: The length of the ETH/UDP/TCP payload (writable).

Return Values

Example

SCC_PayloadPreSendInd(byte SessionOrRunID[], dword MessageID, byte Payload[], dword& PayloadLength)
{
  Write("PayloadPreSend: message %i with payload %i", MessageID, PayloadLength);

  if (MessageID == 20) // PowerDeliveryRes
  {
    PayloadLength += 2;  // increase length by two bytes
    
    // dummy values for additional bytes
    Payload [25] = 0x99;
    Payload [26] = 0x99;
  }
}