Skip to main content

C2xGetTokenLengthBit

Valid for: CANoe DE

Function Syntax

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

Description

This function returns the length of a token in bit.

Parameters

  • packet: Handle of a packet that has been created with C2xInitPacket
  • protocolDesignator: Name of the protocol, e.g. geo_cnh
  • tokenDesignator: Name of the token, e.g. header

Return Values

  • Length of the token in bit
  • With C2xGetLastError you can check if the function has been processed successfully.

Example

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

packet = C2xInitPacket( "geo_cnh" );
len = C2xGetTokenLengthBit( packet, "geo_cnh", "header" ); // = 32

if (C2xGetLastError() == 0)
{
  // do something with len
}
else
{
  C2xGetLastErrorText( elCount(error), error );
  write("Error: %s", error );
}