Skip to main content

AfdxGetTokenLengthBit

Valid for: CANoe DE • CANoe:lite DE • CANoe4SW DE • CANoe4SW:lite DE

Function Syntax

long AfdxGetTokenLengthBit( long packet, char protocolDesignator[], char tokenDesignator[] );

Description

This function returns the length of a token in bit.

Parameters

  • packet: handle of the message that has been created with AfdxInitPacket
  • protocolDesignator: name of the protocol, e.g. “afdx”
  • tokenDesignator: name of the token, e.g. “header”

Return Values

  • length of the token in bit
  • With AfdxGetLastError you have to check if the function has been processed successfully.

Example

long packet = 0;
long len = 0;
char error[100];

packet = AfdxInitPacket( "afdx" );
len = AfdxGetTokenLengthBit( packet, "afdx", "data" );
if (AfdxGetLastError() == 0)
{
  // do something with len
}
else
{
  AfdxGetLastErrorText( elCount(error), error );
  write("Error: %s", error );
}