Skip to main content

C2xGetTokenData

Valid for: CANoe DE

Function Syntax

  • long C2xGetTokenData( long packet, char protocolDesignator[], char tokenDesignator[], long length, char buffer[] );
  • long C2xGetTokenData( long packet, char protocolDesignator[], char tokenDesignatorl[], long length, byte buffer[] );
  • long C2xGetTokenData( long packet, char protocolDesignator[], char tokenDesignator[], long length, struct bufferStruct );
  • long C2xGetTokenData( long packet, char protocolDesignator[], char tokenDesignator[], long byteOffset, long length, char buffer[] );
  • long C2xGetTokenData( long packet, char protocolDesignator[], char tokenDesignator[], long byteOffset, long length, byte buffer[] );
  • long C2xGetTokenData( long packet, char protocolDesignator[], char tokenDesignator[], long byteOffset, long length, struct bufferStruct );

Description

This function requests the data or a part of data of a token.

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. data
  • byteOffset: Offset from the beginning of the token in byte
  • length: Number of bytes to be copied. Make sure size of destination (buffer or bufferStruct) is equal or larger than length.
  • buffer: Buffer in which the data are copied
  • bufferStruct: Struct in which the data are copied

Return Values

With C2xGetLastError you can check if the function has been processed successfully.
  • 0: —
  • ≠0: Number of copied bytes

Example

Node System - PreStart in CAPL Browser
Node Callback Function in CAPL Browser